cI8DH

Historical Stochatic (HS) [cI8DH]

This indicator calculates historical stochastic (HS). It also includes the standard stoch. HS works similar to the standard stochastic . The difference is that the standard stochastic has a set look-back period, while HS looks as far back as the first bar. This allows identifying ATHs and ATLs (background highlights green and red respectively). Basically, HS shows inverse retracement from ATL to ATH in percentage.

This indicator works best on non-range bound indicators such as MACD. As you can see in the chart below, MACD is not useful to compare against periods that price is wildly different. Applying HS on MACD fixes this issue (To achieve the same results, add MACD indicator > change the source to MACD on HS settings > since MACD is a smoothed indicator, smoothing length is set to 1. To get similar smoothing length on the signal as in standard MACD, set %D to 5 smoothed MA which is equivalent to 9 EMA smoothing on standard MACD).


Gain/Loss Moving Average (GLMA) is another indicator that can benefit well from HS. GLMA is the simplest and probably the most accurate momentum indicator. But it is not as convenient as RSI since it is not range bound. HS can make it range bound without compromising its accuracy. (To achieve the same results, add GLMA indicator > change the source to GLMA on HS settings > set %K length to 1).


Chart below shows HS applied to Accumulation/Distribution Money Flow (ADMF) and compares it against its range bound counter part, ADP.


Conclusion:
There are different ways of making an indicator normalized or range bound. Some indicators use RSI's approach (positive changes MA / all changes MA) such as MFI, CMF, ADP. This approach is great but the divergence near extremes can sometimes be misleading. HS fixes this problem as long as the indicator is not making a new ATH or ATL. When it does make new ATH or ATL, this indicator gives a warning to avoid using it for detecting divergence.


PS:
It is a bit geeky to apply HS on other indicators. I will publish some of my indicators with HS and standard stoch built-in. So stay tuned if u r interested in this indicator.

Read more here about using stochastic

www.tradingview.com/wiki/Stochastic_(STOCH)

สคริปต์โอเพนซอร์ซ

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

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?