Disclaimer: This article is for educational and informational purposes only. It does not constitute financial or investment advice. Trading forex and CFDs carries significant risk of loss. Past performance of any strategy – including backtests – does not guarantee future results. Never trade with money you cannot afford to lose.
What Is This Strategy?
The Market Maker Model strategy is a pure price action, market-structure trading approach that automates the ICT Market Maker Buy Model and Sell Model in MetaTrader 5 without any technical indicators: no moving averages, oscillators, bands, ATR or volume. The Expert Advisor reads raw candles and looks for a four-stage sequence: a sideways consolidation, a one-directional "program" away from it, a liquidity sweep with a sharp reversal, and a pullback into a fair value gap.
In the market maker model ICT framework, price starts in an "original consolidation," moves away from it to build up liquidity (clusters of stop orders), then reverses back toward where it began. This EA turns that discretionary story into fixed rules, so each stage either qualifies or it does not. It is built for markets that alternate between ranges and directional legs, and it targets a return to the original range rather than a new trend.
As a learning tool, it suits traders who know basic candlestick structure and want the market maker model explained in precise, testable terms. Treat it as a strategy analysis exercise, not a shortcut to results.
How It Works
The EA evaluates closed bars only, so signals do not change while a candle is forming. For the sell side, the code flips the price data upside down, so both halves of the market maker buy and sell model ICT concept share identical logic. The steps below describe the buy model; reverse every condition for sells.
Stage 1: The Original Consolidation
- The strategy looks for a box of
RangeBarscandles that is genuinely sideways. - Low drift: the net move from the box's first open to its last close must be small compared with the box height (set by
MaxRangeDrift). - Overlap: at least 30% of the box's candles must straddle its midpoint, which suggests balanced, two-sided trading.
- The box high must stay untouched afterward, because it becomes the target.
Stage 2: The Sell Program
- Price leaves the box downward in at least
MinLegslegs. - Every swing high must stay below the box high and below the previous swing high. One higher high cancels the pattern.
- At least
MinLegssuccessive lower lows must print below the box. - A swing high (or swing low) is a candle whose high (or low) is more extreme than the
SwingStrengthcandles on either side.
Stage 3: The Smart Money Reversal
- Liquidity sweep: within the eight candles before the reversal, one candle wicks below the most recent swing low and closes back above it, which may indicate that sell-side liquidity (stop orders under the low) has been taken. No candle may close below that low.
- Displacement: a strong bullish candle follows. Its body must be at least
DisplacementBodyof its full range and larger than every body in the previousDisplacementLookbackcandles. - Market structure shift (MSS): the displacement candle must be the first to close above the last lower high, an early sign the downtrend structure may have broken.
- Fair value gap (FVG): the move must leave a three-candle imbalance where the first candle's high sits below the third candle's low.
Stage 4: Entry, Stop-Loss and Take-Profit
- Entry: the strategy signals a market buy the first time price trades back down to the FVG's upper edge.
- Stop-loss: below the sweep low, plus a
StopBufferPointscushion. Sell trades also add the spread. - Take-profit: the original consolidation's high, the "return to origin" idea behind the model.
- Reward filter: a setup is armed only if the target is at least
MinRRtimes the risk. The check repeats at the fill price, and the trade is skipped if the ratio no longer holds. - Trades close only at the stop-loss or take-profit. There is no trailing stop, break-even or time exit.
How the Market Maker Model Strategy Cancels a Setup
- Price reaches the target, or returns to the sweep extreme, before revisiting the gap.
- The gap is not revisited within
SetupExpiryBarscandles. - The first return has been used. There is no second attempt.
- Only one position runs at a time, and no new setups are tracked during a trade.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| RangeBars | 10 | 10 | 30 | Number of candles in the original consolidation box. Values below 10 are raised to 10. |
| MaxRangeDrift | 0.5 | 0.2 | 0.8 | Largest allowed net move across the box, as a fraction of box height. Lower values require a flatter range. |
| SwingStrength | 2 | 1 | 4 | Candles needed on each side to confirm a swing high or low. Higher values pick out only larger swings. |
| MinLegs | 2 | 2 | 4 | Minimum lower highs and lower lows (higher highs and higher lows for sells) in the program leg. |
| MaxProgramBars | 60 | 20 | 150 | How far back, in bars, the EA searches for the original consolidation. |
| DisplacementBody | 0.6 | 0.4 | 0.9 | Minimum body-to-range ratio for the displacement candle (0.6 = body is at least 60% of the candle). |
| DisplacementLookback | 4 | 2 | 12 | Number of earlier candles whose bodies the displacement candle must exceed. |
| MinRR | 2.0 | 2.0 | 5.0 | Minimum reward-to-risk ratio needed to arm and enter a setup. Values below 2.0 are raised to 2.0. |
| SetupExpiryBars | 12 | 3 | 40 | How many bars a setup stays valid while waiting for price to return to the FVG. |
| StopBufferPoints | 10 | 0 | 100 | Extra distance, in points, placed beyond the sweep extreme for the stop-loss. |
| Lots | 0.10 | 0.01 | 1.0 | Fixed trade volume, adjusted to your broker's lot step and limits. |
The MT5 version also has a Magic input (default 5150), the ID the EA uses to recognise its own positions.

