OPEN-SOURCE SCRIPT
Updated Reversal Candlestick Pattern Detector

// Name: Reversal Candlestick Pattern Detector
// Condition:
// 1-up move: last n candles, 3/5 move higher; and/or the last is the highest in past n bars
// 2-down move: last n candles, 3/5 move lower; and/or the last is the lowest in past n bars
//
// Show Bullish reversal pattern in down move; Show Bearish reversal pattern in up move;
//
//Reversal candlestick patterns:
//1. Hammer/Shooting Star,
//2. Engulfing,
//3. Morning/Evening Star,
//4. Harami, --Also Harami could be used in continuation (Rally based Rally/Drop based Drop);
//5. Piercing/Dark Cloud cover,
//6. Hook Reversal
//7. Breakaway Gap, or Gap Crosses SMA8, SMA50. This is for un-filled Gap only. low[1]>high or high[1]<Low
// Condition:
// 1-up move: last n candles, 3/5 move higher; and/or the last is the highest in past n bars
// 2-down move: last n candles, 3/5 move lower; and/or the last is the lowest in past n bars
//
// Show Bullish reversal pattern in down move; Show Bearish reversal pattern in up move;
//
//Reversal candlestick patterns:
//1. Hammer/Shooting Star,
//2. Engulfing,
//3. Morning/Evening Star,
//4. Harami, --Also Harami could be used in continuation (Rally based Rally/Drop based Drop);
//5. Piercing/Dark Cloud cover,
//6. Hook Reversal
//7. Breakaway Gap, or Gap Crosses SMA8, SMA50. This is for un-filled Gap only. low[1]>high or high[1]<Low
Release Notes
Show Morning Star and Evening Star flag on the star candle. I learned how to use "offset in plotshape()" today.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.