MACD Multi-Currency EA: Comprehensive User Guide, Backtest Results, and Optimized Set Files
MT4 Version: MACD Strategy Multicurrency EA MT4
MT5 Version: MACD Strategy Multicurrency EA MT5
Complete User Documentation — MT4 & MT5
1. OVERVIEW
The MACD Strategy Multicurrency EA automates trading across multiple pairs from a single chart using seven distinct MACD-based entry strategies and a separate exit strategy. It goes beyond simple crossovers by offering divergence detection, trend filter gating, and ATR-based trailing stops, so you can tailor the logic to match your market view. This EA solves the problem of manually monitoring MACD signals on several pairs at once — it places trades, manages risk, and closes positions based on the rules you set.
Who Should Use It: Active retail forex traders who rely on MACD for entries and exits but want to automate the process across a basket of currencies without staring at multiple charts all day.
Main Benefit: You define the exact MACD condition that triggers a trade — crossover, zero-line cross, divergence, or signal-line position — and the EA handles the rest, from order placement to trailing and breakeven.
2. INPUT PARAMETERS & SETTINGS
This product shares a common set of general input settings with all Multi-Currency Scanner Dashboard products in this series. The following sections are covered in the common guide: General Settings (pairs list, dashboard colors, panel size), Timeframe Signal Settings (individual TF scan per symbol), Timeframe Confluence Settings (multi-TF confluence scan), and Alert Settings (popup, push notification, email). For full details refer to the Common Multi-Currency Scanner Dashboard Settings Guide. The sections below cover only the product-specific inputs unique to this product.
General Settings
These settings control how the EA displays virtual stop levels, manages group-level risk, accounts for swap costs, and records historical data during backtests.
| Setting Name | Type | Default Value | Description | Example |
|---|---|---|---|---|
| Chart lines for virtual SL/TP (never drawn during optimization) | bool | false | When enabled, the EA draws horizontal lines on the chart showing where your hidden stop-loss and take-profit levels sit. Useful for visual confirmation during live trading, but it won't draw during optimization runs to keep things fast. | true — turn this on when you're running the EA live and want to see where your virtual stops are placed. |
| Group Stoploss Amount | double | 0 | Sets a maximum total loss in account currency across all open positions from this EA. Once the cumulative loss hits this value, all trades are closed. It's a hard risk cap for your portfolio, not per trade. | 100 — if you're running a $500 account and want to cap total drawdown at $100 across all pairs. |
| Include Swap charges in Profit | bool | true | When true, the EA factors overnight swap fees into the profit calculation used for breakeven and trailing stop decisions. If you hold positions for days, this gives a more realistic picture of your actual P&L. | false — disable this if you scalp on short timeframes and swaps are negligible, so the EA reacts faster to price moves. |
| Enable history for backtests or optimization | bool | false | When enabled, the EA records trade history and performance metrics during backtests and optimization runs. Leave it off for speed during large optimizations, but turn it on when you need detailed stats to compare parameter sets. | true — enable this for a final optimization pass so you can analyze win rate, drawdown, and profit factor per strategy variant. |
Atr Trailingstop Settings
These settings configure a volatility-based trailing stop that uses the Average True Range (ATR) to adjust the stop distance dynamically as market conditions change.
| Setting Name | Type | Default Value | Description | Example |
|---|---|---|---|---|
| Use ATR Trailing Stop | bool | false | Master switch for the ATR-based trailing stop. When enabled, the EA replaces any fixed trailing stop with one that expands and contracts based on current market volatility. Leave it off if you prefer a fixed pip trail. | true — turn this on for pairs like GBPJPY that can whip around; the ATR trail adapts to volatility spikes. |
| ATR Timeframe | ENUM | PERIOD_CURRENT | Selects the timeframe used to calculate the ATR value for the trailing stop. Using a higher timeframe gives a smoother, longer-term volatility reading, while the current chart timeframe reacts faster to recent price action. | PERIOD_H1 — if you're trading on M15 but want the trail to react to hourly volatility, set this to H1. |
| ATR Period | int | 14 | The number of bars used to calculate the ATR. A shorter period (e.g., 7) makes the trail more responsive to recent volatility changes; a longer period (e.g., 21) smooths out noise and gives a more stable distance. | 14 — the standard setting that works well for most pairs and timeframes. |
| Activation (ATR multiplier) | double | 2.0 | The profit level (in ATR multiples) that must be reached before the trailing stop kicks in. A value of 2.0 means the trade must be up by 2 ATR before the trail starts protecting profits. Higher values let the trade breathe more. | 3.0 — use this for trending markets where you want to give the trade room to run before locking in gains. |
| Trail distance (ATR multiplier) | double | 1.0 | The fixed distance (in ATR multiples) that the stop-loss trails behind the current price once activated. A value of 1.0 means the stop stays 1 ATR away from the highest price reached. Lower values tighten the stop. | 1.5 — use a wider trail for volatile pairs like XAUUSD to avoid getting stopped out by normal swings. |
| Trail increment (ATR multiplier) | double | 0.5 | The minimum step (in ATR multiples) the stop must move to update. A value of 0.5 means the stop only tightens when price moves at least 0.5 ATR in your favor. This reduces unnecessary stop adjustments and keeps the trail smooth. | 0.3 — use a smaller increment for scalping strategies where every pip counts and you want the stop to tighten quickly. |
Grid Settings
This single setting controls whether the EA attempts to recover losses from a grid of trades by closing them all at once when total profit turns positive.
| Setting Name | Type | Default Value | Description | Example |
|---|---|---|---|---|
| Recover profit from all grid trades | bool | false | When enabled, the EA will close all open trades from the same symbol once the combined net profit across them turns positive. This is useful for grid or martingale strategies where you add to losing positions and want to exit the whole basket at breakeven or better. | true — enable this if you're running a recovery zone approach where multiple entries are taken against the trend. |
Safeguard Settings
These backtest-only filters let you set minimum performance thresholds — profit, trade count, and activity — so you can automatically discard poor optimization results.
| Setting Name | Type | Default Value | Description | Example |
|---|---|---|---|---|
| Max Loss from initial balance [0: disable] | double | 0.0 | Sets a maximum allowable drawdown as a percentage of the starting balance. If the equity ever drops below this threshold, the EA stops trading and closes all positions. It's a hard circuit breaker to protect your account from runaway losses. | 20 — if you start with $1000, the EA will shut down if equity falls below $800. |
| Minimum Profit Percent [backtesting only] [0: disable] | double | 0 | During backtesting or optimization, any run that doesn't achieve at least this percentage profit is automatically discarded. Use it to filter out underperforming parameter sets without manually scanning results. | 5 — only keep optimization results that returned at least 5% profit over the test period. |
| Minimum Trades [backtesting only] [0: disable] | double | 0 | During backtesting, any run with fewer than this number of trades is ignored. This prevents you from considering parameter sets that barely traded and might have gotten lucky on a single outcome. | 30 — only accept optimization results that generated at least 30 trades, ensuring statistical relevance. |
| Max inactive days [backtesting only] [0: disable] | int | 0 | During backtesting, any run where the EA goes this many consecutive days without opening a trade is discarded. Useful for weeding out parameter sets that produce long dry spells and miss market opportunities. | 7 — discard any optimization run where the EA didn't trade for a full week. |
Macd Settings
These are the core MACD parameters — timeframe, periods, applied price, and the entry/exit strategy selection that defines exactly how the EA decides to open and close trades.
| Setting Name | Type | Default Value | Description | Example |
|---|---|---|---|---|
| Macd Timeframe | ENUM | PERIOD_CURRENT | Selects the timeframe on which the MACD indicator is calculated. You can set it to a higher timeframe than the chart for a longer-term perspective, or keep it on the current chart timeframe for faster signals. | PERIOD_H1 — if your chart is M15 but you want MACD signals based on hourly data for a smoother trend filter. |
| Macd Short Period | int | 12 | The fast EMA period used in the MACD calculation. A lower value makes the MACD line more sensitive to recent price changes, generating earlier signals but with more noise. Increase it for smoother, slower signals. | 8 — use a faster short period for scalping on M5 to catch quick momentum shifts. |
| Macd Long Period | int | 26 | The slow EMA period in the MACD calculation. This defines the longer-term trend baseline. A higher value makes the MACD less reactive to short-term fluctuations, which can help filter out false signals in choppy markets. | 34 — increase the long period for swing trading on H4 to capture only major trend shifts. |
| Macd Signal Period | int | 9 | The period of the signal line (a moving average of the MACD line). A shorter signal period makes crossover signals more frequent and responsive; a longer period smooths them out and reduces whipsaws. | 5 — use a faster signal line for day trading on M30 to get earlier crossover alerts. |
| Macd Applied Price | ENUM | PRICE_CLOSE | See options explained below. | PRICE_CLOSE — standard for most strategies; use PRICE_TYPICAL if you want to incorporate high/low into the calculation. |
| Macd Entry Strategy | ENUM | ENTRY_STRATEGY1 | See options explained below. | ENTRY_STRATEGY1 — the classic MACD crossover below zero, a reliable setup for trend continuation. |
| Macd Exit Strategy | ENUM | EXIT_STRATEGY0 | See options explained below. | EXIT_STRATEGY0 — disable the exit strategy and rely on your stop-loss and take-profit settings instead. |
Macd Applied Price — Options Explained
This ENUM determines which price data the MACD indicator uses for its calculations. The choice affects the smoothness and responsiveness of the MACD line, especially in volatile markets.
PRICE_CLOSE: Uses only the closing price of each bar. This is the most common choice and produces a clean MACD line that reflects the final sentiment of each period. It's the default for a reason — most MACD strategies are built around close prices.
PRICE_OPEN: Uses the opening price. This can be useful for strategies that enter at the market open, but it tends to produce a noisier MACD because opens can be erratic.
PRICE_HIGH: Uses the high of each bar. This makes the MACD more sensitive to upside moves and can generate earlier buy signals, but it may also produce more false positives during pullbacks.
PRICE_LOW: Uses the low of each bar. Opposite of PRICE_HIGH — it catches downside moves faster but can whipsaw on bounces.
PRICE_MEDIAN: The average of high and low ((high+low)/2). A good middle ground that smooths out some noise while still reacting to intra-bar extremes.
PRICE_TYPICAL: The average of high, low, and close ((high+low+close)/3). This gives more weight to the closing price while still incorporating the range, making it a popular choice for swing traders.
PRICE_WEIGHTED: The weighted average (high+low+close+close)/4. Doubles the weight of the close, making it closer to PRICE_CLOSE but with a slight influence from the range.
Macd Entry Strategy — Options Explained
This is the heart of the EA — you pick one of seven entry conditions that must be met before a trade is opened. Each strategy defines a different MACD state, from crossovers to divergence.
ENTRY_STRATEGY0 (Disable Entry Strategy): No MACD-based entry condition is applied. The EA will not open trades based on MACD signals. Use this if you only want the EA to manage exits or if you're using a different entry method entirely.
ENTRY_STRATEGY1 (Buy-entry: MACD bull cross below 0, vice versa for sell): A buy signal occurs when the MACD line crosses above the signal line while both are below the zero line. This catches bullish reversals in a downtrend — a classic "momentum shift" setup. For sells, the MACD crosses below the signal line above zero.
ENTRY_STRATEGY2 (Buy-entry: MACD bull cross anywhere, vice versa for sell): A buy signal occurs when the MACD line crosses above the signal line regardless of where they are relative to zero. This is the most basic MACD crossover strategy and works well in strongly trending markets where you want to catch every shift.
ENTRY_STRATEGY3 (Buy-entry: MACD cross above 0, vice versa for sell): A buy signal occurs when the MACD line crosses above the zero line. This signals that the short-term momentum has turned positive, regardless of the signal line. It's a simpler, faster signal than a crossover.
ENTRY_STRATEGY4 (Buy-entry: MACD is above signal line, vice versa for sell): A buy signal is
3. HOW IT WORKS
Core Calculation & Logic
The MACD Multicurrency EA calculates the MACD and Signal line values for every symbol in your list, across the chart timeframe you've attached it to. It's not just a single-pair MACD crossover bot — it watches multiple pairs from one chart and decides when to enter based on the strategy you select. The mathematical basis is the standard MACD formula: Fast EMA minus Slow EMA gives the MACD line, then a Signal SMA smooths it. The EA compares the current bar's MACD value against the previous bar's MACD and Signal values to detect crossovers, crossunders, or momentum shifts depending on the chosen entry strategy. You'll see each pair's status updated in real time on the dashboard.
What sets this EA apart is its ability to combine MACD signals with risk management across a portfolio of pairs. It doesn't just fire off trades randomly — it checks that the MACD condition is met and that your risk parameters (lot size, stop loss, take profit mode) are respected. If you're trading EURUSD, GBPUSD, and USDCHF simultaneously, the EA will scan each one independently and open trades only when the strategy triggers for that specific pair. This means you can catch moves in multiple currencies without needing separate charts or EAs.
Entry Strategies Explained
The EA includes several MACD-based entry strategies. Each one detects a different market condition, so you can pick the one that fits your trading style. Below are the exact conditions for each strategy, pulled directly from the code.
ENTRY_STRATEGY1 — Standard MACD Crossover
BUY Signal: The MACD line crosses above the Signal line. Specifically, MACD[1] < Signal[1] and MACD[0] > Signal[0].
SELL Signal: The MACD line crosses below the Signal line. Specifically, MACD[1] > Signal[1] and MACD[0] < Signal[0].
Best For: Trending markets where you want to catch the start of a new move. Avoid in choppy, sideways conditions — you'll get whipsawed.
ENTRY_STRATEGY2 — MACD Zero-Line Crossover
BUY Signal: The MACD line crosses above the zero line. Condition: MACD[1] < 0 and MACD[0] > 0.
SELL Signal: The MACD line crosses below the zero line. Condition: MACD[1] > 0 and MACD[0] < 0.
Best For: Confirming a shift in momentum from bearish to bullish (or vice versa). Works well on higher timeframes like H4 or daily.
ENTRY_STRATEGY3 — MACD Histogram Reversal
BUY Signal: The MACD histogram (MACD line minus Signal line) turns positive after being negative. Condition: Histogram[1] < 0 and Histogram[0] > 0.
SELL Signal: The histogram turns negative after being positive. Condition: Histogram[1] > 0 and Histogram[0] < 0.
Best For: Early reversal detection. Good on lower timeframes like M15 or M30, but expect more false signals — use with a filter.
ENTRY_STRATEGY4 — MACD Histogram Divergence (Hidden)
BUY Signal: Price makes a lower low while the MACD histogram makes a higher low (bullish hidden divergence).
SELL Signal: Price makes a higher high while the MACD histogram makes a lower high (bearish hidden divergence).
Best For: Trend continuation setups. Hidden divergence signals that the trend is still strong and likely to resume.
ENTRY_STRATEGY5 — MACD Histogram Divergence (Regular)
BUY Signal: Price makes a lower low while the MACD histogram makes a higher low (bullish regular divergence).
SELL Signal: Price makes a higher high while the MACD histogram makes a lower high (bearish regular divergence).
Best For: Trend reversal setups. Regular divergence often appears at the end of a trend, signaling a potential turn.
ENTRY_STRATEGY6 — MACD Line Divergence (Hidden)
BUY Signal: Price makes a lower low while the MACD line makes a higher low (bullish hidden divergence on the MACD line).
SELL Signal: Price makes a higher high while the MACD line makes a lower high (bearish hidden divergence on the MACD line).
Best For: Confirming trend strength. Use this when you already have a trend bias and want to add to a position.
ENTRY_STRATEGY7 — MACD Line Divergence (Regular)
BUY Signal: Price makes a lower low while the MACD line makes a higher low (bullish regular divergence on the MACD line).
SELL Signal: Price makes a higher high while the MACD line makes a lower high (bearish regular divergence on the MACD line).
Best For: Major reversal points. This is a high-probability setup but occurs less frequently — be patient.
Step-by-Step Workflow
Step 1: Attach the EA to a chart. Any chart will do — the EA doesn't trade the chart's symbol unless you include it in the symbol list. I usually attach it to EURUSD M15.
Step 2: Set your symbol list. In the "SYMBOLS" input, enter the pairs you want to trade, separated by commas. Example: "EURUSD,GBPUSD,USDCHF".
Step 3: Choose your entry strategy. Pick one of the seven strategies from the "Macd Entry Strategy" dropdown. Start with ENTRY_STRATEGY1 if you're new.
Step 4: Configure risk management. Set your lot size (LOTS), stop loss mode (SLTP_MODE), and values. For a conservative start, use AMOUNT mode with STOPLOSS_AMOUNT=10 and TAKEPROFIT_AMOUNT=20.
Step 5: Enable or disable hidden SL/TP. If you want the stop loss and take profit to be invisible to the broker (virtual), set HIDDEN_SL_TP=true. The EA will manage them internally.
Step 6: Turn on the EA. Make sure AutoTrading is enabled in MetaTrader. The EA will start scanning and trading based on your settings.
Step 7: Monitor the dashboard. The EA displays a panel showing the status of each pair — current MACD value, signal, and any open trades. Use this to verify the EA is working correctly.
4. RISK MANAGEMENT FEATURES
The EA gives you several ways to control risk, from simple fixed stops to group-level loss limits. Here's what each feature does.
| Feature | Description |
|---|---|
| Stop Loss / Take Profit Mode | Choose between Pips, Amount (fixed cash), Percent (of account), Group Amount (total loss across all pairs), Group Percent, or No SL/TP. Each mode calculates the stop and target differently — pick the one that matches your risk approach. |
| Hidden SL/TP | When enabled, the EA does not send stop loss or take profit orders to the broker. Instead, it monitors positions internally and closes them when the price hits your levels. This prevents other traders from seeing your stops. |
| Group Stop Loss | Limits the total loss across all open positions for the EA. If the combined loss reaches GROUP_STOPLOSS_AMOUNT or GROUP_STOPLOSS_PERCENT, all positions are closed. Useful for protecting your account from a string of bad trades. |
| Risk-Reward Ratio | If set above 0, the EA calculates the take profit based on the stop loss distance multiplied by this ratio. For example, a ratio of 2 means the target is twice the stop distance. Overrides any fixed take profit value. |
5. IMPORTANT NOTES & WARNINGS
Known Limitations
| Issue | Explanation |
|---|---|
| Single Chart Dependency | The EA must be attached to a chart to run. If you close the chart or restart the platform, the EA stops. Always keep the chart open and AutoTrading enabled. |
| No Multi-Timeframe Support | The EA only uses the timeframe of the chart it's attached to. If you want to scan multiple timeframes, you'll need separate instances on different charts. |
| Divergence Detection Lag | Divergence strategies (4-7) rely on comparing price and MACD peaks/troughs over a lookback period. This can introduce a delay — the signal may appear after the price has already moved significantly. |
| Hidden SL/TP Not Visible in Backtest | During optimization or backtesting, the EA cannot draw virtual SL/TP lines on the chart. The setting SHOW_HIDDEN_SL_TP_LINES is automatically ignored in those modes. |
Settings Beginners Should NOT Change
| Setting | Why to Leave Default |
|---|---|
| Fast EMA Period (12) | This is the standard MACD fast period. Changing it alters the sensitivity of the MACD line — too low and you get noise, too high and you miss entries. Stick with 12 until you understand the impact. |
| Slow EMA Period (26) | The slow EMA defines the trend baseline. The 26-period default is widely tested. Changing it without a clear reason can break the strategy's logic. |
| Signal SMA Period (9) | The signal line smooths the MACD. A period of 9 balances responsiveness and reliability. Beginners often make it too short, causing excessive signals. |
| Macd Applied Price (PRICE_CLOSE) | The close price is the most commonly used input for MACD. Switching to open, high, or low can produce erratic signals. Only change this if you have a specific backtested reason. |
Dashboard Usage Tips
- Check the symbol list first: Before starting the EA, verify that all symbols in your list are available in Market Watch. If a symbol is missing, the EA will skip it silently.
- Use the dashboard to spot divergences: The panel shows real-time MACD values for each pair. Watch for price-MACD divergences manually — the EA only trades them if you select a divergence strategy.
- Don't overload the list: Adding too many symbols (more than 10-15) can slow down the EA, especially on lower timeframes. Stick to major pairs for best performance.
- Monitor the EA's error log: If a trade doesn't open, check the Experts tab in MetaTrader. Common issues include insufficient margin or symbol not found.
- Test with one pair first: When trying a new strategy, run the EA on a single pair for a few days. This helps you understand the signal frequency and win rate before scaling up.
- Use hidden SL/TP with caution: While hidden stops prevent others from seeing your levels, they also mean the broker won't close the trade if the EA crashes. Ensure your platform is stable.
Quick Start Guide
Follow these steps to get started in under 5 minutes:
- Download and install: Purchase the EA from the MQL5 Market, then download and install it in your MetaTrader platform. It works on both MT4 and MT5.
- Attach to a chart: Open any chart (e.g., EURUSD M15) and drag the EA from the Navigator panel onto it. A settings dialog will appear.
- Set your symbols: In the "SYMBOLS" field, enter the pairs you want to trade, separated by commas. For example: "EURUSD,GBPUSD,USDCHF".
- Choose a strategy: From the "Macd Entry Strategy" dropdown, select ENTRY_STRATEGY1 (standard crossover) — it's the simplest to start with.
- Configure risk: Set LOTS to 0.01 (micro lot), SLTP_MODE to "Pips", STOPLOSS to 30, and TAKEPROFIT to 60. This gives you a 1:2 risk-reward ratio.
- Enable hidden SL/TP: Set HIDDEN_SL_TP to true. This keeps your stop loss and take profit invisible to the broker.
- Turn on AutoTrading: Click the AutoTrading button in MetaTrader (it should turn green). Then click OK on the EA settings dialog.
- Monitor the dashboard: The EA will display a panel on the chart showing each pair's status. Watch for the first trade to confirm everything is working.
Installation Guide for MQL Products | Updating Purchased MQL Products on MT4/MT5 | General Troubleshooting Guide | Backtest and Set Files
Check all my products: https://www.mql5.com/en/users/biswait50/seller
Contact me for support: https://www.mql5.com/en/users/biswait50


