No Martingale, no grid, no averaging. Fixed stop losses for every position.
Before you buy night scalpers please be aware of the risks involved:
1) Any mean reversion can get caught on the wrong side of a fast movements due to unexpected news or flash crashs. This strategy will always use a stop loss, but still execution of the SL depends on your broker.
2) Night scalpers are dependent on good brokerage conditions, like low spread and slippage, which might be worse on high lot sizes.
This is a multi symbol mean reversion system that trades during the end of NY session and start of Asian session. You only need one chart opened to trade all symbols.
Symbols: AUDCAD, AUDNZD, CHFJPY, EURAUD, EURCAD, EURCHF, EURNZD, GBPAUD, GBPCAD, GBPCHF, GBPUSD, NZDCAD, USDCAD, USDCHF, USDJPY
Time frame: M1
Minimum deposit: $300 - $1000 (smaller deposits will have higher percentage risk)
The default settings are stored within the EA. Please read the blog post for instructions on how to set up the EA.
- Best used with a broker that has low spreads during the night. Many brokers have extreme spreads around swap time. Contact me if you want to analyze the spread at night.
- To use the calendar news filter, please allow requests to:
http://breaking.fxdata.cc (only needed if you use the breaking news filter)
(Tools -> Options -> Expert Advisors -> Allow WebRequests for listed URL)
- Even with news filter, you should look for major events like elections and disable the EA during those nights.
Be aware that past performance is no guarantee of future profitability (the EA could also make losses) and that optimized backtest results cannot provide a realistic prediction of future profitability.
The EA saves 10 hours of bar data internally, so it is best to run it continuously on a VPS.
General Trade Settings
- symbols1/symbols2 - Two comma separated lists of symbols to trade. Suffix needs to be included if your broker uses one.
- orderComment - Comment for trades with this strategy.
- magic - Individual magic number for the strategy.
- 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 level, the EA will close positions of this strategy and will not open new positions.
- maxSpreadPips - If the spread is below this value the entry will be allowed (pending orders will not be closed on high spread).
- maxSpreadRelativeToAverage - If the spread is smaller than the average spread multiplied with this factor, trades are allowed even if the spread is larger than maxSpreadPips (but not if it is larger than 2*maxSpreadPips).
- maxPositionsAllSymbols - Maximum number of open position on all symbols.
- maxCurrencyPositions - Maximum positions per currency.
- pipInPoints - For 5-digit brokers 10, for 4-digit brokers 1.
- debugMode - If true, the EA will print some numbers into the log, which can be used to analyze the trades.
- liveGMToffset - To set GMT offset manually. Usually this is not needed.
- tradeFriday - Set to false if you don't want to have open positions over the weekend.
- tradeSunday - whether to trade on Sunday.
- minTradeIntervalMinutes - minimum time between opening of orders on the same symbol.
- waitAfterLossMinutes - After a loss the EA will wait the duration specified before looking for new entries.
- dontTradeTripleNegativeSwap - If true, the EA will not open trades on Wednesday before swapHourGMTwinter when the swap is negative (to avoid triple swap on Wednesday).
- swapHourGMTwinter - Swap hour (in winter) used if dontTradeWednesdayNegativeSwap=true.
For further parameters please see the list at the end of the blog post.
- Added a parameter stopLoss for those who want to define an own value or do some optimizations.
- Changed the DST tester settings. Now there is a parameter testerDataHasDST. Set it true if you want to backtest on data with DST, like GMT+2/+3 time zone.
- As a result of the flash crash on 2nd Jan, I added parameters stopDayDecember and startDayJanuary so that users can decide whether or not to pause trading during the low liquidity period around New Year.
- Added exitLossesOnStockMarketCrashTrigger parameter. Set it to true if you want the EA to close filled positions when the crash filter triggers. Default is false.
- Added startHourGMTwinter and endHourGMTwinter for those who want to change the trading hours or want to run own optimizations.
- All calculations that used daily bars are now using hourly bars to make it more consistent between brokers with different GMT offset.
- Fixed an issue with the GMT offset during the first minutes after market open in case the EA was initialized during the weekend.
- Other small improvements for the stock market crash filter.
- Added historic SP500 data starting from 2003 to the EA file and optimized the stock market crash filter from 2003-2018.
- Added a new parameter maxPercentageIncrease to prevent trading on days with an extreme increase in stock market during the last 8 hours (0 = auto settings for each pair).
stockIndexSymbol - Here you have to insert the symbol for the S&P500 index, which is used for this filter. The default is set for ICMarkets where it is called "US500", but it might be different on your broker. To disable this filter, set the parameter to an empty string.
maxPercentageDecline - In case you want to set your own value. If it is 0, auto settings will be used, which are different for each pair in the range of 1.1 to 2.4 percent.
The EA has historical SP500 data stored internally, so it will also work on backtest (until the date of the last update). You don't have to change the stockIndexSymbol for backtests.
- A parameter maxCurrencyPositionsFriday=2 was added to reduce the risk over the weekend.
- I removed EURGBP from the default settings. We already have 4 better GBP pairs. With maxCurrencyPositions=3 an additional pair will not increase the total profit much and EURGBP always had the worst backtest from all current pairs.
- Changed default settings to maxSpreadPips=5 and maxPositionsAllSymbols=6.
- Added symbols USDCAD, USDJPY and CHFJPY to default settings.
- Added a parameter liveGMToffset so that those who have problems with time zone settings of their VPS can chose GMT offset manually.
- The EA will now save the historic data in files in the directory \MQL4\Files\NightWalker_history and load from that data after initialization. This way the EA will not need to wait hours before being able to trade. So users can modify the settings or restart the VPS during the weekend and the EA will still be able to trade Sunday night.
Be aware that the EA will always load from that data as long as it is not older than 2 days (Monday or Tuesday 4 days are allowed) and the difference to the last close is less than 50 pips.
Therefore, if you disable the EA during the week for a longer period it might be best to delete the historic data.
- Slightly improved exit logic.
- The EA will now check entry/exit every new minute instead of every new bar, which might improve consistency between different price feeds.
- It is now possible for me to add additional events in the database that NightWalker will use in its news filter (but Momentum Capture will not). This way, I can disable a currency for one night if there is some non-calendar risk event.
- Trading hours for EURNZD changed by 1 hour.
- To calculate GMT offset it will use MetaTrader 4 GMT time which depends on local PC time.
- Use MetaTrader 4 broker time for minutes and seconds (because local PC time could be off by a few seconds or more).
- Check only once on connection to the broker's server whether the MetaTrader 4 GMT time is correct. If it is not correct, an alert message will be shown.
Also, the EA will now automatically add missing symbols to the market watch.
- The EA will no longer use TimeGMT() function which depends on local PC time, but will determine GMT offset itself. It will also adjust for DST in summer.
- The time of the next news event will show on the chart as a visal feedback that the news filter is working.
- Added better spread control:
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).
- Because slippage can be very important for night trading systems, the EA will now monitor slippage. It will display the average slippages for market orders, take profits and stop losses on the chart.
It will also save the slippage for each symbol into a separate file in directory /MQL4/files/NightWalker_slippage/ (only for live trading not for tester).
- Until now, the EA only used Bid price for internal candle calculation. Now it will use the "Mid price" (Bid+Ask)/2. I hope that this way it will be more consistent with backtest and between brokers because the spread wil have a smaller influence.
- It will now only open orders after at least 3 hours of being initialized. This way we avoid wrong positions in the first minutes when the EA has not yet gathered enough data on non-chart symbols.
- Added the debugMode parameter. If true it will print out some values for analysis. If you experience different positions compared to my signal, you can send me the log files to analyze the output.