The daily rollover: why spreads widen at 17:00 New York
Once a day the forex market closes the trading day. For about an hour liquidity is thin, spreads widen, and positions held through it pay or earn a swap.
What happens at rollover
The forex day ends at 17:00 New York time. Banks in the US have closed, Asia has not opened yet, and many liquidity providers pause for a few minutes. Spreads on major pairs can go from a fraction of a pip to several pips, and on crosses and gold even more. A stop that sits close to the price can be hit by the spread alone.
Most brokers set their server clock so that this moment is midnight on the server: UTC+2 in winter and UTC+3 in summer.
Swaps
A position still open at rollover is charged or paid a swap: the interest difference between the two currencies, plus the broker's mark-up. On Wednesday night most brokers charge three days at once to cover the weekend.
Staying flat
FxBotLab closes its trades at 16:45 New York time and opens nothing until 18:05, and it closes everything before the weekend (FlatOverRollover). Its trades never pay a swap, and they are never caught in the rollover spread or a Monday gap. The setting ServerMinusNewYork tells the robot how far the broker clock is from New York; 7 hours is right for most brokers on UTC+2/UTC+3 time.
The cost is that trades open late in the day may be closed before they reach their target. For a robot trading 15-minute or 1-hour bars that is usually a fair trade; on daily bars you may prefer to switch the setting off.