OPEN-SOURCE SCRIPT
Nifty Futures ATM Option Signal

//version=6
indicator('Nifty Futures ATM Option Signal', overlay = true)
// === Input symbols ===
// You must update these to match the live ATM options of current expiry.
niftyFutSymbol = input.symbol('NSE:NIFTY1!', 'Nifty Index Futures')
atmCallSymbol = input.symbol('NSE:NIFTY250605C24750', 'ATM Call Option (Same Expiry)')
atmPutSymbol = input.symbol('NSE:NIFTY250605P24750', 'ATM Put Option (Same Expiry)')
// === Get OHLC values from 5-minute charts ===
niftyOpen = request.security(niftyFutSymbol, '5', open)
niftyClose = request.security(niftyFutSymbol, '5', close)
callOpen = request.security(atmCallSymbol, '5', open)
callClose = request.security(atmCallSymbol, '5', close)
putOpen = request.security(atmPutSymbol, '5', open)
putClose = request.security(atmPutSymbol, '5', close)
// === Candle directions ===
niftyRed = niftyClose < niftyOpen
niftyGreen = niftyClose > niftyOpen
callGreen = callClose > callOpen
putGreen = putClose > putOpen
// === Trading signals ===
buySignal = niftyRed and callGreen
sellSignal = niftyGreen and putGreen
// === Plot signals on chart ===
plotshape(buySignal, title = 'Buy Signal', location = location.belowbar, color = color.green, style = shape.triangleup, size = size.small)
plotshape(sellSignal, title = 'Sell Signal', location = location.abovebar, color = color.red, style = shape.triangledown, size = size.small)
bgcolor(buySignal ? color.new(color.green, 85) : na, title = 'Buy Background')
bgcolor(sellSignal ? color.new(color.red, 85) : na, title = 'Sell Background')
indicator('Nifty Futures ATM Option Signal', overlay = true)
// === Input symbols ===
// You must update these to match the live ATM options of current expiry.
niftyFutSymbol = input.symbol('NSE:NIFTY1!', 'Nifty Index Futures')
atmCallSymbol = input.symbol('NSE:NIFTY250605C24750', 'ATM Call Option (Same Expiry)')
atmPutSymbol = input.symbol('NSE:NIFTY250605P24750', 'ATM Put Option (Same Expiry)')
// === Get OHLC values from 5-minute charts ===
niftyOpen = request.security(niftyFutSymbol, '5', open)
niftyClose = request.security(niftyFutSymbol, '5', close)
callOpen = request.security(atmCallSymbol, '5', open)
callClose = request.security(atmCallSymbol, '5', close)
putOpen = request.security(atmPutSymbol, '5', open)
putClose = request.security(atmPutSymbol, '5', close)
// === Candle directions ===
niftyRed = niftyClose < niftyOpen
niftyGreen = niftyClose > niftyOpen
callGreen = callClose > callOpen
putGreen = putClose > putOpen
// === Trading signals ===
buySignal = niftyRed and callGreen
sellSignal = niftyGreen and putGreen
// === Plot signals on chart ===
plotshape(buySignal, title = 'Buy Signal', location = location.belowbar, color = color.green, style = shape.triangleup, size = size.small)
plotshape(sellSignal, title = 'Sell Signal', location = location.abovebar, color = color.red, style = shape.triangledown, size = size.small)
bgcolor(buySignal ? color.new(color.green, 85) : na, title = 'Buy Background')
bgcolor(sellSignal ? color.new(color.red, 85) : na, title = 'Sell Background')
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。