Kaufman's is, in my opinion, a gem among the plethora of indicators. It is underrated considering it offers a solution that intuitively makes a lot of sense. When I first read about it, it was a real 'aha!' moment. Look at the top, pink line. Notice how during trending times it follows the trend quickly and closely, but during choppy, non-trending periods, the stays absolutely flat? Interesting! To trade with it, we simply follow the direction the is pointing. Is it up? Go long. Is it down? Go short. Is it flat? Hold on.
How does it manage to quickly follow real trends like a fast but ignore choppy conditions that would whipsaw a fast back and forth? It analyses whether recent price moves are significant relative to recent noise and then adapts the length of the window accordingly. If price movement is big compared to the recent noise, the window gets smaller. If price movement is relatively small or average compared to the recent noise, the window gets bigger. In practice it means:
- The would be flat if a 20 point upwards move occurred during a period that has had, on average, regular 20 point moves BUT
- the would point up if a 20 point move occurred during a period that has, on average, had moves of only around 5 points.
In other words, it's a slow during choppy flat / quiet flat periods, and a fast as soon as significant occurs. Perfect!
The strategy is more than just a indicator. It contains:
- exit (optional)
- ATR trailing stop loss exit (optional)
- PSAR stop loss exit (optional)
- filter for entry and exits
- All features are adjustable in the strategy settings
The Technical Details:
Check out the strategy's 'Inputs' panel. The buy and sell signals are based on the 'KAMA 1' there.
- 1: Length -- 14 is the default. This is the length of the window the looks back over. In this instance, it c
- 1: Fast Length -- 2 is the default. This is the tightest the length is allowed to get. It will tend towards this length when is high.
- 1: Slow Length -- 20 is the default. This is the biggest the length is allowed to get. It will tend towards this length when is low.
The strategy buys when the begins to point up and sells when the points down. Generally, the is very good at filtering out the noise itself - it will go flat during noisy/choppy periods. But to add another layer of safety, its author, Perry Kaufman, proposed a filter. It works by taking the standard deviation of returns over the length of the the 'KAMA 1: Length' I mentioned above and multiplying it by an 'Entry Filter' (1 by default) and 'Exit Filter' (0.5 by default). The entry condition to go long is that the is pointing up and and it moved up more than 1 x St. Dev. of Returns. The exit condition is when the is pointing down and it moved down by more than 0.5 x St. Dev. of Returns.
Thanks to ChuckBanger, cheatcountry, millerrh, and racer8 for parts of the code. I was able to build upon their good work.
I hope this strategy is helpful to you.
Do you have any thoughts, ideas, or questions? Let me know in the comments or send me a message! I'd be glad to help you out.
If you need an indicator or strategy to be built or customised for you, let me know! I'll be glad to help and it'll probably be cheaper than you think!
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.