SMC ICT Backtest XAUUSD + MNQ — Strategy by shary890

By shary890

Performance Metrics

Description

It's a Pine Script v5 strategy named "SMC ICT Backtest XAUUSD + MNQ" that backtests a supply/demand / Smart Money Concepts (SMC) style entry logic.Runs with initial capital $10,000, 0.01% commission, no pyramiding, and processes orders on bar close.Key componentsSessions: defines trading allowed only during London (07:00–10:00) or New York (12:30–16:00) session bars.Swings: detects pivot highs/lows using ta.pivothigh / ta.pivotlow with a user input swingLen (default 5) and stores the last confirmed pivot high/low.Liquidity sweeps:bullSweep: current low breaks below last pivot low and the close reclaims above that pivot low (liquidity grab below support).bearSweep: current high breaks above last pivot high and close falls back below that pivot high.MSS (Market Structure Shift) filters:bullMSS: bullSweep plus close > previous bar high (high[1]).bearMSS: bearSweep plus close high[2] (i.e., a gap / imbalance to the upside).bearFVG: current high < low[2] (gap to the downside).Entries:Long when tradeSession AND bullMSS AND bullFVG.Short when tradeSession AND bearMSS AND bearFVG.Risk management:Stop-loss for long = current bar low; for short = current bar high.Position size default (strategy.entry) uses account sizing defaults (no explicit size defined).Take-profit is set at Risk * rr (input; default 2.0) from entry.Orders: entry + paired exit (strategy.exit with stop and limit for each side).Visuals: plots triangle up/down for long/short signals.Notes, assumptions, and cautionsThe script name references XAUUSD and MNQ but contains no symbol-specific logic — it will run on whatever chart you attach it to.Uses pivots that require swingLen bars of confirmation; results depend strongly on chart timeframe and swingLen.Stop is set to the full low/high of the signal bar — that may be wide; position sizing should account for risk per trade.FVG and MSS rules are implemented in a simple way (comparisons to specific bars); you may want to refine definitions for your edge.No explicit position sizing or instrument correlation handling; add sizing rules if needed.

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView