OPEN-SOURCE SCRIPT
Small Body Candle Highlighter

//version=5
indicator("Small Body Candle Highlighter", overlay=true)
// Set max difference in points (adjust as needed based on asset's price scale)
max_diff = 1.5
// Calculate the open-close difference
body_diff = math.abs(close - open)
// Conditions
small_body = body_diff <= max_diff
bullish = close > open
bearish = open > close
// Colors
bull_color = color.new(color.green, 0)
bear_color = color.new(color.red, 0)
// Plot shapes on qualifying candles
plotshape(small_body and bullish, location=location.abovebar, color=bull_color, style=shape.circle, size=size.small, title="Bullish Small Body")
plotshape(small_body and bearish, location=location.belowbar, color=bear_color, style=shape.circle, size=size.small, title="Bearish Small Body")
indicator("Small Body Candle Highlighter", overlay=true)
// Set max difference in points (adjust as needed based on asset's price scale)
max_diff = 1.5
// Calculate the open-close difference
body_diff = math.abs(close - open)
// Conditions
small_body = body_diff <= max_diff
bullish = close > open
bearish = open > close
// Colors
bull_color = color.new(color.green, 0)
bear_color = color.new(color.red, 0)
// Plot shapes on qualifying candles
plotshape(small_body and bullish, location=location.abovebar, color=bull_color, style=shape.circle, size=size.small, title="Bullish Small Body")
plotshape(small_body and bearish, location=location.belowbar, color=bear_color, style=shape.circle, size=size.small, title="Bearish Small Body")
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.