Is there a code for the Kaufman Efficiency Ratio Indicator? I read on Google there was, but I can't seem to find it.
Edit: found it, shared by @tomsk. Developed by Mobius.
Edit: found it, shared by @tomsk. Developed by Mobius.
Code:
# Kaufman Efficiency Ratio
# Mobius
# 1.29.2017
# Here's the Kaufman Efficiency Ratio that the Kaufman AMA is based on.
# Notes: Price at extremes are entry / exit signals. Price in zone between extremes and equity should be avoided.
declare lower;
input n = 10;
def netchg = close - close[n];
def sumchg = sum(AbsValue(close - close[1]), n);
plot KER = (netchg / sumchg);
KER.SetStyle(Curve.Firm);
KER.SetDefaultColor(Color.Cyan);
plot zero = if isNaN(close) then double.nan else 0;
zero.SetDefaultColor(Color.gray);
plot OB = HighestAll(KER) * .8;
OB.SetDefaultColor(Color.red);
plot OS = LowestAll(KER) * .8;
OS.SetDefaultColor(Color.green);
# End Code Kaufman Efficiency Ratio