Select Page

This tutorial shows how MACD Expert Advisor can be used on charts of MT5 to Trade

Strategy Premise

MACD, short for moving average convergence/divergence, is a trading indicator used in technical analysis of stock prices. It is designed to reveal changes in the strength, direction, momentum, and duration of a trend in a stock’s price.

Strategy Logic

Long Entry: When MACD Crosses Above Zero

Long Exit: When MACD Crosses Below Zero or Price Reaches Target or Stoploss

Short Entry: When MACD Crosses Below Zero

Short Exit: When MACD Crosses Above Zero or Price Reaches Target or Stoploss

MT5 Settings

To start Algo trading with MACD on MT5, simply follow the steps given below. 

MACD Strategy

1: Make sure you have completed Jump Start setup

2: Download zipped files from here and extract them. You will find three sub-folders: Experts, Indicators, and Include. The files in these sub-folders should be copied in your MT5 directory in the same folders. In MT5 Click on File => Open Data Folder=> Click on MQL5 => Experts folder. Copy-paste the downloaded file to the Expert folder.

3: (Optional, if indicator nor present in your MT5) In MT5 Click on File => Open Data Folder=> Click on MQL5 => Indicator folder. Download the Indicator file from here and copy-paste in your Indicator folder. Also paste files to your Include folder if not already present.

4: In MT5 => Tools => Expert Advisor => Check all option available as shown below. 

Settings Required for MT5

MACD Strategy

5: Go to navigator click on refresh to refresh indicator and expert advisor

6: Now put MACD Expert Advisor on chart 

MACD Strategy

7: Change the Input Parameters as per your Requirement

MACD Strategy

In Dependencies click on Allow DLL imports

MACD Strategy

8: Now put the MACD Indicator on the chart and Change the Parameter as per the Inputs Set in EA. 

MACD Strategy

Please note that the input parameters of EA and the indicator should be the same, or the signal generation will not match with the indicator.

APIBridge Settings – New Users

Before setting EAs to your system it is advised to add all the symbols in APIBridge to avoid order rejections. Make sure you use the Correct expiry and strategy tag as given in MT5.

Here are the Strategy Parameters

Strategy tagUse default STG1 unless trading in multiple strategies
PortThis should be same as API bridge port application will signal from same port
ExpiryPut contract expiry here
Order typeSelect order type here from MARKET,LIMIT, SLL,SLM
InstrumentSet the instrument as per APIBridge
Fast EMA PeriodValue of Fast EMA
Slow EMA PeriodValue of Slow EMA
MACD SMA PeriodValue of MACD SMA
Trade TypeType of Trades to take
TargetTarget Value in Rupees
StoplossStoploss Value in Rupees