OPEN-SOURCE SCRIPT
Updated [KK]Price Retest from EMA

Script show fractals on chart when price retest after breaking Exponential Moving Average.
Release Notes
Previous version is based on fractals which are somewhat lagging because it take 4 candle to form. Current version just uses source data to define RetestDefault Setting:
(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
Interpretation:
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
Release Notes
Cleaner code with condition added to remove overlapping EMA and retest signal.Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
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.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
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.