OPEN-SOURCE SCRIPT

6 Consecutive Red Candles

65
//version=6
indicator("6 Consecutive Red Candles", overlay=true)

// Function to identify a red candle (close < open)
isRedCandle(close, open) =>
close < open

// Check if there are 6 consecutive red candles
consecutiveRedCandles = isRedCandle(close, open) and isRedCandle(close[1], open[1]) and isRedCandle(close[2], open[2]) and isRedCandle(close[3], open[3]) and isRedCandle(close[4], open[4]) and isRedCandle(close[5], open[5])

// Plotting a shape to indicate when the condition is met
plotshape(series=consecutiveRedCandles, style=shape.labelup, location=location.belowbar, color=color.red, size=size.small, text="6 Reds")

// Optionally, color the bars red if there are 6 consecutive red candles
barcolor(consecutiveRedCandles ? color.red : na)

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน