Engulfing 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:
- Engulfing Expert Advisor For MT4
- The Engulfing Expert Advisor For MT4 – Entry Criteria
- The Engulfing Expert Advisor For MT4 – Exit Criteria
- The Engulfing Expert Advisor For MT4 – Room for Improvement
The Engulfing Expert Advisor For MT4 makes use of the engulfing candlestick pattern as the main criteria for trade entry. However, the pattern identification is done on the next higher timeframe, so it is not shown in the above visual. What is displayed above is the up and down fractals, which is another criterion for trend identification. In addition, two other technical indicators are used to define and confirm a trade signal. These indicators will be explained later in this article.
Running the trading system in the strategy tester for a short period of time using historical price data did not return profits for the trading account. It is possible that the symbol and period chosen for testing are not suitable for the trading system, or the market environment was not optimal during the test period. The testing was done on EURUSD 15-minute. To get better or positive results, the user might consider implementing the expert advisor to other symbols and periods, which could be an individual embarkation for each user.
The Engulfing Expert Advisor For MT4 – Entry Criteria

The Engulfing Expert Advisor conducts limited checks prior to trade hunting. It checks first if the current candle has just formed; otherwise, it will exit the main function right away and wait for a new candle to develop on the active period. If a new bar has developed, the expert advisor will compute the overall drawdown if it is still within acceptable limits and then move forward. Then it loops through the trade pool to count the orders and find trades whose stop loss can be moved to breakeven or trailed. If these checks are successful, the robot will refer to the technical tools for direction on trade entry and timing.
This expert advisor offers the trader a few variables in Inputs whose values he can customize to find profitable combinations. The most significant variables are presented below, and an explanation is given to orient the user about the meaning of each value.
- Lots = 0.01 – Each trade taken by this expert advisor has a trade volume of 0.01 unless the user declares another value.
- TrailingStop = 40 – The trading system employs stop trailing, which gets activated when a trade gains at least 40 pips.
- Stop_Loss = 20 – Each trade opened by this robot has a nominal stop loss of 20 pips.
- MagicNumber = 1234 – The robot assigns this number to each trade it has taken to make trade management easy to perform.
- Take_Profit = 50 – Each trade opened by the expert advisor has a nominal take profit of 50 pips.
- FastMA = 6 – A six-period moving average is used in this trading system for trend identification.
- SlowMA = 85 – An 85-period moving average is employed in this trading system for trend identification.
- Mom_Sell = 0.3 – A sell signal will be confirmed for trade execution if the momentum is not equal to or more than 0.3.
- Mom_Buy = 0.3 – A buy signal will be confirmed for trade entry if the momentum value is not equal to or greater than 0.3.
- UseEquityStop = true – When this parameter is true, the robot will monitor the drawdown to protect the trading account. If the current drawdown goes beyond a maximum limit, all open trades on the current symbol will be immediately closed.
- TotalEquityRisk = 1.0 – Open trades in the current symbol will be liquidated if the current drawdown reaches this value, which is one percent of the trading balance.
- Max_Trades = 10 – With this default setting, the robot can open a maximum of 10 trades on the traded pair.
This trading system utilizes several technical tools to identify and qualify a trade entry. Two of these indicators are applied on the next higher timeframe, one is applied on the next lower timeframe, and one is used on the current timeframe. The indicators and their settings as well as the signal given are discussed below:
- Engulfing candlestick pattern – The expert advisor obtains the open and close prices of the two previous candles on the next higher timeframe of the active symbol to determine if an engulfing pattern has formed and thus identify the trade bias. If candle 2 is bearish and candle 1 is bullish, the trade bias is long. If candle 2 is bullish and candle 1 is bearish, the trade bias is short.
- Fractals (current symbol and timeframe) – The fractals indicator is used as one criterion for trade direction. As programmed, the expert advisor will make 200 iterations starting from the previous bar to find either an up or down fractal. However, the iteration will be cut short whenever an up or down fractal has developed early on. An up fractal will give a bearish signal, while a down fractal will indicate a bullish signal.
- Moving averages (periods 85 and 6, price typical, linear weighted) – The moving average values required for trend identification come from the current open candle on the next lower period of the current symbol. If the 6 LWMA is situated above the 85 LWMA, the trend is up. On the contrary, if the 6 LWMA is situated below the 85 LWMA, the trend is down.
- Momentum (close price, period 14) – The momentum data used for trade confirmation come from the previous three bars of the next higher period on the active symbol. Having at least one momentum value that is less than 0.3 is enough to confirm a trade signal. This value suggests that the current trend might still be strong and can possibly carry a trade forward toward take profit.
When a trade signal has been generated and qualified, a trade will be opened with a position size of 0.01 lot. When this trade is entered, the stop loss and take profit are also defined. As declared in Inputs, the stop loss is 20 pips and the take profit is 50 pips. However, the actual stop loss is a spread higher than the nominal value, and the actual take profit is a spread lower than the nominal amount.
The Engulfing Expert Advisor For MT4 – Exit Criteria
The Engulfing Expert Advisor can open multiple trades on the current symbol in one trading cycle. These trades are managed in two ways. If price hits the take profit or stop loss value, the trade concerned is closed in profit or in loss. This is the first method of trade management. The second method is a more active approach and takes effect when a trade reaches a threshold amount of gain (30 pips). At the threshold point, the stop loss is moved to the breakeven price. Beyond that point, the stop loss is continuously modified to lock in more profit.
The Engulfing Expert Advisor For MT4 – Room for Improvement
While not yet profitable in testing, the Engulfing Expert Advisor holds promise as an automated trading system. This opinion is based on estimation of the trading performance in test mode. The equity curve showed that the profit trend was not totally to the downside. There were times when the equity line trended to the upside. This happened when the market condition was trending. In ranging market conditions, the robot failed.
The expert advisor can be improved in many ways. One improvement must be applied to the code. As previously mentioned, the robot can perform 200 iterations until an up or down fractal is come by. In trading, this is not necessary. For example, an up fractal needs two lower highs on the left and the right to form. This means that the robot only needs to know if there is an up or down fractal in candle 3 and then generate a signal. Otherwise, it performs another round of test on the next candle.