Unlock powerful bearish trend reversal and continuation signals with this comprehensive guide to detecting and strategizing with Three Black Crows patterns in TradingView's Pinescript.
The Three Black Crows candlestick pattern is a strong three-candle bearish reversal or continuation pattern. It indicates a clear shift in market sentiment from buying to strong selling pressure. This pattern is characterized by three consecutive long bearish (red) candles that open within the body of the previous candle and close lower than the previous candle's close, ideally with small or no upper shadows. This demonstrates consistent bearish strength and makes Three Black Crows patterns invaluable for:
A Three Black Crows pattern consists of three specific, consecutive bearish candles:
Three consecutive long red candles, each opening within the previous body and closing lower, with small upper shadows.
Three Consecutive Bearish Candles: All three must be red.
Long Bodies: Each candle should have a significant body, showing strong selling pressure.
Lower Closes: Each candle's close must be lower than the previous candle's close.
Open within Previous Body: The open of the second candle should be within the real body of the first; the open of the third should be within the real body of the second.
Small/No Upper Shadows: Ideally, little to no upper shadow on each candle, indicating selling pressure throughout the period.
Context: Most significant when appearing after a clear uptrend or during a pullback in a downtrend.
//@version=5
indicator("Three Black Crows Detector", overlay=true)
// User input for minimum body size (as a percentage of ATR)
minBodySize = input.float(0.4, title="Min Body Size (ATR multiple)", minval=0.1, maxval=2.0)
// User input for maximum upper shadow size (as a percentage of body)
maxUpperShadowRatio = input.float(0.2, title="Max Upper Shadow Ratio (of Body)", minval=0.01, maxval=0.5)
// Helper function to check if a candle is a strong bearish candle with small upper shadow
isStrongBearish(idx) =>
body = open[idx] - close[idx]
upperShadow = high[idx] - math.max(open[idx], close[idx])
body > ta.atr(14)[idx] * minBodySize and // Body is significant
close[idx] < open[idx] and // It's a bearish candle
upperShadow < body * maxUpperShadowRatio // Small upper shadow
// Check individual candle properties
isC1StrongBearish = isStrongBearish(2)
isC2StrongBearish = isStrongBearish(1)
isC3StrongBearish = isStrongBearish(0) // Current bar
// Check opening conditions
// open[1] should be lower than open[2] but higher than close[2]
isC2OpensInC1Body = open[1] < open[2] and open[1] > close[2]
// open[0] should be lower than open[1] but higher than close[1]
isC3OpensInC2Body = open[0] < open[1] and open[0] > close[1] // open[0] is current `open`
// Check lower closes
isC2ClosesLowerThanC1 = close[1] < close[2]
isC3ClosesLowerThanC2 = close[0] < close[1] // close[0] is current `close`
// Combine all criteria for Three Black Crows
isThreeBlackCrows = isC1StrongBearish and isC2StrongBearish and isC3StrongBearish and \
isC2OpensInC1Body and isC3OpensInC2Body and \
isC2ClosesLowerThanC1 and isC3ClosesLowerThanC2
// Plot signal on the chart
plotshape(isThreeBlackCrows, title="Three Black Crows", location=location.abovebar, color=color.new(color.maroon, 0), style=shape.triangledown, size=size.normal)
// Alert condition (optional)
alertcondition(isThreeBlackCrows, title="Three Black Crows Detected", message="Three Black Crows Pattern Detected!")
Combining Three Black Crows patterns with other indicators and market context provides stronger, more reliable signals for potential bearish moves.
//@version=5
strategy("Three Black Crows (Trend Reversal)", overlay=true)
// Input for Moving Average length (for trend detection)
maLength = input(50, "MA Length (for trend)")
ma = ta.ema(close, maLength)
// Three Black Crows Pattern Detection (from basic example - simplified for brevity)
isC1StrongBearish = close[2] < open[2] and (open[2] - close[2]) > ta.atr(14)[2] * 0.4
isC2StrongBearish = close[1] < open[1] and (open[1] - close[1]) > ta.atr(14)[1] * 0.4
isC3StrongBearish = close > open and (open - close) > ta.atr(14) * 0.4
isC2OpensInC1Body = open[1] < open[2] and open[1] > close[2]
isC3OpensInC2Body = open > open[1] and open < close[1] // open[0] is current `open`
isC2ClosesLowerThanC1 = close[1] < close[2]
isC3ClosesLowerThanC2 = close > close[1] // close[0] is current `close`
// Additional check for small upper shadows for robustness
isSmallUpperShadowC1 = (high[2] - math.max(open[2], close[2])) < (math.abs(open[2] - close[2]) * 0.2)
isSmallUpperShadowC2 = (high[1] - math.max(open[1], close[1])) < (math.abs(open[1] - close[1]) * 0.2)
isSmallUpperShadowC3 = (high - math.max(open, close)) < (math.abs(open - close) * 0.2) // Current bar's upper shadow
isThreeBlackCrows = isC1StrongBearish and isC2StrongBearish and isC3StrongBearish and \
isC2OpensInC1Body and isC3OpensInC2Body and \
isC2ClosesLowerThanC1 and isC3ClosesLowerThanC2 and \
isSmallUpperShadowC1 and isSmallUpperShadowC2 and isSmallUpperShadowC3
// Trend Confirmation: Pattern appears after a clear uptrend (price above MA)
isUptrend = close[3] > ma[3] and close[2] > ma[2] and close[1] > ma[1] // Check prior bars for uptrend context
// Strategy Logic with Trend Confirmation
shortSignal = isThreeBlackCrows and isUptrend
if (shortSignal)
strategy.entry("Short", strategy.short)
// Plot MA
plot(ma, "Trend MA", color.blue)
// Plot confirmed signals
plotshape(shortSignal, title="Confirmed 3 Black Crows (Reversal)", location=location.abovebar, color=color.new(color.fuchsia, 0), style=shape.arrowdown, size=size.normal)
//@version=5
indicator("Three Black Crows with Volume Confirmation", overlay=true)
// Three Black Crows Pattern Detection (from basic example - simplified)
isC1StrongBearish = close[2] < open[2] and (open[2] - close[2]) > ta.atr(14)[2] * 0.4
isC2StrongBearish = close[1] < open[1] and (open[1] - close[1]) > ta.atr(14)[1] * 0.4
isC3StrongBearish = close < open and (open - close) > ta.atr(14) * 0.4
isC2OpensInC1Body = open[1] < open[2] and open[1] > close[2]
isC3OpensInC2Body = open < open[1] and open > close[1]
isC2ClosesLowerThanC1 = close[1] < close[2]
isC3ClosesLowerThanC2 = close < close[1]
isThreeBlackCrows = isC1StrongBearish and isC2StrongBearish and isC3StrongBearish and \
isC2OpensInC1Body and isC3OpensInC2Body and \
isC2ClosesLowerThanC1 and isC3ClosesLowerThanC2
// Volume Confirmation:
// Each bearish candle should have equal or increasing volume,
// and the third candle's volume should be significantly higher than average volume.
avgVolume = ta.sma(volume, 20) // 20-period Simple Moving Average of Volume
isVolumeConsistent = volume[2] <= volume[1] and volume[1] <= volume // Volume equal or increasing
isVolumeConfirmed = volume > avgVolume * 1.2 // Current volume is 1.2x average
// Combined signal
confirmedThreeBlackCrows = isThreeBlackCrows and isVolumeConsistent and isVolumeConfirmed
// Plot confirmed signals
barcolor(confirmedThreeBlackCrows ? color.new(color.purple, 60) : na)
plotshape(confirmedThreeBlackCrows, title="3 Black Crows (Vol Confirmed)", location=location.abovebar, color=color.new(color.red, 0), style=shape.labeldown, size=size.small, text="3BC Vol")
// Optional: Plot volume for visual check
plot(volume, title="Volume", color=color.gray, style=plot.style_columns)
plot(avgVolume, title="Avg Volume", color=color.orange, style=plot.style_line)
//@version=5
indicator("Three Black Crows with RSI Confirmation", overlay=true)
// RSI Inputs
rsiLength = input(14, "RSI Length")
overbought = input(70, "RSI Overbought Level")
// Calculate RSI
rsiValue = ta.rsi(close, rsiLength)
// Three Black Crows Pattern Detection (simplified)
isC1StrongBearish = close[2] < open[2] and (open[2] - close[2]) > ta.atr(14)[2] * 0.4
isC2StrongBearish = close[1] < open[1] and (open[1] - close[1]) > ta.atr(14)[1] * 0.4
isC3StrongBearish = close < open and (open - close) > ta.atr(14) * 0.4
isC2OpensInC1Body = open[1] < open[2] and open[1] > close[2]
isC3OpensInC2Body = open < open[1] and open > close[1]
isC2ClosesLowerThanC1 = close[1] < close[2]
isC3ClosesLowerThanC2 = close < close[1]
isThreeBlackCrows = isC1StrongBearish and isC2StrongBearish and isC3StrongBearish and \
isC2OpensInC1Body and isC3OpensInC2Body and \
isC2ClosesLowerThanC1 and isC3ClosesLowerThanC2
// RSI Confirmation: RSI falling from overbought territory or showing bearish divergence
rsiConfirmation = rsiValue < rsiValue[1] and rsiValue[1] < rsiValue[2] and rsiValue[2] >= overbought // RSI falling from overbought
// Or simpler: rsiValue <= overbought and rsiValue < rsiValue[1]
// Combined signal
signalThreeBlackCrows = isThreeBlackCrows and rsiConfirmation
// Plot signals
plotshape(signalThreeBlackCrows, title="3 Black Crows (RSI Confirmed)", location=location.abovebar, color=color.new(color.orange, 0), style=shape.arrowdown, size=size.normal)
// Plot RSI in a separate pane
plot(rsiValue, "RSI", color.blue, linewidth=2, display=display.pane)
hline(overbought, "Overbought", color.red)
To maximize the effectiveness of Three Black Crows patterns in your Pinescript strategies:
The Three Black Crows candlestick pattern is a powerful and visually clear signal for robust bearish price action. By understanding its precise three-candle formation, its contextual importance (especially after an uptrend), and integrating it with other technical confirmations like volume and momentum oscillators, you can leverage it effectively in your trading. Implementing Three Black Crows detection in Pinescript allows you to automate signal generation, combine it with complementary indicators for higher probability trades, and enhance your price action analysis to make more informed trading decisions on TradingView.
Get a high-performance Pinescript analysis tool for actionable market insights, designed for traders on the move.
This strategy runs in live mode on TradingView, helping you identify potential opportunities.
Get Pinescript Strategy