# Kaufman Efficiency Ratio Buy / Sell Signals

#### Ananas

##### New member
# Kaufman Efficiency Ratio by Bezna\$
# It's a good idea to have one at n=50 and an othe one at n=80
# ----------------------------------------------------------
declare lower;
input N = 50;
input Threshold = .80;
def netchg = close - close[N];
def sumchg = Sum(AbsValue(close - close[1]), N);
plot KER = round((netchg / sumchg), 2);
KER.SetStyle(Curve.FIRM);
KER.SetDefaultColor(Color.light_gray);
KER.SetLineWeight(1);

plot Zero = 0;
Zero.SetDefaultColor(Color.white);

plot OS = HighestAll(KER) * Threshold; #.8;
OS.SetDefaultColor(Color.RED);

plot OB = LowestAll(KER) * Threshold; #.8;
OB.SetDefaultColor(Color.GREEN);

def Buy = KER < OB;
def Sell = KER > OS;

#=============
KER.DefineColor("Neutral", Color.gray);
KER.DefineColor("Sell", Color.RED);
#==================
def SellSignal = if KER crosses above OS then KER else Double.NaN;
def BuySignal = if KER crosses below OB then KER else Double.NaN;

#### germanburrito

##### Active member
# Kaufman Efficiency Ratio by Bezna\$
# It's a good idea to have one at n=50 and an othe one at n=80
# ----------------------------------------------------------
declare lower;
input N = 50;
input Threshold = .80;
def netchg = close - close[N];
def sumchg = Sum(AbsValue(close - close[1]), N);
plot KER = round((netchg / sumchg), 2);
KER.SetStyle(Curve.FIRM);
KER.SetDefaultColor(Color.light_gray);
KER.SetLineWeight(1);

plot Zero = 0;
Zero.SetDefaultColor(Color.white);

plot OS = HighestAll(KER) * Threshold; #.8;
OS.SetDefaultColor(Color.RED);

plot OB = LowestAll(KER) * Threshold; #.8;
OB.SetDefaultColor(Color.GREEN);

def Buy = KER < OB;
def Sell = KER > OS;

#=============
KER.DefineColor("Neutral", Color.gray);
KER.DefineColor("Sell", Color.RED);
#==================
def SellSignal = if KER crosses above OS then KER else Double.NaN;
def BuySignal = if KER crosses below OB then KER else Double.NaN;

this does a great job at calling tops and bottoms, what is it? where did you get this idea my good sir.

#### thomas2004ch

##### New member
I've tried this indicator at SPY. But it seems not so great as germanburrito said. Could you post a screenshot?

#### ktp

##### New member
It would depend on the time frame you are using to trade since the signal is using highestall/lowestall.

#### germanburrito

##### Active member
I've tried this indicator at SPY. But it seems not so great as germanburrito said. Could you post a screenshot?
yeah it depends on how much data you have, meaning if you're looking back at 5 days, 10 days, 20, etc.. I found that RSI its still king.

#### ktp

##### New member
yeah it depends on how much data you have, meaning if you're looking back at 5 days, 10 days, 20, etc.. I found that RSI its still king.
Agreed RSI is the king specially if you use dominant cycle period for the length.

#### germanburrito

##### Active member
Agreed RSI is the king specially if you use dominant cycle period for the length.
would you mind explaining what dominant cycle period is please?

#### MerryDay

##### Well-known member
VIP
In his book "Measuring Cycle Periods", John Ehlers identifies dominant market cycle periods by use of multiple bandpass filtering.