OPEN-SOURCE SCRIPT

๐Ÿ”” NIFTY 100+ Points Early Move Signal (1H)

139
//version=5
indicator("๐Ÿ”” NIFTY 100+ Points Early Move Signal (1H)", overlay=true)

// === Inputs === //
squeezePeriod = input.int(20, title="Price Squeeze Lookback")
rangeTrigger = input.float(100.0, title="Target Move (in Points)")
rsiLength = input.int(14, title="RSI Length")
macdFast = input.int(12)
macdSlow = input.int(26)
macdSignal = input.int(9)
volMultiplier = input.float(1.5, title="Volume Spike Multiplier")

// === RSI & MACD === //
rsi = ta.rsi(close, rsiLength)
[macdLine, signalLine, _] = ta.macd(close, macdFast, macdSlow, macdSignal)
macdBullish = macdLine > signalLine
macdBearish = macdLine < signalLine

// === Price Compression === //
hh = ta.highest(high, squeezePeriod)
ll = ta.lowest(low, squeezePeriod)
compressionRange = hh - ll
tightCompression = compressionRange < (rangeTrigger * 0.6) // Pre-expansion

// === Volume Spike === //
avgVol = ta.sma(volume, 20)
volSpike = volume > avgVol * volMultiplier

// === Early Signal Logic === //
bullSetup = tightCompression and rsi > 50 and macdBullish and volSpike
bearSetup = tightCompression and rsi < 50 and macdBearish and volSpike

// === Plotting Signals === //
plotshape(bullSetup, title="Bullish Setup", location=location.belowbar, color=color.green, style=shape.labelup, text="100โ†‘")
plotshape(bearSetup, title="Bearish Setup", location=location.abovebar, color=color.red, style=shape.labeldown, text="100โ†“")
bgcolor(bullSetup ? color.new(color.green, 85) : na)
bgcolor(bearSetup ? color.new(color.red, 85) : na)

// === Alerts === //
alertcondition(bullSetup, title="Bullish 100pt Setup", message="๐Ÿš€ NIFTY: 100+ point UP move likely!")
alertcondition(bearSetup, title="Bearish 100pt Setup", message="๐Ÿ”ป NIFTY: 100+ point DOWN move likely!")

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.