
Swap and Overnight Financing: The Real Cost of Holding EA Positions Across Sessions
An Expert Advisor that closes every position before the end of the trading day may never think about swap. An EA that holds positions overnight pays for the privilege — or occasionally gets paid. Swap, also called overnight financing or rollover cost, is a genuine expense line in automated trading, and it is one of the easiest costs to overlook when a strategy is judged on a backtest. This article explains what swap is, how it is calculated, and how to estimate its effect on an EA before you run it live.
What a swap is and when it is charged
Swap is an interest charge or credit applied to positions that remain open past the daily rollover. Rollover is the moment the broker’s trading day ends and a new one begins — a scheduled event in the platform’s server time, defined by the trading session rather than by any particular hour in the reader’s own timezone. Any position still open at that point is carried into the next session, and a charge for that carry, the swap, is applied to the account.
Swap is not a fee the trader accepts trade by trade; it is applied automatically by the broker to open positions, typically once per day at rollover. Whether holding is charged or credited depends on the pair, the direction of the position and the broker’s own rates. Swap sits alongside the spread and commission, which our guide to spread, commission and swaps covers together — it is simply the one that only applies overnight.
How swap rates are calculated
Swap rates derive from the interest rate differential between the two currencies in a pair, adjusted by the broker’s mark-up and expressed as swap points per lot per night. For the trader the practical question is simpler: which number appears on the contract specification, and in which direction does it run.
MetaTrader exposes the underlying fields. The MQL5 symbol properties reference defines SYMBOL_SWAP_LONG, SYMBOL_SWAP_SHORT and the swap calculation modes, which is how a programmer can read, and an EA can calculate, the charge rather than guessing from the terminal display. For the everyday user the same values appear in the platform itself: the contract specification for each symbol shows the long and short swap in points, and the charges land in the account currency. Swap on CFDs over indices, metals and other instruments follows the same pattern but is usually stated in the instrument’s own units, so the conversion step belongs to each instrument rather than being done once for the whole account.
Why one night of the week carries triple swap
Most foreign exchange positions settle two business days after the trade date, so carrying a position across the midweek rollover also carries the position across the weekend for settlement purposes. The result is that one night each week stands in for three nights, and the swap applied that night is three times the normal amount.
For most FX pairs the triple rollover lands at the Wednesday-to-Thursday boundary, but it is not safe to assume a single schedule for every instrument or every broker, because exchange-traded and other instruments can follow different conventions. The reliable way to know which night is triple for your instrument is to watch the terminal: once a week, the swap line at rollover is three times its usual value. The useful habit is to check the triple night for each instrument you actually hold and to log it, because a strategy holding several instruments will be charged on different nights unless they share the same rollover convention. A single-schedule assumption is where swap surprises come from. Rollover conventions are one of the details worth checking against a broker’s specification before you compare brokers for automated trading.
How swaps affect different EA strategies
An EA that opens and closes within the session, whether it trades five times a day or fifty, may never hold through rollover and may never pay swap. Swing and position strategies that hold trades for days feel the cost directly, and it accumulates with every night of holding. Grid and averaging strategies are particularly exposed, because their nature is to hold losing positions longer than winning ones — exactly the situation in which swap costs accrue. How long an EA holds positions is a property worth knowing before you choose one from our best Expert Advisors list.
Swap can also run in the trader’s favour when the rate is positive on the direction held. The point is not that swap is good or bad; it is that the cost line needs to be known and counted, like any other cost.
Estimating the swap drag on a strategy before you run it
Estimate first, deploy second. Read each instrument’s swap from the terminal’s contract specification, convert it to account currency, then multiply by the number of nights the strategy is likely to hold per trade and by the number of trades per month. Add the result to the per-trade cost you already count for spread and commission. Swap rates also differ by broker model, which our guide to ECN versus market maker brokers explains.
For a strategy tested on historical data, treat swap as an extra cost layer on top of the backtest result, and remember that rates move with interest-rate conditions. The illustrative table below shows how the arithmetic sits together for three example holdings.
FAQs
Do all brokers charge the same swap on the same pair?
No. Each broker sets its own rates from its own funding costs and mark-up, so the same pair can carry different swap at different brokers. Check the contract specification on the account you actually use.
Can a swap be positive?
Yes. When the interest rate differential works in the direction you hold, the overnight credit can be positive and the broker credits the account. It is still a rate set by the broker, not a fixed return.
What is a swap-free account and does it suit EAs?
A swap-free account is an account on which no overnight charge is applied. Whether it suits an EA depends on why it exists and on the terms attached to it; check the conditions before assuming it is cost-neutral.
Does the MetaTrader strategy tester include swaps?
The tester models swap from the symbol properties and calculation mode in use, so a backtest that holds positions overnight includes a swap line. The values in the tester are the ones present at test time, and those change, so treat the tester output as an estimate rather than a promise for live results.
Trading foreign exchange and CFDs on margin carries a high level of risk and may not be suitable for all investors. This article is for educational purposes only and does not constitute financial advice.

