Short answer: Reconcile from the tester’s log, not from the swap figure in your hand calculation — and be ready for the log to rule out your first suspect. In this recorded case, the tester charged $98.71 of swap, which is less than the $104.55 in the trader’s calculation, so swap cannot explain why the reported loss was bigger. The thread’s moderator recomputed the price leg at $49.58 instead of $52.50 — and even with both corrections, $27.19 of the $175.48 loss is left unexplained, which is where the thread ends. What follows is what the log proves, what it rules out, and the experiments that isolate the rest.
The case, from the EarnForex forum thread “Where is my calculation mistake? Backtesting loss does not match calculation” (November 2020): a USD/JPY short of 0.79 lots, backtested from 22 January to 6 February, closed at the stop loss. The trader took the daily swap as $6.15 and counted 17 swaps: 17 × $6.15 = $104.55 of swap, plus $52.50 of price loss, equals $157.05. The test reported a loss of $175.48 — $18.43 more.
What the log proves about the swap. The trader eventually printed the swap from inside the test, day by day. The cumulative swap grows by a constant $5.8066 on ordinary nights and by exactly three times that ($17.4197) in the entries dated 23 January, 30 January and 6 February — the mornings after the three Wednesdays in the window, Wednesday being the triple-swap day for this symbol. That is 8 single increments and 3 triple increments: 17 nights’ worth of swap, at a constant $5.8066 a night for the 0.79-lot position ($5.8066 × 17 ≈ $98.71). Two things follow. The tester did not use the trader’s $6.15 — a figure the trader notes came from a position size calculator, and an old version of it. And the swap it did charge is smaller than the hand calculation, so the missing $18.43 is not hiding in the swap. The thread’s moderator (Enivid) gives the structural reason a tester’s swap can differ from any figure you read elsewhere: in his words, the Strategy Tester “doesn’t use the latest swap value to calculate swaps during backtests but rather uses some unknown value” — a view stated in that thread, about that test.
What the moderator’s recomputation does to the price leg. He rebuilds it in the quote currency: an exit at 109.939 against an entry of 109.870 is 69 points; 69 × 0.79 lots × ¥100 per point = ¥5,451; converted at the exit rate, ¥5,451 / 109.939 = $49.58. One caution belongs with that number: the thread’s own materials disagree on the entry price — the test log records the position opening at 109.841, while the moderator’s calculation uses 109.870, where he took that entry price from is not stated in the thread. So $49.58 is the moderator’s recomputation on the prices he used, not a settled figure. In this case — a USD account and a yen pair — his method is to build the price leg in yen and convert once, at the end; a dollar figure produced directly by a calculator can carry its own error into the comparison. Other pairs and account currencies follow their own specification.
What remains unexplained. $98.71 of logged swap plus $49.58 of recomputed price loss is $148.29, against a reported loss of $175.48: a remainder of $27.19 that the thread does not resolve, and this article will not assign to a cause. The moderator’s proposed next step is the method for closing it: run short test trades that last exactly one night, on several different days, and read the swap the tester applies to each — that extracts the tester’s effective swap value directly instead of assuming it. The same isolate-one-variable approach applies to whatever is left after that: recheck the price leg from the test’s own recorded open and close prices (not a calculator’s), and only then look at the test’s remaining settings.
How to reconcile your own backtest, step by step:
– Print the position’s swap from inside the test, day by day. This log, not the specification and not a calculator, is the record of what the test charged.
– Count the nights’ worth of swap from the log: single increments plus two extra for each triple increment. The triple day is a symbol property (SYMBOL_SWAP_ROLLOVER3DAYS in MetaQuotes’ documentation; Wednesday for most forex pairs).
– Divide the total swap by the nights to get the test’s effective nightly rate for your position size. Compare it with the specification’s swap value for the symbol, converted the way that symbol’s swap mode requires (MetaQuotes’ book documents nine modes; in this case the trader’s $6.15 came from a calculator, not from any such conversion). If the two differ, the test’s value is the one inside your result.
– Recompute the price leg the way the moderator did in this case: in the quote currency (yen), from the test’s own recorded prices, converted once at the closing rate. That method is stated for this case’s setup — a USD account and USD/JPY; other instruments and account currencies follow their own specification.
– If a difference remains, isolate the tester’s swap value with one-night test trades, as above, before trusting the strategy’s totals.
In plain words: In this test, the swap was a constant nightly amount with Wednesdays tripled — and it was smaller than the trader assumed, not bigger. The loss gap survived both corrections anyone in the thread could make. The log, read first, tells you which of your inputs are actually wrong — and in this case it cleared the input everyone suspected first.
Sources: the case figures, the test log and the moderator’s analysis are from the EarnForex thread linked above (posted 21 November 2020; checked 5 December 2026). Swap modes and the triple-swap day property: MetaQuotes, MQL5 book — Getting swap sizes, checked 5 December 2026. Related on this site: designing a backtest that can actually falsify your idea, lowest spread forex broker, and our verification log.
Last updated: 5 December 2026

Leave a Reply