MACD TRADING STRATEGIES EA MT4/MT5 Settings/Inputs Guide

MACD TRADING STRATEGIES EA MT4/MT5 Settings/Inputs Guide

18 October 2024, 05:00
Biswarup Banerjee
0
279

MACD Expert Advisor Documentation

This Expert Advisor (EA) uses the Moving Average Convergence Divergence (MACD) indicator to identify entry and exit points based on momentum and trend changes. Alongside its core MACD-based strategy, the EA integrates optional advanced features, such as Moving Average filtering on higher timeframes, grid recovery, hedge, martingale strategies, position sizing based on profit, and day and time filters. These features enhance the EA's flexibility and efficiency in different trading conditions.

We divide our input sections into two parts. The first part is indicator-related settings, which you can find at the bottom side of the EA inputs. All other settings are common for every EA we make. We call these additional features. You can find the detailed documentation of these settings in this link.

MT4 version is available here  MACD Trading Ea Mt4

MT5 version is available here   MACD Trading EA Mt5

1. MACD Settings

MACD Input Parameters

  • MACD1__TEXT_1 - Divider text for visual clarity in the input section. (Not important for EA calculation)
  • MACD1_TEXT - Text label for MACD settings. (Not important for EA calculation)
  • MACD1__TEXT_2 - Divider text for visual clarity in the input section. (Not important for EA calculation)
  • MACD1_TIMEFRAME - Selects the timeframe for MACD calculation. Default: PERIOD_CURRENT .
  • MACD1_SHORT_PERIOD - Defines the short EMA period for MACD calculation. Default: 12 .
  • MACD1_LONG_PERIOD - Defines the long EMA period for MACD calculation. Default: 26 .
  • MACD1_SIGNAL_PERIOD - Defines the signal line EMA period for MACD calculation. Default: 9 .
  • MACD1_APPLIED_PRICE - Chooses the price type for MACD calculation. Default: PRICE_CLOSE .

Entry Strategy Options

  1. ENTRY_STRATEGY1 (Bull/Bear Cross Below Zero Line)

    • Buy when the MACD line crosses the signal line from below while both are below the zero line.
    • Sell when the MACD line crosses the signal line from above while both are above the zero line.
  2. ENTRY_STRATEGY2 (Bull/Bear Cross Above Zero Line)

    • Buy when the MACD line crosses the signal line from below while both are above the zero line.
    • Sell when the MACD line crosses the signal line from above while both are above the zero line.
  3. ENTRY_STRATEGY3 (Zero Line Cross)

    • Buy when the MACD line crosses above the zero line.
    • Sell when the MACD line crosses below the zero line.

Exit Strategy Options

  1. EXIT_STRATEGY1 (Bull/Bear Cross Below Zero Line)

    • Buy exit when the MACD line crosses the signal line from above while both are below the zero line.
    • Sell exit when the MACD line crosses the signal line from below while both are above the zero line.
  2. EXIT_STRATEGY2 (Price Cross Lower/Upper Band)

    • Buy exit when the price crosses the upper band.
    • Sell exit when the price crosses the lower band.
  3. EXIT_STRATEGY3 (Zero Line Cross)

    • Buy exit when the MACD line crosses below the zero line.
    • Sell exit when the MACD line crosses above the zero line.
  4. EXIT_STRATEGY4 (Disable Exit Strategy)

    • Disables automatic exits.

Note: Only one entry or exit strategy can be active at a time. If you are using grid, hedge, or martingale strategies alongside the base strategy, it is recommended to disable the exit strategy to avoid conflicts with these loss recovery mechanisms.


2. Additional Features

Moving Average (MA) Filter on Higher Timeframe

The MA filter enables trades that align with the broader trend based on a higher timeframe moving average:

  • Uptrend Condition - Allows buy trades when the close price is above the moving average.
  • Downtrend Condition - Allows sell trades when the close price is below the moving average.

Loss Recovery Strategies

There are couple of loss recovery strategies popular in the market. Grid, Hedge and Martingale is most popular among them. In this EA, we have these strategies inbuilt. But only one loss recovery strategy can be active at a time. EA will not load, if we enable more than one loss recovery strategies. There is one important point regarding these strategies, we can not set stoploss if you enable Grid or Hedge strategy. It will close trades earlier and will compromise the purpose of these strategies. All of these strategies are by default disabled.

Grid Recovery Strategy
In a losing position, the EA places additional trades in a grid pattern, averaging down the entry price to capitalize on retracements.
Hedge Strategy
To balance exposure during a losing position, the EA opens opposing trades (hedges), allowing profit potential in countertrend movements.
Martingale Strategy
Increases lot size after a loss on each subsequent signal, aiming for overall profitability.


Position Sizing Based on Profit
This feature adjusts the position size dynamically based on cumulative profit, aiming to optimize gains in favourable conditions. As profit accumulates, the EA increases the position size, allowing for scaled growth and larger potential returns.


Day Filter
Specifies trading days to avoid trading during specific days of the week, aligning with your strategy’s optimal market conditions. You can disable the entire day filter.


Time Filter
Limits trading to specific times, preventing trades during low-liquidity periods or other non-ideal market conditions. You can disable entire time filter.


This ADX-based EA, with versatile entry and exit strategies and advanced risk management features, is a comprehensive tool designed to adapt to various market conditions while offering robust control over trading operations. Use each feature thoughtfully to align with your trading objectives and risk management strategy.

 

Download Optimized set files here