Here are two moving averages, one based on positive candles and the other based on negative candles. If the current bar is positive, the negative MA will use its last known negative bar for the calculation. The default setting uses Heikin Ashi to smooth the candles with the trend, you can turn this off if you want in inputs.
Hi, also can option be added for MA based on new high and new low? That would be great
anu.nauri
⋅
Great work, was looking for something like this since i read about it in book "Bear Market investing strategies". Much appreciated.
EvoCrypto
⋅
@anu.nauri, Awesome! Haven't heard of that book, would you recommend it ? And not sure what you mean by new high and low ?
SimpleCryptoLife
⋅
Nice idea. Thanks for coding it up. Have you seen any interesting effects from applying it?
EvoCrypto
⋅
@SimpleCryptoLife, It's interesting to see how the regular moving average moves between these two lines to see how fast a trend moves or spot weakness if it comes back to the middle. Separating donchian average (or whatever its called) actually works great as filter to close below or above both lines so will be adding that soon. Thanks for your comment, I appreciate it!