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')
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.