Maab 9 Expert Advisor – Complete Guide for MT4 (All Timeframes & Pairs)

This EA combines moving average crossovers, CCI, RSI filters, Martingale, and trailing stop logic. Use with extreme caution – Martingale can rapidly deplete your account. The following 35 points explain exactly how it works and how to use it safely on any chart.


πŸ”§ 1. Core Trading Logic (Entry Signals)

  • Buy when Fast MA (Period 1, Shift 15) crosses above Slow MA (Period 64, Shift 62) on the previous closed bar, AND all active filters agree.

  • Sell when Fast MA crosses below Slow MA on the previous bar, AND all active filters agree.

πŸ“Š 2. Fast Moving Average

  • Period = 1 (virtually follows price closely), Shift = 15 (delayed by 15 bars). Method = SMA, Price = Close.

🐒 3. Slow Moving Average

  • Period = 64, Shift = 62 (almost aligned with current bar). Method = SMA, Price = Close.

🚦 4. Optional MA Filter (UseMA)

  • When enabled (default = true), the EA also requires price to be on the correct side of a third MA (Period 106, Shift 2). This acts as a trend filter.

πŸ“ˆ 5. CCI Oscillator Filter (Use_CCI)

  • Buy requires CCI(25) < -50 (oversold). Sell requires CCI > +68 (overbought). Disable by setting Use_CCI = false.

πŸ“‰ 6. RSI Oscillator Filter (Use_RSI)

  • Buy requires RSI(12) < 43. Sell requires RSI > 79. Disable if not needed.

⏱️ 7. Timeframe Independence

  • The EA recalculates on every tick but only checks signals on new bar (using iTime(NULL,0,0)). Works on any timeframe (M1 to MN). However, parameters (MA shifts, CCI/RSI periods) are optimised for a specific timeframe – retest if you change timeframe.

πŸ’± 8. Pairs / Symbols

  • Works on any forex, metal, index, or CFD that MT4 provides. The point() function auto-detects 4/5 digit brokers, Gold, and other symbols.

πŸ’° 9. Money Management – Base Lot

  • Lot = 0.01 (default). EA uses Lots() function which respects min/max lot and lot step of your broker.

πŸ“ˆ 10. Increasing Lot on Balance Growth

  • If UseIncreasing = true, every time balance grows by BalancePercent% (default 50%), the lot increases by AddValue (default 0.01). Dangerous – can escalate size after wins.

🎲 11. Martingale Mode (Enabled by Default!)

  • Martingale = true. Each time a new order is added in the same direction (after a losing position), lot size = previous lot Γ— Multiplier (default 2). Extremely high risk – can cause exponential drawdown.

πŸ“ 12. Order Steps (Xpips)

  • Xpips = 20. When a trade runs negative and price moves 20 pips away, the EA opens an additional order (same direction) with increased lot (if Martingale is on). This is a grid / martingale behaviour.

πŸ›‘ 13. Stop Loss & Take Profit

  • StopLoss = 0 (disabled), TakeProfit = 0 (disabled). If you set them, they are applied to the first order only. Subsequent orders use the same SL/TP values.

🎯 14. Profit Target (Global)

  • Profit_Target = 0.1 (default). When total profit of all open orders reaches 0.1 (in account currency), all orders are closed. Useful as a daily or cycle target. Set to 0 to disable.

πŸ“¦ 15. Martingale Profit Close (MarProfit)

  • MarProfit = 1 (pip). If the total pip profit of the open basket exceeds 1 pip, all orders close. This is a very tight exit – can cause many small wins but also premature exits.

πŸ”„ 16. Exit Opposite Signal

  • ExitOpposite = false (default). If enabled, when a new opposite signal appears (e.g., Sell signal while holding a Buy order), that specific order is closed. Useful for trend-following exits.

🚢 17. Trailing Stop (Enabled by Default)

  • UseTrailingStop = true, TrailingStart = 15, TrailingStop = 10. Once a trade is 15 pips in profit, the stop moves to lock in 10 pips. Works on all open orders.

πŸ”’ 18. Maximum Open Orders

  • MaxOpenOrders = 100. The EA will not add more than this many orders (including all buys + sells). High limit – Martingale can easily reach dozens of orders in a strong trend.

πŸ§™ 19. Magic Number

  • MN = 1. All orders are tagged with this number so the EA only manages its own trades. Change if running multiple copies on same symbol.

