GerFX Momentum Capture EA

1 July 2020, 15:02
Exler Consulting GmbH
0
1 522

Important note:  On some of the symbols there might be missing H1 bars as MT4 only loads bar data on demand. H1 bars are required for internal calculations. To force MT4 to load the bar data it is best to open H1 charts for every symbol you want to trade before you use this EA for the first time on a newly installed MT4 platform. 

Also, I would remove all symbols that you don't trade from the Market Watch to reduce the overall data demand. 

Addionally, make sure that your VPS has the correct time, else it might lead to MT4 showing the wrong GMT time. Just check with some economic calendar if the next news event that is showing on the chart has the correct GMT time. 

What settings are used for the signal accounts?


Since May 2018 I am using the default settings on my main account. So just attach the EA to any chart (I use EURUSD H1) and only adjust lot size for your desired risk. For additional protection you could also adjust the equityHardStop. 

The selected symbols signal only uses the pairs that showed the best backtests results. The set file is attached to this blog

I am using 0.01 lots per 2000 EUR balance. I can not set the risk for you, please consider yourself what risk you are willing to take and whether a leverage up to 10 is ok with you. Else please use a higher equityPerStep value (I would use less risk on bigger accounts personally, but it is your decision). Backtests for default settings can be downloaded here.

It might happen in rare cases after a strong reversal move that there will be a signal for a market order while also a pending order is open from the initial movement. In those cases with maxMarketOrdersAllSymbols=16 and maxStopOrdersAllSymbols=16 it could in in theory lead to up to 32 open positions even though it would be very unlikely that this happens on all symbols and time frames at the same time. The parameter closePendingOrdersInSameDirection=true can be used to prevent such behavior if one wants to follow strict risk rules.


Complete Parameter List

  #------------------------------ General Trade Settings ------------------------------#

  • IMPORTANT: every symbol should be added to only ONE of the four symbol lists else it might be traded twice!
  • symbolsNormal - comma separated list of symbols to trade with events from both currencies. 
  • symbolsIgnoreUSDevents - These symbols will also be traded but not on USD events. 
  • symbolsIgnoreEURevents  - These symbols will also be traded but not on EUR events. 
  • symbolsIgnoreJPYevents - These symbols will also be traded but not on JPY events. 
  • symbolsIgnoreGBPevents - These symbols will also be traded but not on GBP events. 
  • closeOnlyMode - If you don't want to open new positions. Or if you are afraid that your VPS might crash, you could run it with closeOnlyMode on a second VPS. 
  • tradeM5 - whether to use the M5 timeframe.
  • magicM5 - magic number for trades entered on M5 timeframe signals.
  • tradeM15 - whether to use the M15 timeframe.
  • magicM15 - magic number for trades entered on M15 timeframe signals.
  • tradeM30 - whether to use the M30 timeframe.
  • magicM30 - magic number for trades entered on M30 timeframe signals.
  • tradeH1 - whether to use the H1 timeframe.
  • magicH1 - magic number for trades entered on H1 timeframe signals.
  • lotType - "fixed" or "increasing", where the lot size is calculated automatically.
  • fixLots - fixed lot size in case lotType = fixed.
  • lotStep - how much the lot size should be increased every equityPerStep (if lotType = increasing).
  • equityPerStep - how much equity is needed for one lot step (if lotType = increasing).
  • equityHardStop - if the equity falls below this value (in account currency) the EA will close open positions (only of this strategy) and will not open any new positions. 
  • maxMarketOrdersAllSymbols - in case you want to limit the total number of open orders.
  • maxStopOrdersAllSymbols - this will limit the number of stop orders for reversal signals.
  • pipInPoints - for 5-digit brokers, this should be 10, for 4-digit brokers 1.
  • debugMode - if true the EA will print some debug information when it checks for trade entries. So if you observe that you have trades different from my signals or the backtests, you can send me the log file and I will try to find out what caused the differences. 
  • allowHedge - If false it will only allow sells when not buys are open and will only allow sellstops below the lowest buy stop loss and the other way around. If set to true then running one time frame should be FIFO complient, but not running multiple time frames!
  • closePendingOrdersInSameDirection - If true, it will close any pending buy orders on the same symbol and time frame if there is a signal for a market buy order, same for sell orders. If false, it could sometimes lead to more than 4 open positions on one symbol. 
  • baseComment - to customize the comment.

  • #------------------------------ Auto Settings ------------------------------#

  • autoScaleFactor - This parameter is for a quick way of diversification. It will scale SL, TP, BE, trailing start, trailing stop by the factor specified. It will also scale the entry strength parameters, but not as much because those are more sensitive. For example, instead of running one set with 0.03 lots, you could run 3 sets with 0.01 lots and scale factors 0.9, 1.0 and 1.1. This way your entries and exits will be slightly different on each set.  

  • #------------------------------ Entry Settings ------------------------------#

  • slippagePoints - maximum allowed slippage in points (not pips).
  • maxSpreadPips - If the spread is below this value (in pips) the entry will be allowed (old pending orders will stay active and not be closed on high spread). 
  • maxSpreadRelativeToAverage - If the spread is smaller than the average spread multiplied with this factor, the trade will be allowed even if the spread is larger than maxSpreadPips (but not if it is larger than 2*maxSpreadPips). 
  • maxAllowedMovement - maximum allowed movement. With this setting we avoid trading on crazy breakouts like the CHF spike on 2015.01.15. 

  • #------------------------------ Time Settings ------------------------------#

  • liveGMToffset - In case you want to set the GMT offset manually yourself. Keep in mind that on most brokers the GMT offset will change twice a year because of daylight saving time. 
  • minUpdateTimeMillis - in case there was no tick for some time (given in milliseconds), you can set an independent update interval.
  • minTradeIntervalMinutes - Minimum time between new orders on the same symbol and time frame. 
  • startHourGMT - when to start trading (GMT).
  • endHourGMT - when to stop trading (GMT).
  • fridayEndHourGMT - when to stop trading (GMT) on Fridays.
  • closeAllPositionsOnFriday - whether to close positions before weekend. 
  • fridayCloseHourGMT - When to close in case closeAllPositionsOnFriday=true. 
  • skipWeekend - whether to skip Saturday and Sunday. 

    #------------------------------ News Filter ------------------------------#

  • useNewsFilter - If false, it will trade all the time and not look for news. It is not recommended as the settings are much too aggressive to be profitable all the time. But you can set it to false if you want to manually enable the EA at an even that is not shown in the economic calendar.

  • With the following parameters you can decide, which events to trade. I recommend only central bank events and speeches. 

  • tradeAfterCentralBankEvents = true
  • tradeAfterSpeechesAndTestimonies = true
  • tradeAfterCPI = false
  • tradeAfterGDP = false
  • tradeAfterNFP = false


