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.
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.
Period = 1 (virtually follows price closely), Shift = 15 (delayed by 15 bars). Method = SMA, Price = Close.
Period = 64, Shift = 62 (almost aligned with current bar). Method = SMA, Price = Close.
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.
Buy requires CCI(25) < -50 (oversold). Sell requires CCI > +68 (overbought). Disable by setting Use_CCI = false.
Buy requires RSI(12) < 43. Sell requires RSI > 79. Disable if not needed.
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.
Works on any forex, metal, index, or CFD that MT4 provides. The point() function auto-detects 4/5 digit brokers, Gold, and other symbols.
Lot = 0.01 (default). EA uses Lots() function which respects min/max lot and lot step of your broker.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
EAComment = "Maab 9". Visible in the βCommentβ column of the Trade tab.
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).
Uses EventSetMillisecondTimer(500) β calls OnTick() every 0.5 seconds via OnTimer(). Ensures fast reaction even when ticks are slow.
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.
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.
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.
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.
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.
Demo account only for at least 2 months.
Start with a small fixed lot (0.01) and disable Martingale (Martingale = false).
Test on a single pair (e.g., EURUSD M15) for 100+ trades.
Only then consider enabling Martingale with a low multiplier (1.5) and small step (50+ pips).
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.
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
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.
Trailing stop modifies stop loss every tick.
Profit target closes all if total profit β₯ Profit_Target.
MarProfit closes all if total pip profit > MarProfit.
Opposite signal closes individual orders if ExitOpposite = true.
TakeProfit / StopLoss on individual orders (if set).
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.
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.
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.