πŸ“ 20. EA Comment

  • EAComment = "Maab 9". Visible in the β€œComment” column of the Trade tab.

πŸ“Š 21. Chart Information Panel

  • ShowInfo = true. Displays lot size, trade statistics, daily profit, current profit, and days remaining until license expiry (31 Dec 2027). Corner can be changed with Corner (0=top left, 1=top right, 2=bottom left, 3=bottom right).

⏲️ 22. Timer & Tick Handling

  • Uses EventSetMillisecondTimer(500) – calls OnTick() every 0.5 seconds via OnTimer(). Ensures fast reaction even when ticks are slow.

πŸ§ͺ 23. Testing / Optimisation Mode

  • In Strategy Tester, the EA only evaluates signals on new bars (performance optimisation). Live trading evaluates every tick but only opens trades on new bar.

πŸ”’ 24. License Expiry Behaviour

  • The EA includes a hardcoded expiration date: 31 December 2027. After that, no new orders will be opened. A popup message appears once. The info panel still works but trading stops.

⚠️ 25. Risk Warning – Martingale

  • The default Martingale (multiplier 2) with order steps of 20 pips can cause enormous drawdown after a few consecutive losing trades. Example: After 5 losses, lot size = 0.01Γ—2⁡ = 0.32. Account can blow up in a strong trend.

⚠️ 26. Risk Warning – No Stop Loss

  • By default, SL = 0 and TP = 0. The only protection is the profit target (0.1), trailing stop (after 15 pips), and MarProfit (1 pip). Without a hard stop, a sudden spike can cause large floating loss.

⚠️ 27. Risk Warning – Increasing Lot on Balance Growth

  • If UseIncreasing = true, the EA permanently raises lot size after the account grows. This compounds risk and can lead to large losses after a winning streak.

πŸ§ͺ 28. Recommended Testing Procedure

  1. Demo account only for at least 2 months.

  2. Start with a small fixed lot (0.01) and disable Martingale (Martingale = false).

  3. Test on a single pair (e.g., EURUSD M15) for 100+ trades.

  4. Only then consider enabling Martingale with a low multiplier (1.5) and small step (50+ pips).

πŸ“… 29. Suitable Timeframes

  • Original parameters seem designed for M15 or H1. Avoid M1/M5 because the MA shifts (15, 62) would reference too much history and signals become rare. On daily charts, the MA shifts might be excessive.

🧰 30. Recommended Initial Settings (Conservative)

text
Martingale = false
UseIncreasing = false
StopLoss = 50 (pips)
TakeProfit = 50
Profit_Target = 0 (disabled)
MarProfit = 0 (disabled)
Xpips = 40 (wider spacing)
UseTrailingStop = true (TrailingStart=30, TrailingStop=20)
MaxOpenOrders = 5
Lot = 0.01

πŸ” 31. How the Grid/Martingale Sequence Works

  • First order opens at signal price.

  • If price moves against it by Xpips and the first order is losing, a second order is opened (lot size = previous lot Γ— Multiplier).

  • This repeats until MaxOpenOrders is reached or the basket becomes profitable enough to close via Profit_Target or MarProfit.

πŸ“Œ 32. Exit Conditions (Priority Order)

  1. Trailing stop modifies stop loss every tick.

  2. Profit target closes all if total profit β‰₯ Profit_Target.

  3. MarProfit closes all if total pip profit > MarProfit.

  4. Opposite signal closes individual orders if ExitOpposite = true.

  5. TakeProfit / StopLoss on individual orders (if set).

πŸ“‚ 33. Installation on MT4

  • Save the code as Maab 9.mq4 in MQL4/Experts/ folder.

  • Compile in MetaEditor.

  • Attach to a chart, adjust inputs, enable Allow live trading and Allow DLL imports (not needed but harmless).

  • For multiple symbols, change Magic Number per chart.

πŸ” 34. Monitoring While Running

  • Watch the info panel for current profit, lot size, and days left.

  • Check the Experts tab for errors (e.g., β€œNot enough money”).

  • Monitor the Trade tab to see the distance between orders (should be Xpips).

  • If drawdown exceeds 30% of account, manually close all trades and review settings.

βœ… 35. Final Advice – Use Extremely Carefully

This EA is a high‑risk grid/martingale system disguised as a trend‑following MA crossover. Without hard stops, a single strong trend can cause catastrophic losses. Never run it on a live account unless you fully understand each parameter and have tested it for months. Consider it an educational tool rather than a reliable profit generator.