Pull Back 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:
- Pull Back Expert Advisor For MT4
- The Pull Back Expert Advisor – Entry Criteria
- The Pull Back Expert Advisor – Exit Criteria
- The Pull Back Expert Advisor – Room for Improvement
The Pull Back Expert Advisor For MT4 uses two sets of moving averages in an attempt to trade with the trend. One set of moving averages is applied on the next lower period from the active chart, while the other set is used on the next higher period. Meanwhile, another indicator is used as trade filter to avoid false signals. This expert advisor then is more of a trend-following system than a pullback trading system.
True to its design, the robot performs well when the market is trending and falters when the market ranges or makes a reversal. Since markets tend to trend only 25 percent of the time, it stands to reason that the system is bound to fail. This is exactly what happened in testing. The trading system failed to generate profits in the strategy tester. There could be other factors that contributed to this unfavorable result, such as the amount of trades taken at one time, traded symbol, timeframe, etc.
The Pull Back Expert Advisor – Entry Criteria
The Pull Back Expert Advisor looks for trade entry at the start of a new candle. But before even considering a trade, the robot performs testing to see if certain conditions are met. First, the current drawdown in the current trading account should be less than one percent, and the account should have enough free margin to open new trades. Next, there should be more than 100 bars in the active chart, and the take profit defined in Inputs should be greater than or equal to 10 pips. If testing is successful, the robot will count the number of trades if it is zero or less than the maximum.
Some parameters are available in Inputs that the user can adjust as necessary to suit his trading personality and goal. The parameters and their default settings are given and explained below:
- Lots = 0.01 – Each trade is taken at a lot size of 0.01.
- TrailingStop = 40 – Trailing stop is supported and is triggered when a trade gains 40 pips.
- Stop_Loss = 20 – The initial stop loss of each trade is 20 pips.
- MagicNumber = 2345 – This magic number is attached to each trade upon entry to make way for trade management thereafter.
- Take_Profit = 50 – The fixed take profit target of every trade is 50 pips.
- FastMA = 6 – This is the period of the fast-moving average indicator used in this trading system.
- SlowMA = 85 – This is the period of the slow-moving average used in this expert advisor.
- Mom_Sell = 0.3 – If any of the previous three candles has a momentum value that is less than 0.3, a sell signal is confirmed for entry.
- Mom_Buy = 0.3 – If any of the previous three bars has a momentum value that is less than 0.3, a buy signal is verified for entry.
- UseEquityStop = true – With this setting enabled, open trades will be closed immediately if the account drawdown reaches a certain threshold.
- TotalEquityRisk = 1.0 – If the current drawdown reaches one percent of the account balance, all open trades will be closed right away in loss to protect the trading capital.
- Max_Trades = 10 – This is the greatest number of trades that the robot can open in the current symbol.
As a trend-trading system, the robot makes use of moving averages to define the trend. To avoid entering trades at the end of a trend, the momentum indicator is used as filter. Exactly how these indicators are used to find a trade signal and validate the entry is discussed in detail below:
- Moving averages (periods 5 and 200, linear weighted, typical price) – Moving average values (period 5 and 200) are computed for the current open candle of the current symbol and next higher period to determine the trade bias. A bullish bias is generated if the 5 LWMA is greater than the 200 LWMA, the low price of the previous candle for the next higher period is below the fast LWMA, and the open price of the previous candle for the next higher period is above the fast LWMA. A bearish bias is obtained if the fast LWMA is less than the slow LWMA, high price of the previous candle for the next higher period is above the fast LWMA, and open price of the previous candle for the next higher period is below the fast LWMA.
- Moving averages (periods 6 and 85, linear weighted, typical price) – Another set of linear weighted moving averages is being used to confirm the trend direction. This time the moving averages are applied to the next lower timeframe, and the values are obtained from the current open candle. If the 6 LWMA is above the 85 LWMA, an uptrend is indicated. If the 6 LWMA is below the 85 LWMA, a downtrend is defined.
- Momentum (period 14, price close) – The momentum indicator is used to filter trade signals by measuring the trend strength. The indicator is applied on the next higher chart and computed for the previous three candles. If any of the three values is less than 0.3, a trade signal is confirmed.
Once a trade entry is defined and confirmed, the robot opens a trade with a fixed lot size of 0.01 unless the user enables dynamic lot sizing. Upon entry, the trade is assigned a stop loss of 20 pips and a take profit of 50 pips. Without stop trailing, the reward-risk ratio should have been greater than two. As long as the entry rules are satisfied and there are less than 10 trades on the current symbol, the robot will keep adding trades (one on each candle).
The Pull Back Expert Advisor – Exit Criteria
The Pull Back Expert Advisor uses the trailing function in managing trades in addition to the initial stop loss and take profit limits. This function kicks in whenever a trade is profitable and has gained at least 40 pips, at which point the stop loss is shifted to the entry price to make the trade risk free. Further gains will lead to continual adjustment until price hits the take profit target at 50 pips or turns around and touches the new stop loss limit. Both scenarios would lead to positive results.
The Pull Back Expert Advisor – Room for Improvement
The first run of the Pull Back Expert Advisor in testing was negative. Despite the use of the trailing function, the win rate was low (only 29 percent), which could be the main reason for the poor performance. The positive aspect of the result was the huge amount of trades taken (672) and the small drawdown (2.75 percent).
While the expert advisor lost money in testing, the loss amount was just small. The performance might improve under different conditions. One possible way to enhance the performance is reducing the total amount of trades (current setting is 10). Along with this, the currency pair being traded can be a factor as well. Therefore, the user must use pairs that have trending tendencies. While markets change behavior over time, the markets that tend to trend these days include the major NZD, EUR and CAD pairs.
If the option to allow multiple trades is retained, the code should be reviewed regardless. At present, it appears the spacing between trades is erratic. Trades can be found lumped together in a tight price range, leading to huge number of losses. If this adjustment is done, a constant spacing can be used or better yet the space between trades is incremented at regular intervals.