Risk management
Weekend Gaps, Rollover and Swap for Expert Advisors: What Happens to Open Trades and How to Protect Them
By Benjamin Lee · Updated · 6 min read
Two moments in the trading week quietly cost Expert Advisor traders more than they expect: the daily rollover, when spreads widen and swap is charged, and the weekend, when the market closes with your positions still open. Neither is rare, and a backtest on clean data can hide both. This guide explains what happens at each, why a stop loss does not fully protect you over a weekend, how swap is calculated and when it is tripled, and the settings that let an EA close, pause or size down before these moments.
Key takeaways
- At the daily rollover, spreads often widen sharply and swap is applied to positions held overnight.
- Over a weekend, price can reopen far from Friday's close. A stop loss then fills at the new price, not yours.
- Swap can be positive or negative and is often tripled on one day of the week; check your broker's table.
- A weekend close option on the EA, or a Friday cutoff, removes gap risk at the cost of some trades.
- Check broker server time, because rollover and the Friday cutoff are set in it.
The daily rollover
Rollover is the moment the trading day changes at your broker. For many MT5 brokers it falls at the New York close, which is around late evening in Central European Time. Two things happen. Swap, the interest cost or credit of holding a position overnight, is applied to every open trade. And liquidity thins, because banks and dealers are between sessions, so spreads often widen, sometimes by several times, for a short window.
For an EA that opens trades at any hour, rollover is a trap. A scalper with a one pip target that enters during the widest spread pays a large share of the target in cost, and a stop placed close to the market can be hit by the spread alone. Most well-built EAs include a rollover filter that blocks new trades for a window around the change of day. In the default setfile of one grid EA we reviewed, that window runs from 23:45 to 00:15 server time, which is typical of the idea.
Swap: the cost of holding overnight
Swap depends on the interest rate difference between the two currencies of a pair, adjusted by the broker, and it differs for long and short positions. Depending on the pair and direction it can be a charge or a credit. For gold and indices it is a financing cost built into the price. Brokers publish the values in the symbol specification, and many charge triple swap on one weekday to cover the weekend. For most forex pairs that day is Wednesday, but it varies by instrument, so look at your broker's table.
| Item | Value |
|---|---|
| Position | 1.00 lot long EURUSD |
| Swap for the night (illustrative) | minus 6 dollars |
| Triple swap day | minus 18 dollars |
| Swap over a 10-night hold | about minus 78 dollars, roughly 68 euros at 1.15 |
| Typical profit target for a swing EA | a few hundred dollars |
For a short-term EA swap is small. For one that holds trades for days or weeks, it can erase a meaningful part of the edge, and it should be in the backtest. The tester charges swap using the symbol's values. Check the specification and make sure the test period used values similar to today's, because swap changes with interest rates. See spread, slippage and swap.
Weekend gaps
Forex and gold markets close on Friday evening and reopen on Sunday evening, European time. News and events do not stop over the weekend: elections, geopolitical events, central bank surprises and company news can all happen while the market is shut. When it reopens, the first price can be far from Friday's close. That is a gap. Price jumps over everything in between, so a stop loss does not execute at its level. It fills at the first available price after the reopening, which can be much worse.
A worked example in euros. An EA holds a 0.10 lot long on gold, 10 ounces, with a stop 8 dollars below the market. That is an 80 dollar planned loss, about 70 euros. A weekend event pushes gold 30 dollars lower at the open. The stop fills 30 dollars away, a loss of 300 dollars, about 260 euros, nearly four times the plan. On a 1,000 euro account that is 26 percent in one gap. The gold lot size calculator shows the sum for your numbers.
Settings that protect against both
| Setting | What it does | Trade-off |
|---|---|---|
| Rollover filter | Blocks new trades around the change of day | Skips a short window, which is usually cheap to lose |
| Maximum spread | Blocks entries when the spread is too wide | Reduces trade count in thin markets |
| Friday cutoff | Stops new trades some hours before the weekend | Misses late-week moves |
| Close before weekend | Closes all positions at a set time on Friday | Avoids gap risk but ends multi-day trades |
| Reduced size on Friday | Cuts lot size late in the week | Smaller gains, smaller gap loss |
| Swap awareness | Avoids or closes trades that carry heavy negative swap | Alters the strategy's holding time |
| Triple swap day rule | Closes or avoids holding over the triple swap night | Fewer held trades |
All times in these settings are in broker server time, which is often two or three hours ahead of UTC with the daylight saving rules of the broker. Convert from your own time zone and re-check after clock changes, as covered in the gold EA settings guide. If the EA has no weekend setting, close positions by hand before the market shuts, or switch the EA to a mode that stops new entries on Friday.
Step 1: Read the symbol specification
Note the swap long and short values and the triple swap day. Compare with the EA's typical holding time.
Step 2: Find your broker's rollover time
Watch the spread in Market Watch around the change of day for a few evenings.
Step 3: Set the rollover and Friday inputs
Use the EA's filters, in server time, to cover the window.
Step 4: Decide your weekend policy
Close everything, reduce, or hold with a size that survives a gap.
Step 5: Test with swap and gaps in mind
Look at the backtest for trades held over weekends and see the biggest loss from a gap.
For news-driven moves see gold and news, and for the whole routine the MT5 Expert Advisors guide.
Sources and further reading
- MetaTrader 5 Help: Basic Principles of Trading OperationsOrders, deals and positions, and how netting and hedging accounts differ.
- MetaTrader 5 Help: Strategy TestingThe Strategy Tester: testing modes, settings and forward testing.
- MetaTrader 5 Help: Testing ReportWhat each figure in the tester's report means, including drawdown.
Frequently asked questions
What happens to my EA's trades over the weekend?
Open positions stay open while the market is closed. If price reopens far from Friday's close, a stop loss fills at the first available price, which can be well beyond the stop.
Should I close EA trades before the weekend?
It removes gap risk but ends multi-day trades. Many traders close or reduce on Friday for gold and volatile pairs. Decide by rule, and size positions to survive a gap if you hold.
What is triple swap?
A swap charge or credit applied three times on one weekday to cover the weekend. For most forex pairs it is Wednesday, but it varies by instrument, so check your broker's specification.
Why do spreads widen at rollover?
Liquidity is thin between trading sessions, so dealers quote wider spreads for a short time. An EA without a rollover or spread filter can open trades at the worst moment.
Does the backtest include swap and gaps?
The tester applies swap from the symbol's values and replays past gaps in the data. It cannot predict future gaps, and swap values change over time, so check both.
Expert Advisors in these styles
Apply the checks above to any of these before you buy: read the manual, run your own backtest, and start on demo.
Keep reading
- Gold EAsXAUUSD EA Settings: Lot Size, Stop Loss, Spread, HoursWhat each XAUUSD Expert Advisor input does and how to size it: lot size, stop loss, spread filter, slippage, trading hours and magic number, with euro examples.
- Gold EAsGold EA and News: Trading Around NFP, CPI and FOMCHow gold reacts to NFP, CPI, FOMC and ECB news, what it does to spread and stops, and three ways to run an XAUUSD Expert Advisor around releases safely.
- Pillar guideMT5 Expert Advisors: The Complete Guide for BeginnersEverything about MetaTrader 5 Expert Advisors in one place: how they work, strategy types, risk, backtesting, buying safely, gold, EURUSD, prop firms and Europe.
- Forex EAsEURUSD EA for MT5: Settings, Sessions and SpreadHow to run an Expert Advisor on EURUSD in MT5: best sessions, spread and news filters, pip value in euros, swap, server time and a safe testing plan.


