Vikram Nifty 50 IndexNSE:NIFTYvikramambatkar786//@version=5 strategy("Nifty Intraday - EMA + VWAP + RSI", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100, initial_capital=100000) // ===== INPUTS ===== emaFastLen = input.int(9, "Fast EMA") emaSlowLen = input.int(21, "Slow EMA") rsiLen = input.int(14, "RSI Length") rsiOB = input.int(70, "RSI Overbought") rsiOS = input.int(30, "RSI Oversold") useVWAPFilter = input.bool(true, "Use VWAP Filter") startTime = input.session("0915-1500", "Trading Session (IST)") // ===== INDICATORS ===== emaFast = ta.ema(close, emaFastLen) emaSlow = ta.ema(close, emaSlowLen) rsiVal = ta.rsi(close, rsiLen) vwapVal = ta.vwap(hlc3) inSession = not na(time(timeframe.period, startTime, "Asia/Kolkata")) // ===== CONDITIONS ===== longCond = ta.crossover(emaFast, emaSlow) and rsiVal > 50 and rsiVal < rsiOB and (not useVWAPFilter or close > vwapVal) and inSession shortCond = ta.crossunder(emaFast, emaSlow) and rsiVal < 50 and rsiVal > rsiOS and (not useVWAPFilter or close < vwapVal) and inSession // Exit near session close (intraday square-off) exitTime = not na(time(timeframe.period, "1500-1515", "Asia/Kolkata")) // ===== ENTRIES / EXITS ===== if (longCond) strategy.entry("Long", strategy.long) if (shortCond) strategy.entry("Short", strategy.short) if (exitTime) strategy.close_all(comment="EOD Square-off") // Simple ATR-based SL/TP atrVal = ta.atr(14) if (strategy.position_size > 0) strategy.exit("Long Exit", "Long", stop = close - atrVal*1.5, limit = close + atrVal*2.5) if (strategy.position_size < 0) strategy.exit("Short Exit", "Short", stop = close + atrVal*1.5, limit = close - atrVal*2.5) // ===== PLOTS ===== plot(emaFast, color=color.blue, title="EMA Fast") plot(emaSlow, color=color.orange, title="EMA Slow") plot(vwapVal, color=color.purple, title="VWAP") plotshape(longCond, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small) plotshape(shortCond, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small)