OPEN-SOURCE SCRIPT

Inside Candle Strategy HANMANT

//version=5
indicator("Inside Candle Strategy", overlay=true)

// Identify the previous candle's high and low
prevHigh = high[1]
prevLow = low[1]

// Identify the current candle's high and low
currHigh = high
currLow = low

// Check if the current candle is an inside candle
isInsideCandle = (currHigh < prevHigh) and (currLow > prevLow)

// Plotting the inside candle
bgcolor(isInsideCandle ? color.new(color.blue, 90) : na)

// Long and Short conditions
longCondition = isInsideCandle and (currHigh > currHigh[1])
shortCondition = isInsideCandle and (currLow < currLow[1])

// Generate signals
plotshape(series=longCondition, location=location.belowbar, color=color.green, style=shape.labelup, text="Long")
plotshape(series=shortCondition, location=location.abovebar, color=color.red, style=shape.labeldown, text="Short")

// Alerts
alertcondition(longCondition, title="Long Signal", message="Long Signal Triggered")
alertcondition(shortCondition, title="Short Signal", message="Short Signal Triggered")
Candlestick analysis

開源腳本

在真正的TradingView精神中,這個腳本的作者以開源的方式發佈,這樣交易員可以理解和驗證它。請向作者致敬!您可以免費使用它,但在出版物中再次使用這段程式碼將受到網站規則的約束。 您可以收藏它以在圖表上使用。

想在圖表上使用此腳本?

免責聲明