This may seem like a pretty basic Moving Average indicator but I haven't seen one that changes the calculation point depending if the market is going up or down.
I've added three EMA's (length of 20) on this sample chart to demonstrate the differences. These are not included with the indicator. Green, EMA calculated on High Red, EMA calculated on Low Yellow, EMA calculated on Close (default) Blue, EMA calculated on HIGH when rising but on LOW when falling. (looks at 3 candles back to gauge direction) * * * Note you can choose between 5 different Moving Average types
Notice how the Blue line (when going up it's calculated on the High) is catching up to the Green line (which is already calculated on the High)? Notice how the Blue line (when going down so it's calculated on the Low) is catching up to the Red line (which is already calculated on the Low)?
This gives a faster response in the direction of the market because it switches between calculating on the High or Low based on market direction.
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 publications is governed by House rules. You can favorite it to use it on a chart.
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.