This Expert Advisor (EA) implements Smart Money Concepts (SMC) and Inner Circle Trader (ICT) strategies specifically optimized for prop firm challenges like FTMO, MyForexFunds, and others.
- Fair Value Gap (FVG) Detection: Automatically identifies price imbalances where institutions are likely to re-enter
- Order Block (OB) Identification: Detects institutional order zones for high-probability entries
- Liquidity Sweep Detection: Identifies stop hunts before major price reversals
- Market Structure Analysis: Tracks bullish/bearish structure (Higher Highs/Lower Lows)
- FTMO-Compliant Risk Management: Built-in daily loss limits, max drawdown protection, and trade limits
- Automated Position Sizing: Calculates lot size based on risk percentage
- Trailing Stop: Protects profits as trades move in your favor
-
Download the EA: Save
ICT_SMC_EA.mq5to your computer -
Open MetaTrader 5
-
Navigate to Data Folder:
- Click
File→Open Data Folder - Go to
MQL5→Experts
- Click
-
Copy the EA: Place
ICT_SMC_EA.mq5in theExpertsfolder -
Compile:
- Open MetaEditor (F4 in MT5)
- Open
ICT_SMC_EA.mq5 - Click
Compile(F7) - Fix any errors if they appear
-
Attach to Chart:
- In MT5, drag the EA from Navigator onto your chart
- Click "Allow Algo Trading" when prompted
- Configure settings (see below)
A Fair Value Gap occurs when price moves so quickly that it creates an imbalance:
Bullish FVG: Candle 3's low > Candle 1's high (gap up)
Bearish FVG: Candle 3's high < Candle 1's low (gap down)
Trading Logic: Price tends to return to fill these gaps. The EA enters trades when price retraces into an FVG zone.
Order blocks are the last opposite-colored candle before a strong price move:
Bullish OB: Last red candle before price rallies
Bearish OB: Last green candle before price drops
Trading Logic: These zones represent where institutions placed large orders. Price often reacts when returning to these levels.
Institutions "hunt" stop losses before reversing:
Bullish Sweep: Price briefly drops below recent lows, then reverses up
Bearish Sweep: Price briefly rises above recent highs, then reverses down
Trading Logic: After a sweep, the EA looks for entries in the opposite direction.
The EA analyzes market structure to determine trend:
Bullish: Higher Highs + Higher Lows
Bearish: Lower Highs + Lower Lows
Trading Logic: Only takes trades aligned with current structure.
Long Trade Requirements:
- Bullish market structure detected
- Liquidity sweep to the downside
- Price retraces into bullish FVG or Order Block
- Risk limits not breached
Short Trade Requirements:
- Bearish market structure detected
- Liquidity sweep to the upside
- Price retraces into bearish FVG or Order Block
- Risk limits not breached
RiskPercent = 1.0 // Risk 1% per trade (recommended for FTMO)
MaxDailyLoss = 5.0 // Stop trading if daily loss reaches 5%
MaxTotalLoss = 10.0 // Stop trading if total loss reaches 10%
MaxTradesPerDay = 5 // Maximum 5 trades per day
UseTrailingStop = true // Enable trailing stop for profit protection
FTMO Challenge Rules:
- Phase 1: 10% profit target, 10% max loss, 5% daily loss limit
- Phase 2: 5% profit target, same loss limits
- Recommendation: Keep
RiskPercent = 1.0andMaxDailyLoss = 4.0for safety buffer
FVG_MinPoints = 10 // Minimum gap size to be considered valid
OrderBlock_Lookback = 50 // How many candles to scan for order blocks
LiquiditySweep_Lookback = 20 // Bars to check for swing highs/lows
LiquiditySweep_Buffer = 5 // Points beyond swing to confirm sweep
Optimization Tips:
- Lower timeframes (M5-M15): Use smaller
FVG_MinPoints(5-10) - Higher timeframes (H1-H4): Use larger
FVG_MinPoints(15-30)
RiskRewardRatio = 2.0 // Minimum 1:2 risk-reward
TrailingStop_Points = 100 // Trail by 100 points (10 pips for 5-digit)
TrailingStop_Step = 10 // Move SL when profit increases by 10 points
TradeOnlyHigherTimeframe = true // Use HTF for market structure
HTF_Timeframe = PERIOD_H4 // Higher timeframe (H4 recommended)
SpreadLimit = 20 // Max spread in points (2 pips for 5-digit)
TradingStartTime = "00:00" // Start trading at midnight
TradingEndTime = "23:59" // Trade all day
Best Practice:
- For scalping (M1-M5): Set
HTF_Timeframe = PERIOD_M15orPERIOD_H1 - For swing trading (H1-H4): Set
HTF_Timeframe = PERIOD_H4orPERIOD_D1
RiskPercent = 0.5
FVG_MinPoints = 5
OrderBlock_Lookback = 30
HTF_Timeframe = PERIOD_M15
RiskRewardRatio = 1.5
RiskPercent = 1.0
FVG_MinPoints = 10
OrderBlock_Lookback = 50
HTF_Timeframe = PERIOD_H1
RiskRewardRatio = 2.0
RiskPercent = 1.5
FVG_MinPoints = 20
OrderBlock_Lookback = 100
HTF_Timeframe = PERIOD_H4
RiskRewardRatio = 3.0
The EA displays real-time information on your chart:
========== ICT/SMC EA ==========
Status: SCANNING
--------------------------------
Balance: 10000.00
Equity: 10150.00
Daily P/L: 150.00 (1.50%)
Trades Today: 2/5
--------------------------------
Market Structure: BULLISH
FVGs Detected: 3
Order Blocks: 5
Open Positions: 1
================================
- Open Strategy Tester (Ctrl+R)
- Select
ICT_SMC_EA.ex5 - Choose your symbol (e.g., EURUSD)
- Select timeframe (M15 or H1 recommended)
- Date range: At least 3-6 months of data
- Click Start
Important: Use "Every tick based on real ticks" for accurate results
To find best settings for your pair/timeframe:
- In Strategy Tester, check Optimization
- Select parameters to optimize:
RiskPercent(0.5 to 2.0)FVG_MinPoints(5 to 30)RiskRewardRatio(1.5 to 3.0)
- Click Start
- Review results by Profit Factor and Max Drawdown
Important Notes:
- Past Performance ≠ Future Results: Backtesting results do not guarantee future profitability
- Demo First: Always test thoroughly on demo account before live trading
- Prop Firm Rules: Ensure EA settings comply with your specific prop firm's rules
- Market Conditions: Strategy performance varies with market volatility and conditions
- Monitoring Required: Check EA regularly, especially during news events
- Use 0.5-1% risk per trade
- Never exceed 3-4 trades per day
- Stop trading after 2 consecutive losses
- Best: M15 and H1 charts
- Avoid: M1 (too much noise) and Daily (too slow)
- London Session (08:00-12:00 GMT): High volatility, clear trends
- New York Session (13:00-17:00 GMT): Good liquidity
- Avoid: Asian session (low volatility, fake breakouts)
- Major Pairs: EURUSD, GBPUSD, USDJPY (tight spreads, good liquidity)
- Avoid: Exotic pairs (wide spreads, unpredictable moves)
- Check economic calendar daily
- Disable EA 30 minutes before high-impact news (NFP, FOMC, CPI)
- Re-enable after price settles (30-60 minutes after)
- Check Logs: View
Expertstab for error messages - Verify Settings: Ensure risk limits haven't been hit
- Spread Too High: Increase
SpreadLimitparameter - No Setup: ICT setups don't occur every day - be patient
- AutoTrading: Ensure "Algo Trading" button is enabled (green)
- Review Backtest: Test on 3-6 months of historical data
- Optimize Settings: Different pairs need different settings
- Market Conditions: Some periods don't suit this strategy
- Reduce Risk: Lower
RiskPercentto 0.5%
- Error: Undeclared identifier: Check MQL5 version (update MT5)
- Error: Invalid parameters: Verify input values are within valid ranges
For questions, issues, or suggestions:
- Review MQL5 documentation: https://www.mql5.com/en/docs
- ICT YouTube Channel: Search "Inner Circle Trader" for strategy education
- SMC Resources: https://ftmo.com/en/how-to-trade-smart-money-concepts-smc/
v1.00 (2025-11-04)
- Initial release
- Fair Value Gap detection
- Order Block identification
- Liquidity sweep recognition
- FTMO-compliant risk management
- Trailing stop functionality
- Real-time dashboard
This EA is provided for educational purposes. Use at your own risk. No guarantees of profitability.
Developed with ICT/SMC principles for prop firm traders
Good luck with your FTMO challenge!