Costs and the account
What a backtest charges (spread, slippage, commission, swap), broker presets, and the simulated account: currency, equity, margin and stop-out.
This page has two parts. The first is what a backtest charges: the spread, slippage, commission and swap. The second is the simulated account: its settings, currency conversion, balance and equity, margin, stop-out and lot sizes.
With no virtual symbol, an instrument trades on the raw feed: the recorded historical spread, the run's slippage setting, no commission and no swap. A virtual symbol — the app's name for your broker's cost profile for one instrument — attached to an instrument for one run adds commission and swap, and can change the spread, the slippage, the lot size, the price digits, the volume limits and the margin rules. Virtual symbols apply to backtests and optimizations only. Live trading always pays your broker's actual charges.
At a glance
| Cost | Raw feed (no virtual symbol) | With a virtual symbol |
|---|---|---|
| Spread | The recorded historical spread | Spread-session window, else a fixed override, else the recorded spread; then the broker's markup is added |
| Slippage | The run setting: points per fill, default 0 | The profile's per-instrument override, else the run setting |
| Commission | None | Per lot, flat per leg, or a percent of notional, on every leg |
| Swap | None | Charged per period at a rollover minute (UTC, or a time zone you choose), ×3 on a chosen weekday |
Spread
Where the spread comes from
- Tick-by-tick runs: every recorded tick has its own bid and ask, and the run quotes exactly those prices.
- Bar-by-bar (M1) runs: the ask is the bar's bid price plus the minute's average spread, the plain average of (ask − bid) over its ticks (how bars are built).
- The recorded spread is Dukascopy's, not your broker's. A raw-account preset assumes that your broker's raw spread equals Dukascopy's. A Standard-account preset adds the broker's measured markup on top of Dukascopy's spread.
Which side pays it
- A buy opens at the ask and closes at the bid. A sell opens at the bid and closes at the ask. Open positions are valued at the price they would close at: longs at the bid, shorts at the ask.
- In bar mode, a market order decided at a bar's close fills at the next bar's open. A buy fills at that open plus the next bar's spread, and a sell fills at that open.
- In bar mode, every check made on the ask side uses the bar's bid high or low plus the spread, and the fill is at the order's level; in tick mode every check uses each tick's own bid or ask, and the fill is at that tick's price (stops and targets). For the maximum drawdown, bar mode also values a short at the bar's high plus the spread (drawdown).
Changing the spread with a virtual symbol
The spread is resolved in this order:
- inside a spread-session window, that window's spread;
- otherwise, the fixed spread override;
- otherwise, the recorded spread.
Then the profile's markup is added to whichever value applied.
All spread values are in points. One point is the instrument's tick size, 10^-digits. The whole spread sits on the ask, and the bid is never moved.
In tick mode, an override or a session window replaces the recorded spread of each tick (ask = bid + spread). In bar mode it replaces the bar's average spread.
A spread-session window has a start minute and an end minute in UTC and one or more start days. It covers [start, end). A window whose end is earlier than its start runs past midnight and belongs to its start day. Windows may not overlap. Tick mode checks each tick's time against the windows. Bar mode checks the bar's open time, so the whole bar uses one spread.
Zero spread: a fixed override of 0 is allowed and makes ask = bid, plus any markup. A session window's spread must be above 0. Negative values are refused.
The markup applies even when there is no override. It widens the recorded spread, which is how a commission-free account is modelled.
Seeing the spread
- A strategy can read the spread it trades on with Market price → Spread. The value is ask − bid in price units, not points, and it includes the virtual symbol's spread. In bar mode it is the bar's spread.
- In a replay recorded with the run's cost model, the chart draws the ask the run traded, including the profile's spread and markup. Older recordings draw the recorded ask.
- The virtual-symbol editor's cost strip reads "Recorded" when the spread override is empty, plus the markup when you set one (spread figures).
Slippage
Slippage is a fixed number of points per fill, set per run (default 0) or per instrument by a virtual symbol, and it always goes against you, on every fill: limit entries and take profits included. The full rule is on Orders and fills → slippage.
Commission
Commission types
| Type | Charge on each leg (open or close) | Denominated in |
|---|---|---|
| None | 0 | none |
| Per lot | value × lots | the profile's commission currency |
| Flat per trade | value, whatever the size | the profile's commission currency |
| Percent of notional | value ÷ 100 × lots × contract size × fill price; the value is the percent itself (0.01 = 0.01 %) | the instrument's quote currency (the commission-currency setting is ignored) |
- The commission value must be 0 or more, and at most 100 for percent of notional.
How commission is charged
- Each leg pays. Commission is charged on the opening fill and again on the closing fill, each on that leg's volume and fill price after slippage. A per-lot value of 3.5 therefore costs 7.0 per lot for the round trip.
- Each leg is converted to the account currency at the time of its fill, at the bid of the conversion pair.
- The opening commission is not taken from the balance when the position opens. It is recorded on the position and charged, together with the closing commission, in the trade's profit when the position closes. The balance changes only then.
- While a position is open, its equity subtracts the opening commission already incurred. Equity, drawdown (the worst case inside a bar included), drawdown limits, free margin and the stop-out test therefore count it from the open; the closing commission counts only when the position closes.
- Partial close: the closed part pays its closing commission plus its proportional share of the opening commission, and the rest stays with the open part.
- Flat per trade is charged in full on every leg, so each partial close pays the full flat amount.
- Netting accounts: an opposite order closes the open fills oldest first. Each fill it closes appears as its own trade, but the close is one deal: its closing commission is computed once on the order's closed volume and shared among those trades by volume, so a flat fee is charged once per closing order. The rest of a reversing order opens a new fill that pays its own opening commission.
- The commission currency must convert to the account currency through one FX pair; otherwise the run is refused when you launch it.
- There is no minimum commission per trade.
Swap (rollover)
When swap is charged
- Swap is charged at the first step at or after the rollover minute of each period. In tick mode that step is the run's first tick at or after the minute; in bar mode it is the first one-minute bar whose open time is at or after it. Only open positions are charged; pending orders never are.
- The rollover minute is 0–1,439 minutes after midnight, and an empty value means 00:00. It is read in the virtual symbol's rollover time zone: UTC by default, where it stays the same UTC minute all year. With a zone it moves with that zone's daylight saving time: 17:00 New York, the time brokers roll positions over, falls at 22:00 UTC in winter and 21:00 UTC in summer; 00:00 in the New York close zone is the same instant (your strategy's clock). The editor offers UTC, New York and New York close. The rollover ignores the strategy's time zone.
- The period is daily (calendar day), weekly (ISO week, starting Monday) or monthly (calendar month), each counted from the rollover minute on the rollover zone's clock.
- A position that is open across the rollover pays the full period, however briefly it was open. A position opened at or after the rollover step first pays at the next rollover. Swap is never pro-rated.
- Gaps and weekends: the first step after a gap charges once, not once per missed period. Weekend financing is expected to come from the triple day.
- Triple day (daily swaps only): the charge is ×3 when the rollover step falls on the chosen weekday of the rollover zone (UTC by default). With an evening rollover such as 21:00 UTC, "Wednesday" fires on Wednesday evening, as on broker spec sheets. With a 00:00 rollover, the Wednesday-to-Thursday rollover happens on Thursday 00:00, so choose Thursday.
How much swap is charged
- In points (default): rate × tick size × lots × contract size, in the quote currency, then × the conversion rate at that step. Longs use the long rate and shorts the short rate. A positive rate is a credit and a negative rate is a cost.
- In percent per year (daily swaps only): rate ÷ 100 ÷ 360 × lots × contract size × the position's closing price at that step (bid for a long, ask for a short) × the conversion rate. The 360-day basis was confirmed by IC Markets support on 2026-09-16.
- "Lots" means the volume still open at that step.
- A direction whose rate is 0 is charged nothing, and no balance operation is listed for it.
- A virtual symbol's rates are the same for every day of the run. There is no history of swap rates, commissions or markups, so a preset applies the rates captured on its capture date to every year you backtest. A preset's swap is a percent per year, so its amount follows each day's price; the rate itself is the capture date's.
Where the swap is booked
Each virtual symbol chooses one of two modes:
- On the position (default): the swap builds up on the position in the account currency and shows in floating equity. It settles inside the trade's profit at the close. The trade's profit is net of swap, and its swap figure is the total.
- On the balance: each charge hits the balance at the rollover and is listed as a balance operation. The trade's profit excludes swap, and its swap figure is 0.
Further rules:
- Partial close: the closed part settles its proportional share of the swap built up so far.
- Netting accounts: each fill has its own rollover clock, so a fill added after a rollover is first charged at the next one. In balance mode there is one balance operation per position per rollover.
- What swap affects:
- equity: yes, in both modes;
- used margin: no;
- stop-out: yes; swap built up on positions can by itself push equity below zero;
- drawdown limits: yes.
Where costs show in the results
- Each trade's profit already contains its commission (both legs) and its swap; swap a virtual symbol books on the balance is a balance operation instead. The run's commission and swap totals, the balance operations, the Broker costs panel and which report figures include balance-booked swap are on The report's numbers → results.
- The report has no figure before costs: no gross-of-costs profit, and no per-trade spread or slippage cost (what the report does not contain).
Virtual symbols
Video tutorial · D3 · on YouTubeYour broker's costs in a backtestAttaching a virtual symbol
- The launch dialog's Broker costs section lists every instrument of the strategy. For each one, pick a virtual symbol (yours or a preset) or leave the raw feed.
- The profiles are frozen into the run at launch, so editing or deleting a profile later never changes that run. A rerun keeps the frozen profiles by default, and you can also clear them or pick others. An optimization applies the same profiles to every run of the sweep.
- An instrument without a profile trades on the raw feed: the recorded spread, the run's slippage, no commission, no swap, the catalog's lot size and digits, and the run's leverage.
- Virtual symbols never apply to live deployments. Live trades pay the broker's real spread, commission and swap, on the broker's own contract specifications.
Allowed values
| Field | Rule |
|---|---|
| Name | Required; at most 200 characters; unique among your own profiles |
| Description | At most 1,000 characters |
| Commission value | 0 or more; at most 100 for percent of notional |
| Spread override, markup, slippage override | 0 or more (0 allowed) |
| Spread-session window | Spread above 0; minutes 0–1439; start ≠ end; at least one start day; no overlaps after wrapping past midnight |
| Rollover minute | 0–1439, in the rollover time zone |
| Rollover time zone | Empty (UTC), an IANA zone such as America/New_York, or NewYorkClose |
| Percent-per-year swaps | Daily period only |
| Minimum lots, maximum lots, lot step | Above 0; maximum above minimum when both are set |
| Leverage override | Whole number from 1 to the admission cap of 1:500 |
| Contract size override | Above 0 |
| Digits override | 0–8; the tick size becomes 10^-digits |
| Checked at launch | The effective minimum lots × contract size × 100 is a whole number of at least 1; the effective maximum is at least the effective minimum; the commission currency can convert |
Presets
- Presets are read-only virtual symbols maintained by ATH. Each is built from a capture of a broker's own live trading account through the cTrader Open API. The current brokers, account types and capture dates are below. The capture date is also in each preset's description.
| Broker | Account type | Captured | Account leverage | Instruments |
|---|---|---|---|---|
| FP Markets | Raw | Sep 15, 2026 | 1:500 | 59 |
| FP Markets | Standard | Sep 15, 2026 | 1:500 | 59 |
| FTMO | Standard | Oct 8, 2026 | 1:100 | 62 |
| FTMO | Swing | Oct 8, 2026 | 1:30 | 62 |
| IC Markets (EU) | Raw | Sep 15, 2026 | 1:30 | 59 |
A preset carries:
- the broker's commission and swap rates;
- the broker's swap time as the rollover minute, and its triple-swap day;
- a leverage: the broker's smallest-volume leverage tier, capped by the captured account's own leverage and by the 1:500 admission cap;
- the lot size, price digits and volume limits.
Preset swaps are booked on the position and charged in percent per year.
How cTrader's commission types become preset commissions:
cTrader type Preset commission USD per million USD (R) Percent of notional, R ÷ 10,000 %, on the quote-currency notional USD per lot Per lot, in USD Quote currency per lot Per lot, in the quote currency Percentage of value Percent of notional, as stated Rate 0 None Swaps stated as a percentage become percent per year as they are.
Swaps stated in pips become percent per year of the broker's price when it was captured:
- the pips become points: pips × 10^(digits − pip position), which is ×10 on a 5-digit FX pair;
- the points become a percent: points × 10^-digits ÷ price × 360 × 100, where the price is the broker's last daily close before the capture. Gold on FTMO Swing: −62.95 points at a 4,109.15 close is −62.95 × 0.01 ÷ 4,109.15 × 36,000 = −5.515 % a year;
- at the capture's price the charge is what the broker charged that day. On another day it follows that day's price, so a run over years when the instrument traded lower is charged less than the captured points would charge;
- the preset's description states the points, the percent and the close it was taken at;
- a swap of zero stays zero, with or without a price.
A Standard (commission-free) account preset carries a spread markup. The markup is the median difference between simultaneous quotes on the broker's Standard and Raw accounts, rounded to whole points, and the description states the number of paired quotes. A symbol the measurement did not cover gets no Standard preset.
Not shipped as presets:
- captures from demo accounts;
- symbols whose broker charges swap on a period other than 24 hours;
- symbols with an unknown commission or swap type;
- symbols with a swap stated in pips whose capture holds no price.
Presets change only when ATH ships a new capture, and finished runs keep the values they ran with. To change a preset's values, clone it into your own profile.
Costs do not change over a run. A virtual symbol's commission, swap rates, spread override and markup apply unchanged to every date the run covers. A preset carries the rates of its capture date, so a run over earlier years charges today's swap rates and commission, not what the broker charged then. The swap's amount follows the price, but its rate does not follow interest rates: brokers change their swap rates often, and rates were near zero in 2016–2021, so the early years of a long run are likely charged more swap than they paid. Read the swap of a long run with that in mind.
How the cost rules are verified
- Recorded test results fix every rule on this page: each commission type, both swap modes on both account types, the swap timing (rollover minute, triple day, weekend gaps), partial-close splits, spread overrides and sessions in both run modes, and slippage (recorded results).
- The comparisons with MetaTrader 5 run with commission, swap and slippage at zero, so they verify execution and prices, not costs. The percent-swap formula's 360-day basis was confirmed by IC Markets support. No costed backtest has been reconciled against a real broker statement.
Not yet documented
- How closely a costed backtest matches a real broker statement: no reconciliation has been recorded.
- Whether your broker's rollover moves with daylight saving time. The current presets carry the rollover minute captured on their capture date, in UTC. If a broker's rollover follows New York time, its winter rollovers fall one hour later in UTC than the preset says; a copy of the preset with the rollover set to 17:00 in New York time follows it. Not yet verified per broker.
The simulated account
A backtest runs one simulated account in one currency. The balance moves only when trades close and when swap is charged to the balance. Equity, margin and the stop-out follow the rules below.
Account settings
| Setting | Allowed | Default in the launch dialog |
|---|---|---|
| Initial balance | Above 0, up to 1,000,000,000, in the account currency | 10,000 |
| Leverage | Whole number, 1:1 to 1:500 | 1:100 |
| Account currency | USD, EUR, GBP, JPY, CHF, CAD, AUD, and NZD | USD |
| Slippage | Points per fill, 0 or more | 0 |
- No money can be deposited or withdrawn during a run.
- The account type (hedged or netting) is not a setting of the run: every backtest and every optimization run uses the account type the strategy declares, as frozen in the revision it runs, and a deployment refuses a broker account of the other type. To test a strategy on the other model, change its account type (a new revision). The report's Setup row names the account type and the strategy's time zone.
Converting to the account currency
- Profits, swaps, margins and percent-of-notional commissions are converted from the instrument's quote currency to the account currency. Per-lot and flat commissions are converted from the profile's commission currency.
- Route: the conversion uses one pair from the instrument catalog: {currency}{account} if it exists, otherwise {account}{currency} inverted. A third currency is never used. If neither pair exists for an instrument the strategy reads or trades, the run is refused when you launch it, before anything is charged: "AccountCurrency: {symbol} (instrument {id}) is quoted in {currency}, which has no FX conversion route to the account currency {account}". The same check runs when you re-run with new settings and when you start an optimization (for every instrument it can trade). Which account currencies cannot use which quote currencies:
| Account currency | Quote currencies it cannot convert |
|---|---|
USD | — |
EUR | — |
GBP | HKD, SGD |
JPY | — |
CHF | HKD |
CAD | SGD |
AUD | HKD |
NZD | HKD, SGD |
The same rule applies to a virtual symbol's commission currency, which is checked when you launch the run.
HKD and SGD are not offered as account currencies: the catalog cannot convert several quote currencies to either. A run already recorded in one keeps it and can be re-run as it was.
Rate: the conversion pair's bid, or 1 ÷ bid for an inverted pair. The same side is used for gains and losses.
When the rate is applied:
- nothing is converted when a position opens;
- realized profit is converted at the close;
- open positions, equity and margin are converted at every revaluation;
- swap is converted at its rollover step;
- commission is converted at each fill.
Where the rate comes from:
- tick mode: the latest tick of the conversion pair;
- bar mode: the conversion pair's one-minute bar of the same minute, using its open for fills at a bar's open and its close at the bar's close.
In bar mode, when the conversion pair is also an instrument your strategy trades or reads, the rate comes from its last completed bar, one minute earlier.
Backtests charge no fee for converting profits.
Balance, equity and free margin
- Balance = the initial balance + the profit of every closed trade (net of commission and position-mode swap) + every balance-mode swap charge.
- Floating profit of a position = (closing-side price − open price) × contract size × lots (sign by direction) × the conversion rate, plus the swap built up in position mode. It is net of the opening commission already incurred, and excludes the closing commission still to come.
- Equity = balance + the floating profit of all positions. It is revalued on every tick in tick mode and at every one-minute bar's close in bar mode.
- Free margin = equity − used margin. It can be negative.
- Deposit load = used margin ÷ equity × 100, shown as a lane on the equity chart (the equity chart).
Margin and leverage
Used margin per position = margin-bearing lots × contract size × the closing-side price × the conversion rate ÷ leverage. This equals MetaTrader 5's forex margin with a margin rate of 1, for any cross.
The leverage is the virtual symbol's per-instrument leverage when set, otherwise the run's leverage. There are no per-instrument margin percentages, no volume tiers and no initial/maintenance split. To approximate an instrument with its own margin rate, set its leverage in the virtual symbol.
Hedged accounts have two margin modes:
- Gross (default): every position locks its own margin, so a long and a short of the same size lock twice.
- Max side: only the larger side of each symbol locks margin, valued at that side's price, with a tie going to the long side.
Netting accounts hold one net position per symbol.
Margin check: every market order and every pending order at the moment it triggers is checked, but a pending order is not checked when it is placed. An order is refused when the extra margin it adds exceeds the free margin. The extra margin is priced at the order's price before slippage.
- On a hedged Gross account the extra margin is the order's full size, even for an opposite order.
- On a hedged Max side account it is the growth of the symbol's larger side, so an order that only offsets the other side adds nothing.
- On a netting account it is the growth of the absolute net position, so an order that reduces, closes, or reverses into a smaller or equal position is never refused.
A refused market order opens nothing, and the strategy keeps running. A refused pending order is cancelled at its trigger.
The check reads equity and margin as of the last revaluation. Fills, closes and stops earlier in the same step are already included, so a close frees margin for an order that follows it.
Refused orders leave no trade and appear only in a recorded replay (after a refusal). There is no margin call (no warning level). The report's "Margin level" row is the lowest margin level the run reached (report); the replay's account strip shows the used margin.
Stop-out
Trigger: after a revaluation, the stop-out fires when equity is below zero. A low margin level alone never triggers it; there is no 100 %, 50 % or 20 % level.
What happens:
- The position losing most (floating profit including built-up swap) is closed first, then the next, until no position is left. Closing cannot bring equity back above zero, so every open position is closed.
- Each close is at the closing-side price, with slippage and commission, and is marked Stop out in the trade list.
After a stop-out the run ends. Resting orders are cancelled and the run stops at the stop-out; the report says "Stopped out on {date}: equity fell below zero, every position was closed and the run ended." The balance keeps the loss, below zero included: nothing resets it. The equity chart still runs to the end of the period you chose.
Timing: tick mode checks after every tick. Bar mode checks at each one-minute bar's close, using closing prices only, so a dip below zero inside a minute that recovers by its close does not stop the account out.
Leverage and the hedged margin mode change what the account is allowed to open, not when it is liquidated.
A broker's own stop-out level (a margin level at which it closes positions, usually well before equity reaches zero) is not modelled. A real account can be stopped out earlier than the backtest shows.
Lot size, points and rounding
- A backtest uses the catalog's contract size, digits, tick size, volume limits and quote currency, unless the run's virtual symbol overrides the contract size, the digits (the tick size becomes 10^-digits) or the volume limits; these values apply for the whole run. The catalog's lot is the reference broker's and can differ from your broker's; a broker preset carries that broker's lot. The catalog states no maximum lot size (contract sizes).
- One point is the tick size; computed prices are rounded to the digits, and so are the recorded prices a fill is read from (two precisions).
- A trade's profit is (close − open) × contract size × lots, signed by direction, converted at the close, minus both commissions, plus the swap booked on the position (what a trade's profit contains).
- Money is never rounded by the engine; the app shows 2 decimals for every currency, JPY included, and the trades CSV carries the full figures (precision).
What a strategy can read about the account
What the Account Value, Trade Value and Session P&L values read, how fresh they are, and how position sizing turns the balance into lots, are on Strategy semantics → trades and the account and position sizing.
In live trading
Live, the money is your broker's: every closed trade's profit, commission (the broker's currency-conversion fee included) and swap come from its closing deal. Equity and free margin are the account's: positions are priced with your broker's contract size, positions you opened by hand count at your broker's own figure, and the used margin is the one your broker states. Details: Live execution → what runs live and whose numbers you see.
Differences from the MetaTrader 5 Strategy Tester
How these cost and account rules compare with MT5's — the bar spread (average against minimum), net against gross trade profit, costs left out of every comparison, the stop-out rule, the margin formula and the currency conversion — is on Compared with the MT5 Strategy Tester → prices and costs and margin and stop-out. The stop-out rule was derived from a recorded MetaTrader 5 run: a free-margin trigger was tried and rejected, because it liquidated positions that MetaTrader 5 kept open. Recorded tests fix the margin formula, both hedged margin modes, the per-instrument leverage, the margin check at pending triggers, the stop-out trigger and the currency routes (recorded results).
Not yet documented
- What happens when the conversion pair's price history does not cover the whole backtest period. The date range the app offers covers only the instruments the strategy uses.
Questions?support@algotradinghub.io