Backtest with news data and correct GMT offset


IMPORTANT: For backtesting H1 time frame should be used. The MT4 backtester might not load enough days before start. In Tick Data Suite set "Bars before data:" (advanced tab) to a high value. For H1 for example to 2000. 

Follow these steps to do a backtest with news filter from historic news events. 

  • Make sure you know the GMT offset of the historic chart data you got in your MT4 terminal. Best would be to download it from Dukascopy in GMT fromat. If you don't have GMT format, set the TesterGMToffset to the correct value. If you are not sure, best look at the latests big news, which caused a breakout on the chart and check the time with any economic calendar in GMT format, for example at  https://www.forexfactory.com/calendar.php .
  • Download the historic news event file from my website (backtest will also work without that file but only until the date of the last update): 
          http://fxdata.cc/static/historic_news_events.dat
  • Open MT4, go to File -> Open Data Folder. Then copy the file historic_news_events.dat into the common files directory  (not the tester directory). It depends on your user name and is usually in:

    C:\Users\YOUR_USER_NAME\AppData\Roaming\MetaQuotes\Terminal\Common\Files

  • Run the backtest and check in visual mode whether the next events are printed in the lower left corner of the chart. In the journal it should als print "Reading from file...". 


Backtest results with tick data and slippage simulation (version 2.4)


The chart below shows the historic backtest for the complete recommended portfolio for a fixed lot size and a period of more than 8 years. Real Dukascopy tick data was used with variable spread, commission of 5 USD and an execution delay of 150 ms to simulate slippage. The individual backtests can be downloaded as a zip-file at the end of this blog post. 

To limit the maximum amount of open positions not every EUR symbols is used for EUR events. So we have a maximum of 4 pairs for each currency event. This way there should not be more than 16 positions open at the same time. There fore the backtest is valid for a start balance of about $1600 to $2000 depending on the risk. 





Share it with friends: