Costs, swap and funding

Forge API 1Updated 24 Nov 2026

A run applies four costs to a trade. Each fill records them: spread, commission, swap and slippage.

Where the numbers come from

The swap comes from the broker facts that your connected account reports. The facts are saved once per broker server and shared by everyone on it. A run gets a copy of the facts for its symbols and is stamped with the hash of that copy, so a result says exactly which facts it used.

The spread comes from the price history, never from a broker. A broker's spread today is not its spread on the dates you test.

CostSource
SpreadA spread you type for the test. Otherwise the history's own: its recorded bid and ask, or for a file of candles, the spread each candle records. A file of candles uploaded before Forge kept each candle's spread charges one figure for each hour of the day until it is uploaded again. History with neither has no spread, and the run charges none and says so on its result
SwapThe broker's swap mode, its long and short rates, and the weekday that carries the triple charge
CommissionA setting in your Forge execution profile
SlippageA setting in your Forge execution profile

Commission is yours

A terminal does not report commission reliably for each symbol, so Forge does not guess. The run uses the commission in your execution profile and says so on the result.

Swap

Swap is charged for holding a position over the broker's rollover. The rate differs for long and short, and some brokers charge three nights on one weekday. A strategy that holds for minutes pays none. A strategy that holds for weeks pays it on most days.

When it is charged: at midnight on the broker's clock when the test has one, otherwise at 17:00 New York. A market open all week, such as crypto, is charged every night at 00:00 UTC and never three times.

You can type the swap yourself in New test: the long and the short charge for a night, per lot, in your distance unit. It works with or without broker facts. Points need broker facts, as every run in points does. You can also choose the weekday that carries the triple charge, or leave it on the broker's day, which is the day in the broker facts, or Wednesday without them.

A missing fact is not zero

When a broker does not report a fact, the field is empty. It is never read as zero. A run that needs a fact the broker did not give says so, instead of running with a number nobody measured.