About:
Triple Moving Average EA Strategy on MT5: https://www.mql5.com/en/market/product/160108
The Triple Moving Average EA embodies a classic trend following philosophy, designed to identify and ride sustained market movements through the precise alignment of three distinct moving averages. By combining trend confirmation with dynamic, volatility based risk management, it creates a systematic framework that removes emotional decision making from the trading process.
This approach naturally resonates with disciplined trend traders and busy professionals seeking automated execution, as well as risk averse investors who appreciate its strict, percentage-based position sizing. Traders often report psychological liberation, replacing fear and greed with consistent, rules based execution. The system enforces patience by requiring new price extremes after losses and automates complex risk calculations, allowing users to focus on strategy rather than screen watching.
The typical user is often a part time trader seeking disciplined automation, someone diversifying into systematic strategies, or a trader supplementing their primary methods with mechanical execution. While particularly effective in trending markets, success requires adequate capital for drawdowns, realistic expectations about performance metrics.
Overview
The Triple Moving Average EA is a trend-following Expert Advisor designed for MetaTrader 5. It uses three moving averages (default periods: 20, 50, 200) to identify trend direction, alignment, and entry triggers. Trades are opened only when strict conditions are met on closed candles, ensuring no repainting or hindsight bias. The EA incorporates ATR-based stop loss for dynamic risk control and balance-based position sizing to risk a user-defined percentage per trade (default 1%).
The EA default menu:

Key features:
Hedging-only compatibility: Works exclusively on hedging accounts to avoid issues with netting.
Re-entry protection after SL: After a stop loss hit, re-entry in the same direction requires price to make a new extreme (higher high for buy, lower low for sell) compared to candles since the original signal.
Customizable MAs: Each moving average can be SMA, EMA, SMMA, or LWMA.
No martingale or grid: Single trade per signal, fixed risk.
Unique magic numbers: Each trade has its own magic number for easy tracking.
This EA is suitable for both beginners and experienced traders. Always backtest on your broker's data before live use, as results may vary due to spreads, slippage, and market conditions.
Strategy Description
The EA follows a classic triple moving average crossover strategy with enhancements for risk management and re-entry logic. It identifies uptrends or downtrends based on MA alignment and price position relative to the MAs. Entries are triggered only on closed candles to ensure reliability.
Entry Rules
Trades are opened at the start of a new candle if the previous closed candle meets all conditions:
Buy Signal:
Trend Up: Close > Slow MA (200-period).
Alignment: Fast MA (20) > Medium MA (50) > Slow MA (200).
Trigger: Close > Fast MA, Close > Medium MA, Close > Slow MA (price above all three).
Sell Signal:
Trend Down: Close < Slow MA (200-period).
Alignment: Fast MA (20) < Medium MA (50) < Slow MA (200).
Trigger: Close < Fast MA, Close < Medium MA, Close < Slow MA (price below all three).
Only one trade is opened per signal (no pyramiding). The EA skips opening if a trade is already active.
Exit Rules
Normal Exit: Trade closes at the open of the next candle when Fast MA (20) crosses Medium MA (50):
For BUY: Fast MA crosses below Medium MA (bearish cross).
For SELL: Fast MA crosses above Medium MA (bullish cross).
Stop Loss: Dynamic SL based on ATR (default 20-period, 3x multiplier). Placed at entry.
No Take Profit: Relies on MA cross for exits to let profits run in trends.
Re-Entry After Stop Loss
If a trade hits SL, re-entry in the same direction is protected:
The EA requires the previous closed candle to make a new higher high (for BUY) or new lower low (for SELL) compared to all candles since the original signal candle.
This confirms trend resumption before risking again.
Protection resets on opposite signals or normal MA cross exits.
Money Management
Position Sizing: Calculated based on account balance (not equity) to risk a fixed % per trade (default 1%).
Formula: Lot Size = (Balance * Risk%) / (SL Distance in points * Tick Value).
Adjusted to broker's min/max/step lot sizes.
No compounding: Uses only balance for calculations, ignoring open P/L.
Stop Loss: ATR-based for volatility adaptation.
The expert advisor works on any timeframe. I encourage you to do tests and by doing so you will find the optimal MA values which are suited the best for your style, instrument and timeframe.


