(1)Uses Simple Moving Average(SMA) => You can calculate based on Exponential Moving Average(EMA) by Enabling it
(2)Moving average period = 20 period
(3)Shows only correct retest candle => You can enable All retests and EMA/SMA Breakout candle
Note: consider MA = EMA/SMA
Condition for Correct Retest:
(1)Previously MA Breakout
(2)No MA breakout between retest and considered MA breakout
(3) if MA breakout happens it will reset
Current setting only show correct retest candle.
(1)Green Background = Correct Up Retest from MA
(2)Red Background = Correct Down Retest from MA
You can enable MA Break candle Background.
(1)Blue Background = MA UpBreak candle
(2)Orange Background = MA DownBreak candle
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.