Recommended Chart Settings
The EA was designed for EURUSD on the M15 (15-minute) timeframe. It reads only the chart it is attached to, so you can test it on any symbol and timeframe. Note that StopBufferPoints is measured in points: on 5-digit EURUSD, 10 points is 1 pip, but the same value means something very different on gold, indices or JPY pairs.
If you test the market maker model MT5 build elsewhere, expect different behaviour: higher timeframes tend to produce fewer setups, lower timeframes more noise. Results will also vary between ranging, trending and news-driven conditions.
How to Install on MetaTrader 5
- Download the .ex5 file from the link below
- Copy it to your MT5
MQL5\Expertsfolder - Restart MetaTrader 5 or refresh the Navigator panel
- Drag the EA onto a chart matching the recommended symbol and timeframe
- Configure the input parameters and enable Algo Trading
The compiled file is MarketMakerModel.ex5. While running, the EA logs "armed," "skipped" and entry messages to the Experts tab so you can follow each decision.
What to Consider Before Using This EA
Strengths
- Objective rules for a discretionary concept. Each stage has a fixed definition, so results can be tested and repeated.
- Structure-based risk. Every stop sits beyond a specific swept level, and every trade has a defined exit.
- Reward filter. Setups offering less than the minimum reward-to-risk ratio are ignored, both when armed and at entry.
- Symmetrical logic. The sell model mirrors the buy model, so neither direction gets special treatment.
Limitations
- Infrequent signals. Four stages must line up in order, so long stretches without trades are normal, and small samples make backtest statistics less reliable.
- Simplified definitions. Fixed thresholds for "consolidation" and "displacement" only approximate how a discretionary trader reads a chart.
- Trending markets. The model expects a return to origin. In strong trends, a sweep and structure shift can fail before the target is reached.
- No session filter. ICT material often stresses specific sessions ("killzones"), but this EA trades whenever the pattern appears.
- Fixed lot size. Stop distances vary, so the money at risk changes from trade to trade.
- Slippage. Entries are market orders, so fast moves can fill beyond the gap edge or cause a skipped trade.
Note that institutional market maker trading strategies involve quoting bid and ask prices. The Market Maker Model strategy here is a retail chart pattern that only borrows the name.
Risk Management Tips
- Size by risk. Because
Lotsis fixed and stops vary, estimate what a full stop-loss costs on typical setups, then choose a volume that keeps each loss to roughly 1-2% of your account or less. - Start on demo. Use a demo account or the Strategy Tester first to see how often the EA trades and how spreads, commission and swap affect it.
- Understand drawdown. Even with a 2:1 reward-to-risk ratio, several losses in a row are a normal outcome. Decide in advance how deep a drawdown (the fall from an account's peak) you can tolerate.
- Avoid over-fitting. Eleven parameters make it easy to tune settings to past data. Check them on out-of-sample periods.
Risk Warning
Trading foreign exchange, CFDs, and other leveraged financial instruments involves substantial risk of loss and is not suitable for all investors. The strategies and tools discussed on this page are provided for educational purposes only and do not constitute financial advice, investment recommendations, or solicitation to trade. Always consult a qualified financial adviser before making trading decisions. Past backtest performance is not indicative of future results.
Downloads
- Expert Advisor: MarketMakerModel.ex5 (1 downloads)
- Source Code: MarketMakerModel.mq5 (1 downloads)
- Documentation: MarketMakerModel.pdf (2 downloads)