OPEN-SOURCE SCRIPT
Mother Candle at Support

//version=5
indicator("Mother Candle at Support", overlay=true)
length = input.int(50, title="Support Lookback")
bodyRatio = input.float(1.5, title="Body vs Avg Body Ratio")
// Calculate body size and average
candleSize = high - low
avgBody = ta.sma(high - low, 10)
// Identify Mother Candle (large range)
mother = candleSize > (avgBody * bodyRatio)
// Inside candles (1 or 2)
inside1 = high[1] < high and low[1] > low
inside2 = high[2] < high and low[2] > low
// Price near recent support (swing low)
swingLow = ta.lowest(low, length)
nearSupport = close <= swingLow * 1.03
// Combine all
signal = mother and (inside1 or inside2) and nearSupport
// Plot signal on chart
plotshape(signal, title="Mother Candle at Support", location=location.belowbar, color=color.green, style=shape.labelup, text="MC-S")
indicator("Mother Candle at Support", overlay=true)
length = input.int(50, title="Support Lookback")
bodyRatio = input.float(1.5, title="Body vs Avg Body Ratio")
// Calculate body size and average
candleSize = high - low
avgBody = ta.sma(high - low, 10)
// Identify Mother Candle (large range)
mother = candleSize > (avgBody * bodyRatio)
// Inside candles (1 or 2)
inside1 = high[1] < high and low[1] > low
inside2 = high[2] < high and low[2] > low
// Price near recent support (swing low)
swingLow = ta.lowest(low, length)
nearSupport = close <= swingLow * 1.03
// Combine all
signal = mother and (inside1 or inside2) and nearSupport
// Plot signal on chart
plotshape(signal, title="Mother Candle at Support", location=location.belowbar, color=color.green, style=shape.labelup, text="MC-S")
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.