← Learn

Is funding charged pro-rata in a backtest?

Updated 20 September 2026 · Versión en español

No. On a perpetual futures contract, funding is paid in full if the position is open at a settlement instant, and not at all if it closed before one. A backtest that charges a fraction of the interval — "held 3 hours of an 8-hour cycle, so charge 3/8" — is inventing a cost structure no exchange uses, and it gets short-horizon strategies wrong in both directions.

What the exchange actually does

Binance states it plainly: "If you close your position prior to the funding time, you will not pay or receive any funding." Funding changes hands only at the settlement instants — every eight hours on most contracts (00:00, 08:00 and 16:00 UTC), every one to four hours on some. Between those moments, no funding accrues to anybody.

A worked example

Take a $10,000 long on BTCUSDT perpetual with a funding rate of 0.01% and an eight-hour cycle. One settlement costs $1.00.

The tradePro-rata modelWhat really happens
Open 09:00, close 12:00 (3 h, no settlement crossed)$0.375$0.00
Open 15:30, close 16:30 (1 h, crosses 16:00)$0.125$1.00
Open 09:00, close 09:00 next day (24 h, crosses three)$3.00$3.00

The pro-rata column is wrong twice: it charges a scalper who never held through a settlement, and it under-charges the one-hour trade that did — by a factor of eight. Only the third row, where the horizon is long enough for the error to average out, looks the same.

Why it matters more than it sounds

The error scales with how often you trade, not with how much you make. A strategy holding minutes at a time pays real funding on a small fraction of its trades and nothing on the rest; a pro-rata model spreads a little cost across all of them, flattering the losers and taxing the winners. The faster the strategy, the further its backtest drifts from what a broker statement would show.

What TradingZona does

One model, shared by the backtest and the live engine (holdingCost): a position is charged the full rate for each settlement instant it was open across, and zero otherwise. Where the venue publishes its historical funding rates, those real rates are used instead of the figure typed into the form. The same panel charges commission, spread and slippage, and liquidation is checked before the stop and the target, because a venue force-closes first.

This was not always true here: both engines once charged bars_held × timeframe ÷ 8h, a fraction of an interval. Fixing it changed existing results — most for short-horizon crypto strategies, which is exactly where the model was wrong.

The edge case nobody models

Closing at the settlement instant is not a clean escape. Binance documents a 15-second deviation window around the funding time; Bybit says that opening or closing within five seconds before or after the timestamp "does not guarantee its inclusion/exclusion". A backtest cannot resolve that ambiguity and should not pretend to: ours charges by whether the position was open at the instant, and a strategy whose result depends on the last five seconds before funding is telling you something about the model, not about the market.

Sources

TradingZona is research and signal software. It places no orders, it is not a broker and it is not investment advice. A backtest is hypothetical: past or simulated performance does not guarantee future results. Trading involves substantial risk of loss.