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!
ด้วยจิตวิญญาณของ TradingView อย่างแท้จริง ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้ผู้ค้าสามารถเข้าใจและตรวจสอบได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ได้ฟรี แต่การใช้รหัสนี้ซ้ำในสิ่งพิมพ์อยู่ภายใต้กฎของบ้าน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