Select Page

# Kaufman Efficiency Ratio

Optuma Forums Optuma Scripting Kaufman Efficiency Ratio

Viewing 6 posts - 1 through 6 (of 6 total)
• Author
Posts
• #39035
Mathew
• Topics: 40
• Replies: 2,002
• Posts: 2,042

Perry Kaufman developed this indicator to measure the efficiency of a move in the market.

ER = Direction / Volatility

If the move was in one direction and there was little volatility, then the value would be 1. If there was a lot of volatility, then the denominator would be bigger and the ER would be closer to 0. Changes in trend are unlikely to happen when the ER is high.

vol1 = CHANGE(INT_COUNT=1);
vol2= ABS(vol1 );
vol3 = ACC(vol2, RANGE=Look Back Period, BARS=10);

dir1 = CHANGE(INT_COUNT=10);
dir2 = ABS(dir1);

dir2 / vol3

###### 1 user thanked author for this post.
#60577
Tonia
• Topics: 10
• Replies: 12
• Posts: 22

Hi Optuma
Thanks Optuma for providing this ER script. I’d like to investigate this further but I’d like to use the KER as a show bar and an indicator under the chart like Mathew’s above, but I’d like to be able to script it to show on a +100/-100 scale with +100 representing positive (1) efficiency and -100 representing negative (-1) efficiency, rather than Mathew’s +1/-1 scale. Additionally, I’d also like to adapt Mathew’s script to only identify stocks which have an efficiency ratio above 0.20 (20 on my adapted script). Any help would be appreciated.

#60597
Mathew
• Topics: 40
• Replies: 2,002
• Posts: 2,042

Hi Tonia,

The easy way to change the scale would be to apply a ratio.  Your 0 level would be at 0.5 on my version so we subtract 0.5 from the result and then apply a ratio to get it to 100. Note the bottom 2 lines.

All the best

Mathew

#60607
Tonia
• Topics: 10
• Replies: 12
• Posts: 22

Hi Mathew
Thank you for the ratio details to change the Efficiency ratio scale, can you also please assist me with the scripting which would only identify stocks where efficiency ratio is above 20.

#60613
Tonia
• Topics: 10
• Replies: 12
• Posts: 22

Hi Optuma
I have attempted to create a script (below) to identify stocks where the efficiency ratio is above 20, but for some reason it generates 0 results, can you tell me where I might be going wrong please?

Efficiency ratio calc as per your script, saved as a script named ‘EfficiencyRatio20’
vol1 = CHANGE(INT_COUNT=1);
vol2= ABS(vol1 );
vol3 = ACC(vol2, RANGE=Look Back Period, BARS=20);
dir1 = CHANGE(INT_COUNT=20);
dir2 = ABS(dir1);
r1 = (dir2 / vol3) – 0.5;
r1 / 0.5 * 100

Script using saved script ‘EfficiencyRatio20’ to identify stocks where Efficiency ratio is above 20
V1 = Script(EfficiencyRatio20);
V2 = V1() > 20;
V1 == 1 and V1[1] == 1 and V2 == 1

#60617
Darren
• Topics: 66
• Replies: 667
• Posts: 733

Hi Tonia,

When using the SCRIPT() function you need to select it from the pop-up window to get the correct syntax:

This would be the only line you would need for > 20 in a Show Bar or scan:

Finally, a friendly reminder to use the <>Code formatting button above when pasting sample formula, as per this post.

###### 1 user thanked author for this post.
Viewing 6 posts - 1 through 6 (of 6 total)
• You must be logged in to reply to this topic.