Surenderrrr

Wait 5 sec.

SurenderrrrNifty 50 IndexNSE:NIFTYjamwal2012surender//@version=6 indicator("AI 6-Confluence Intraday Strategy", overlay=true, max_labels_count=500) //==================================================== // INPUTS //==================================================== groupTrend = "Trend & Momentum" emaFastLen = input.int(20, "Fast EMA", minval=1, group=groupTrend) emaSlowLen = input.int(50, "Slow EMA", minval=1, group=groupTrend) rsiLen = input.int(14, "RSI Length", minval=1, group=groupTrend) rsiBull = input.float(55.0, "Bullish RSI Level", group=groupTrend) rsiBear = input.float(45.0, "Bearish RSI Level", group=groupTrend) groupVolume = "Volume" volLen = input.int(20, "Average Volume Length", minval=1, group=groupVolume) volMultiplier = input.float(1.20, "Volume Multiplier", minval=0.1, step=0.05, group=groupVolume) groupLevels = "Support / Resistance" usePDLevels = input.bool(true, "Use Previous Day High/Low", group=groupLevels) useVWAP = input.bool(true, "Use VWAP", group=groupLevels) groupRisk = "Risk Management" atrLen = input.int(14, "ATR Length", minval=1, group=groupRisk) atrSLMultiplier = input.float(1.0, "ATR SL Multiplier", minval=0.1, step=0.1, group=groupRisk) rr1 = input.float(1.0, "Target 1 R", minval=0.1, step=0.1, group=groupRisk) rr2 = input.float(2.0, "Target 2 R", minval=0.1, step=0.1, group=groupRisk) rr3 = input.float(3.0, "Target 3 R", minval=0.1, step=0.1, group=groupRisk) groupAI = "AI Score" minimumScore = input.int(70, "Minimum Signal Score", minval=1, maxval=100, group=groupAI) strongScore = input.int(80, "Strong Signal Score", minval=1, maxval=100, group=groupAI) groupHTF = "Higher Timeframe Filter" useHTF = input.bool(true, "Use 15-Minute Trend Filter", group=groupHTF) htfTF = input.timeframe("15", "Higher Timeframe", group=groupHTF) groupDisplay = "Display" showEMAs = input.bool(true, "Show EMAs", group=groupDisplay) showVWAP = input.bool(true, "Show VWAP", group=groupDisplay) showPD = input.bool(true, "Show Previous Day Levels", group=groupDisplay) showSignals = input.bool(true, "Show Buy/Sell Signals", group=groupDisplay) showTargets = input.bool(true, "Show Entry/SL/Targets", group=groupDisplay) showTable = input.bool(true, "Show AI Score Table", group=groupDisplay) //==================================================== // CORE INDICATORS //==================================================== ema20 = ta.ema(close, emaFastLen) ema50 = ta.ema(close, emaSlowLen) rsi = ta.rsi(close, rsiLen) vwapValue = ta.vwap(hlc3) atr = ta.atr(atrLen) avgVolume = ta.sma(volume, volLen) strongVolume = volume > avgVolume * volMultiplier //==================================================== // PREVIOUS DAY LEVELS //==================================================== previousDayHigh = request.security( syminfo.tickerid, "D", high, lookahead=barmerge.lookahead_on) previousDayLow = request.security( syminfo.tickerid, "D", low, lookahead=barmerge.lookahead_on) previousDayClose = request.security( syminfo.tickerid, "D", close, lookahead=barmerge.lookahead_on) //==================================================== // HIGHER TIMEFRAME TREND //==================================================== htfEMA20 = request.security( syminfo.tickerid, htfTF, ta.ema(close, emaFastLen), lookahead=barmerge.lookahead_off) htfEMA50 = request.security( syminfo.tickerid, htfTF, ta.ema(close, emaSlowLen), lookahead=barmerge.lookahead_off) htfClose = request.security( syminfo.tickerid, htfTF, close, lookahead=barmerge.lookahead_off) htfBull = htfClose > htfEMA20 and htfEMA20 > htfEMA50 htfBear = htfClose < htfEMA20 and htfEMA20 < htfEMA50 //==================================================== // PRICE ACTION //==================================================== bullishCandle = close > open bearishCandle = close < open bullishBreakout = close > previousDayHigh and close = previousDayLow // VWAP conditions bullVWAP = close > vwapValue bearVWAP = close < vwapValue // EMA conditions bullEMA = ema20 > ema50 bearEMA = ema20 < ema50 // RSI conditions bullRSI = rsi > rsiBull bearRSI = rsi < rsiBear //==================================================== // MOMENTUM CONDITIONS //==================================================== priceMomentumBull = close > close and close > open priceMomentumBear = close < close and close < open //==================================================== // AI SCORE //==================================================== // CALL SCORE callScore = 0 callScore += bullEMA ? 20 : 0 callScore += bullVWAP ? 15 : 0 callScore += bullRSI ? 10 : 0 callScore += strongVolume and bullishCandle ? 10 : 0 callScore += priceMomentumBull ? 10 : 0 callScore += close > previousDayClose ? 10 : 0 callScore += bullishBreakout ? 15 : 0 callScore += useHTF and htfBull ? 10 : 0 // PUT SCORE putScore = 0 putScore += bearEMA ? 20 : 0 putScore += bearVWAP ? 15 : 0 putScore += bearRSI ? 10 : 0 putScore += strongVolume and bearishCandle ? 10 : 0 putScore += priceMomentumBear ? 10 : 0 putScore += close < previousDayClose ? 10 : 0 putScore += bearishBreakdown ? 15 : 0 putScore += useHTF and htfBear ? 10 : 0 //==================================================== // NO-TRADE FILTER //==================================================== emaFlat = math.abs(ema20 - ema50) < atr * 0.10 vwapChop = math.abs(close - vwapValue) < atr * 0.10 rsiNeutral = rsi >= 45 and rsi = minimumScore and callScore > putScore and not choppyMarket rawPutSignal = putScore >= minimumScore and putScore > callScore and not choppyMarket callSignal = rawCallSignal and not rawCallSignal putSignal = rawPutSignal and not rawPutSignal //==================================================== // ENTRY / STOP LOSS / TARGETS //==================================================== var float entryPrice = na var float stopLoss = na var float target1 = na var float target2 = na var float target3 = na var int tradeDirection = 0 if callSignal entryPrice := close stopLoss := entryPrice - atr * atrSLMultiplier risk = entryPrice - stopLoss target1 := entryPrice + risk * rr1 target2 := entryPrice + risk * rr2 target3 := entryPrice + risk * rr3 tradeDirection := 1 if putSignal entryPrice := close stopLoss := entryPrice + atr * atrSLMultiplier risk = stopLoss - entryPrice target1 := entryPrice - risk * rr1 target2 := entryPrice - risk * rr2 target