MACD Expert Advisor For MT4
WE IMPROVED THIS EXPERT ADVISOR FOR YOU!!!
PLEASE NOTE: This expert advisor was publicly available for free usage on other websites and is not programmed by us. We explain the functionality and possible improvements of the EA. Furthermore, we are convinced that fully automatic Expert Advisors will fail in the long run. On the other hand, our semi-automatic approach with detecting the best setups and then activating our Expert Advisors (e.g. V-Power EA, EdgeZone EA) produced many successful traders and some of them even got prop traders at prop trading firms. Therefore, we added a similar semi-automatic trading feature (to allow only buy or only sell trades) to the free Expert Advisors. You can download the modified version here and enjoy!
Table Of Contents:
- MACD Expert Advisor For MT4
- The MACD Expert Advisor For MT4 – Entry Criteria
- The MACD Expert Advisor For MT4 – Exit Criteria
- The MACD Expert Advisor For MT4 – Suggestions for Improvement
As the name suggests, the MACD Expert Advisor for MetaTrader4 literally relies on the moving average convergence divergence (MACD) indicator to identify trade opportunities in the financial instruments being traded. As a simple trading program, this robot trades only the symbol and timeframe to which it is attached. If the user wants to trade other symbols, multiple instances must be applied to those symbols. When doing so, the user does not have to specify different magic numbers on each symbol as the expert advisor looks at both the magic number and the symbol when managing trades.
Anyone looking to use this expert advisor in trading must be aware that it is not yet suitable for implementation in live trading accounts. The trading result in the strategy tester is not satisfactory, taking various metrics into account, such as the overall direction of the equity curve, net profit, profit factor, expected payoff, maximal drawdown and winning percentage. The testing performed was very limited in duration, though, so it could not speak for the true performance of this expert advisor. Further testing is needed to come up with a reliable result. It might be a personal journey for interested users.
The MACD Expert Advisor For MT4 – Entry Criteria

The MACD Expert Advisor performs minimal checks before looking for trade entry. First, it will loop through the orders in the trade pool and count the open orders in the applicable symbol. If there is at least one open trade in the current symbol, command will immediately be returned to the client terminal. If there is no open trade yet, the expert advisor will check the technical indicator if a trade opportunity is present.
Another important filter for trade entry is the spread value on the underlying instrument. If the current spread is greater than two pips (by default), the expert advisor will not take a trade signal. The user can adjust the maximum spread value in Inputs to take into account the symbol being traded. The other parameters that the user can adjust as necessary in expert settings are the following:
- Lots = 0.1 – This parameter defines the lot size of each trade. All trades taken by the expert advisor have the same lot sizes.
- SL = 200 – This number pertains to the stop loss of each trade. All trades executed by the robot will have a stop loss of 200 points, or 20 pips.
- TP = 400 – This number refers to the take profit of each trade. All trades initiated by the trading program have a take profit target of 400 points, or 40 pips.
- MaxSpread = 20 – This figure specifies the maximum spread that the expert advisor is willing to accept when considering a trade entry. When this value is greater than 20 points (or 2 pips), the robot would pass on the trade opportunity.
- MagicN = 20182281 – This number is attached to every trade taken by the expert advisor. This information is used by the robot in managing its own trades.
The expert advisor uses one technical indicator to define the trade direction and time the trade entry. The indicator used, settings and how the signal is generated are explained below:
- Moving average convergence divergence (12, 26, 9; price close) – These settings are standard for the MACD indicator that comes with the MT4 platform. The MACD is applied on the current symbol, and values are obtained from four different timeframes (5 minutes, 15 minutes, one hour and four hour) for the previous candle. If MACD signal is greater than MACD main on 5-minute, 15-minute, 1-hour and 4-hour charts, a bullish signal will be generated. On the other hand, if MACD signal is less than MACD main on 5-minute, 15-minute, 1-hour and 4-hour charts, a bearish signal will be indicated.
Once the indicator provides a buy or sell signal, there is no open trade yet on the chart and the current spread is less than the maximum, the expert advisor will open a trade with a lot size of 0.10 as defined in Inputs. If the user finds this trade volume too high for his trading account, he can adjust this value at any time in the Inputs.
When a trade request is sent to the server, the predefined take profit and stop loss values are also being sent. By default, the take profit is 40 pips, and the stop loss is 20 pips. This relationship of take profit and stop loss is considered by many traders as favorable for the trader as it will take only one winning trade to cover a string of two losses. This risk-reward ratio tips the scale in favor of the trader so to speak.
The MACD Expert Advisor For MT4 – Exit Criteria
The MACD Expert Advisor does not closely manage its open trades. Any trade is decided either as a winner or a loser, and nothing comes in between. Live trades are exited only by the take profit for a profit or by the stop loss for a loss. Breaking even when a trade starts winning is not applied, and trailing stop after breaking even is not used either.
This type of trade management attempts to take advantage of risk-reward ratio in an effort to make money. Without breaking even and trailing the stop, a favorable risk-reward scenario of 1:2 is secured. As long as the trading system is able to yield a modest number of wins, a trading account using this expert advisor can get to break even or generate profits.
The MACD Expert Advisor For MT4 – Suggestions for Improvement
The current performance of the MACD Expert Advisor in back testing will not excite any serious trader or investor. In this testing, five months of historical price data in one symbol and 15-minute period was used. No other testing was done in other instruments or periods. The equity curve was moving down from the beginning of testing until the end. After the testing, 10 percent of the capital was lost.
While the risk-reward ratio is ideal, it was not enough to produce profits. This is because the win rate was too low, which is 25 percent. Had the trading system utilized a martingale lot sizing method, it might have been able to extract money from the markets. The trade-off is that the trading account could encounter heavy drawdowns or worse face a wipeout.
Therefore, it is important that the entry rules are given enough thought. While the program obtains values of the indicator from four timeframes when identifying a trade opportunity, it cannot guarantee that a position taken is on the right side of the market every time. In fact, based on the low win percentage, most trades are taken on the opposite side of the market.
Looking at the trades executed in the strategy tester, it appears that the trading algorithm is written incorrectly. For example, buy trades are taken when sell trades should have been executed. When the market is moving in one direction, the robot keeps on taking trades on the opposite direction, resulting in strings of losses and a plummeting equity curve.
Since the expert advisor uses only the MACD as an indicator of trend, it is easy to see that the robot is not taking the correct trades. When the MACD is above the zero line, it means that the trend is up on the applicable timeframe; therefore, a buy trade should be taken. In testing, sell trades are taken when MACD is clearly trending upward. Thus, the program code must be corrected first before anyone considers back testing.