Momentum Capture EA
Before you buy this EA, please be aware that:
1) Past performance is no guarantee of future profitability (the EA could also make losses).
2) The backtests shown (e.g. in screenshots) are highly optimized to find the best parameters but therefore do not give a realistic prediction of future profitability.
The EA tries to detect the start of a new trend after bank events and speeches. It has multi-currency and multi-timeframe capabilities.
After detecting strong price action and momentum, it will open positions in trend direction as well as pending orders for a possible reversal. The EA does not use martingale or grid.
For each timeframe there can be one open order. So you can adjust risk by not choosing all four timeframes.
In general, all combinations of USD, EUR, GBP, CAD, AUD are tradable. For CHF I only recommend the pairs USDCHF and EURCHF.
Personally, I use the following symbols:
EURUSD,EURJPY,EURAUD,EURCAD,GBPUSD,USDCAD,USDCHF,GBPJPY,AUDJPY,USDJPY,AUDUSD,EURGBP,EURCHF and CADJPY.
The EA only needs to be placed on one chart on any timeframe. The best one is EURUSD because it has the most ticks.
Web requests have to be allowed for the EA to get news data from my server. Go to: Tools -> Options -> Expert Advisors and add the following addresses:
http://fxdata.cc and http://backup.fxdata.cc
The minimum balance depends on the number of symbols and on the maximum position settings. I recommend $1600-$2000 with maxStop/maxMarketOrdersAllSymbols=16.
Please contact me if there are problems with backtesting or if you need assistance in live trading.
For backtests, it is very important to use news data and the correct GMT offset. The EA does not trade in the minute after news, so the news data is not used for unrealistic news trading. But it is important to determine whether the movement is fundamentally driven. News data from 2010-2017 is already included in the EA file, but for future data you have to download a data file.
Please see this blog post for instructions, detailed backtests and a list of the complete settings: https://www.mql5.com/en/blogs/post/704849
- IMPORTANT: every symbol should only be added to 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.
- 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).
- maxStop/maxMarketOrdersAllSymbols - To limit the total number of open market and pending stop orders for all symbols.
- pipInPoints - for 5-digit brokers, this should be 10, for 4-digit brokers 1.
- usePipsScaledToADR - if true the pip value will be scaled to the average daily range, so 40 pips could then mean something between 20 and 80 normal pips.
- useAutoEntryAndExitSettings - whether to use the internally stored entry and exit settings.
- waitTimeAfterNews - how long to wait after a news event.
- momentumStrengthMarket/Pending: Trend strength for entry.
- stopLoss - maximum stop loss used.
- takeProfit - take profit for trade exit. Usually the strategy will exit via trailing stop.
- trailingStop - trailing stop in pips.
- trailingStart - when to start the trailing stop.
- trailingStep - step size to modify the stop loss.
- Removed EUR from the currency list where CPI releases are traded because usually the results for each country are already published, so the combined EU value is usually not big news.
- Fixed a bug where useCustomEventsFile was not working correctly.
- Removed parameter testerIgnoreCurrency and ignore currencies will be read from symbol lists similar to live trading. For example, if you now want to test AUDUSD without USD events, AUDUSD would have to be in symbolsIgnoreUSDevents list like it is with default settings.
useCustomEventsFile - whether to use the custom file. Then ONLY the events in the file will be used and no other data from the server. Every event in the file will be used without additional filters.
customEventFile - The name of the file you want the EA to read. It should be placed in the common file directory (...\MetaQuotes\Terminal\Common\Files) and should have the following format "date time, currency, name", so for example like this (date format should be exactly like in this example!):
2018.05.02 18:00, USD, Rate Decision
- Added the liveGMToffset parameter for those who want to set the GMT offset manually. Keep in mind that on most brokers the GMT offset will change twice a year because of daylight saving time.
- Added the option to define additional events that will only be used by Momentum Capture (but not by other strategies like NightWalker EA).
- Disabled reversal trades for four symbols that had mixed results: EURGBP, CADJPY, GBPCAD and GBPAUD.
1) To calculate GMT offset, it will use MetaTrader 4 GMT time which depends on local PC time.
2) It will use MetaTrader 4 broker time for minutes and seconds (because local PC time could be off by a few seconds or more).
3) At the start, it will check once with my server whether the MetaTrader 4 GMT time is correct. If it is not, an alert message will be shown and you should re-sync your local PC time. A difference of a few seconds or even minutes would not matter because of 2).
Also, some of the entry parameters were changed slightly.
- Added auto settings for symbols GBPCAD and GBPAUD, but only without GBP events because we already have 4 GBP symbols. Now we also have full exposure (4 symbols) on CAD and AUD. But default settings will not have GBPAUD because I am sleeping during those events and only want 3 symbols active. Have a look at your spreads before using those as spreads can be very large on some brokers for GBP crosses!
- Added equityHardStop parameter: The EA will close all trades and not open new ones if the equity falls below that level (given in account currency).
- Now you can use auto settings, but at the same time change some of the settings. For example, if you want auto settings but only change smaller trailing stop and take profit, you can now set parameters trailingStop and TakeProfit to the value you want to use. But all symbols will then use the same value! If the value is 0 (new default), auto settings will be used.
Note that due to ADR scaling the values might not be exactly the value you set in normal pips.
- ADR calculation was changed to have a better consistency between accounts. It is now calculated only from H1 bars, not D1 bars. Therefore, it does not matter if the broker has 5 or 6 daily bars.
From this version on it is best to backtest the EA on H1 timeframe to make sure that the data is available.
- There are now two spread parameters to allow for a bit larger spread on symbols with a larger average spread:
maxSpreadPips: If the spread is below this value (in pips) the trade will be allowed.
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).
- Added a parameter allowHedge. If set to false, it will only allow sells when no buys are open and will only allow sellstops below the lowest buy stop loss and the other way around. If set to false then running one (!) timeframe should be FIFO compliant, but not running multiple timeframes because multiple trailing stops with FIFO are a pain to adjust so I have not done it. But if you want to use this EA on accounts with FIFO restriction, you could run each timeframe on a separate chart.
USDCAD and CADJPY will now wait 5 minutes instead of only 1 before checking for possible entries.
- Corrected a small bug concerning CPI news times.
- Added a new parameter "debugMode":
If true the EA will print some debug information when it checks for trade entries. So if you observe that you have different trades than my signals or the backtests, you can send me the log file and I will analyze the reason for the differences.
- closeOnlyMode: if you do not want to open new positions or afraid that your VPS might crash, you could run it with closeOnlyMode on a second VPS.
- maxSpreadPips: avoid trading during extremely high spread.
- closePendingOrdersInSameDirection: close pending buy orders if there is a signal for a market buy order, same for sell orders.
- autoAllowCPIonSomeSymbols: auto settings allow trading CPI events on those pairs: EURUSD, EURAUD, GBPUSD and AUDUSD.
- 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.
baseComment - to customize the comment.
smallerBreakEvenAndTrailingStop - this will reduce the break even, trailing stop and take profit of all auto settings (only if useAutoEntryAndExitSettings=true). It has a lower historic profit factor, but it is better at unclear events where the price reverses after a short burst.
useNewsFilter - You can set this to false if you want to manually enable the EA at an event that is not shown in the economic calendar.
Also I added a call to a backup server for news data in case the default server is down for some reason. You have to add both of the following addresses to allow web requests:
Right now the backup server is still empty, but will be created during the next week.
- TesterGMToffset now also changes the fridayCloseHourGMT as it should.
- The auto settings were optimized using Dukascopy data with 6 bars per week (a small bar on Sunday), so ADR and settings depending on it might be different on a broker with only 5 bars.
The EA will now detect whether the broker does not have Sunday bars and apply a small correction to the settings.
- News data is now included in the ex4 file. So backtest is possible from 2010 to 2017 without additional data file. But the file will be needed for future data.
- There is now a variable to use automatic settings for the default symbols (useAutoEntryAndExitSettings=true). Only entry and exit settings will be automatic, time settings etc. will still apply. The symbols have to be in a format like EURUSD, EURUSD.lmx, eurusd.spa, but symbols with delimiter like EUR/USD or eur-usd will not work (never seen those at any broker so far, contact me if you have special symbols).
- Some of the parameters are now available for customers to do their own optimizations:
waitTimeAfterNews: how long to wait after the news event time.
momentumStrengthMarket: strength of the movement.
momentumStrengthPending: strength of the movement for pending orders in the opposite direction.
maxStopOrderDistance: maximum distance of pending orders.
expirationHours: expiration hour of pending orders.
maxAllowedMovement: Max allowed movement to open positions. To avoid trading on crazy situations like the CHF spike on 2015.01.15.
closeAllPositionsOnFriday: this will reduce risk over weekend with almost the same historic performance.
tradeAfterGDP: to trade after GDP data (for historic test, not recommended to use it)
tradeAfterCPI: to trade afer CPI data
tradeAfterNFP: to trade after NFP