NQ Conservative MTF (1m entries + 15m trend) — Strategy by davidfigueroa24589
By version
Performance Metrics
- Author: version
- Symbol: CME_MINI:NQ1!
- Timeframe: 15 minutes
- Net P&L: +4,105.00 USD (+41.05%)
- Win Rate: 46.7%
- Profit Factor: 1.094
- Max Drawdown: 15,790.00 USD (69.57%)
- Total Trades: 60
Description
//version=5strategy(title="NQ Conservative MTF (1m entries + 15m trend) [ATR SL/TP + Session + Cooldown] v5", overlay=true, initial_capital=10000, pyramiding=0, calc_on_every_tick=false, commission_type=strategy.commission.cash_per_contract, commission_value=0.0)//====================// Inputs//====================useLongs = input.bool(true, "Enable Longs")useShorts = input.bool(true, "Enable Shorts")// 15m Trend FiltertfTrend = input.timeframe("15", "Trend Timeframe")emaFastLenHTF = input.int(50, "HTF EMA Fast", minval=1)emaSlowLenHTF = input.int(200, "HTF EMA Slow", minval=1)// 1m Entry ToolsemaPullLenLTF = input.int(50, "LTF Pullback EMA", minval=1)rsiLen = input.int(14, "RSI Length", minval=1)rsiLongMin = input.int(50, "RSI Long Min", minval=1, maxval=100)rsiShortMax = input.int(50, "RSI Short Max", minval=1, maxval=100)// DMI / ADX Filter (LTF)dmiLen = input.int(14, "DMI Length", minval=1)adxSmooth = input.int(14, "ADX Smoothing", minval=1)adxMin = input.float(15.0, "Min ADX", step=0.5)// Risk ManagementatrLen = input.int(14, "ATR Length", minval=1)atrSLmult = input.float(1.5, "ATR Stop Mult", step=0.1)atrTPmult = input.float(2.0, "ATR Target Mult", step=0.1)// Session + CooldownuseSession = input.bool(true, "Use Session Filter")sessionStr = input.session("0630-1300", "Session (exchange time)")cooldownBars = input.int(10, "Cooldown Bars After Entry (1m)", minval=0)//====================// Helpers//====================inSession = not useSession or not na(time(timeframe.period, sessionStr))// Cooldown tracking (bar_index of last entry)var int lastEntryBar = nacanTrade = na(lastEntryBar) or (bar_index - lastEntryBar > cooldownBars)//====================// HTF Trend (15m)//====================emaFastHTF = request.security(syminfo.tickerid, tfTrend, ta.ema(close, emaFastLenHTF), barmerge.gaps_off, barmerge.lookahead_off)emaSlowHTF = request.security(syminfo.tickerid, tfTrend, ta.ema(close, emaSlowLenHTF), barmerge.gaps_off, barmerge.lookahead_off)trendUp = emaFastHTF > emaSlowHTFtrendDown = emaFastHTF emaPull and low = emaPullconfirmLong = (rsiVal >= rsiLongMin) and (adxVal >= adxMin) and (dmiPlus > dmiMinus)confirmShort = (rsiVal = adxMin) and (dmiMinus > dmiPlus)longCond = useLongs and inSession and canTrade and trendUp and pullbackLong and confirmLongshortCond = useShorts and inSession and canTrade and trendDown and pullbackShort and confirmShort//====================// Orders + Exits (ATR SL/TP)//====================longStop = close - (atrVal * atrSLmult)longLimit = close + (atrVal * atrTPmult)shortStop = close + (atrVal * atrSLmult)shortLimit = close - (atrVal * atrTPmult)if (longCond and strategy.position_size == 0) strategy.entry("L", strategy.long) lastEntryBar := bar_indexif (shortCond and strategy.position_size == 0) strategy.entry("S", strategy.short) lastEntryBar := bar_indexstrategy.exit("L-Exit", from_entry="L", stop=longStop, limit=longLimit)strategy.exit("S-Exit", from_entry="S", stop=shortStop, limit=shortLimit)//====================// Plotting//====================plot(emaPull, "1m Pullback EMA", linewidth=2)plot(emaFastHTF, "15m EMA Fast", linewidth=2)plot(emaSlowHTF, "15m EMA Slow", linewidth=2)plotchar(trendUp, title="Trend Up", char="▲", location=location.top, size=size.tiny)plotchar(trendDown, title="Trend Down", char="▼", location=location.top, size=size.tiny)