Borrow costs and funding
Lesson 14 · about 10 min
Holding a position costs money even when the price does not move. Shorting a stock means borrowing it and paying for the loan. Holding a crypto perpetual means paying or receiving funding every few hours. Holding forex overnight means paying or earning the interest differential. None of these appear in a price-only backtest, and for any strategy that holds positions for more than a day, they can dominate the result.
Stock borrow
To short a stock you borrow shares from another holder through your broker, and you pay an annualised fee for the loan. For large, liquid stocks the fee is small, often under 1% a year. For heavily shorted names, small caps, and anything in the news, it can be 20%, 50% or in extreme cases several hundred percent annualised. Shares can also be unavailable to borrow at all, or recalled while you are short, forcing a buy-in.
| Borrow category | Typical annual fee | Cost of a 10-day short on $10,000 |
|---|---|---|
| General collateral (easy to borrow) | 0.3% to 1% | $1 to $3 |
| Moderately hard | 5% to 20% | $14 to $55 |
| Hard to borrow | 50% to 200% | $137 to $548 |
| Unavailable | n/a | Trade cannot be placed |
A backtest of a short-side strategy that ignores borrow will look best on exactly the stocks where borrow is most expensive, because those are the stocks with the most negative sentiment and the largest downside moves. The strategy may not be tradeable on them at all.
Practical handling: historical borrow rates are hard to obtain for retail traders. A reasonable approximation is to charge a flat 1% a year on large-cap shorts, a much higher rate (or a hard exclusion) on small-cap and low-float names, and to note the assumption. The short seller also pays any dividend that goes ex while the position is open; include that if your data has dividend dates.
Forex swap
Holding a currency pair overnight earns the interest rate of the currency you are long and pays the rate of the one you are short, adjusted by the broker's markup. This is the "swap" or "rollover", applied at 17:00 New York, with a triple charge on Wednesdays to cover the weekend.
For a pair like AUD/JPY with a wide rate differential, the swap can be several pips a day in one direction. A long-holding strategy that is systematically on the paying side loses a meaningful amount over a year; one on the receiving side gets a tailwind that is real but not part of the price edge.
| Position | Rate differential | Swap per day (1 standard lot, approx.) | 20-day hold |
|---|---|---|---|
| Long high-yield vs low-yield | +3.5% | +$9 | +$180 |
| Short the same pair | −3.5% minus markup | −$12 | −$240 |
Include swap in the backtest as a daily charge or credit per open position, using the historical rate differential if you have it and the current one as an approximation if not.
Crypto funding
A perpetual future has no expiry, so the exchange keeps its price near spot with a funding payment between longs and shorts, usually every 8 hours. When the perp trades above spot, longs pay shorts; below, shorts pay longs. The rate is typically tiny per period but is not fixed: in strong bull phases it can run at 0.05% to 0.1% per 8 hours, which is 55% to 110% annualised, paid by longs.
| Funding rate per 8h | Annualised | Cost to a long over 30 days on $10,000 |
|---|---|---|
| 0.01% (typical calm) | ~11% | $90 |
| 0.05% (bullish) | ~55% | $450 |
| 0.10% (euphoric) | ~110% | $900 |
A trend-following long strategy on perps is most often long exactly when funding is most expensive. A backtest on price alone can show a strategy making 40% while funding took 30% of it. Exchange APIs publish historical funding rates; download them and charge or credit each 8-hour period the position is open.
Key idea: Price is not the only thing that changes while you hold a position. Borrow, swap and funding are real cash flows that a price-only backtest ignores, and they are largest in exactly the situations where the naive backtest looks best.
Futures carry
Futures have no explicit financing charge; the carry is embedded in the price difference between contract months. A back-adjusted continuous series already includes the effect of rolling, so no separate charge is needed. A spliced series does not, and a strategy tested on one will show the fake roll gaps from Module 2 instead of the real cost of carry.
Putting it into the test
For each open position, on each day (or funding period) it is open, subtract or add the holding cost. In a spreadsheet this is one extra column: daily holding cost × days held. In code it is a per-bar adjustment to the open position's P&L. Then compare results with and without holding costs.
| Strategy | Avg hold | Avg R before holding costs | After |
|---|---|---|---|
| Stock short, mixed universe | 12 days | +0.28 | +0.19 (large caps) / −0.05 (small caps at 40% borrow) |
| AUD/JPY long-only swing | 8 days | +0.21 | +0.26 (positive carry) |
| BTC perp trend, long-biased | 18 days | +0.35 | +0.17 (2021-style funding) |
Try it: For your longest-holding strategy, estimate the daily holding cost in dollars per position and multiply by the average hold. Convert to R. If it is more than 0.05R per trade, add it to the backtest properly rather than approximating.
Recap
- Short stock: borrow fees range from under 1% to hundreds of percent a year; hardest to borrow where the short looks best.
- Forex: overnight swap credits or debits the rate differential; triple on Wednesdays.
- Crypto perps: funding every 8 hours, paid by the crowded side; expensive for longs in bull phases.
- Futures: carry is embedded in the roll; back-adjusted series already include it.
- Charge holding costs per period the position is open, and compare results with and without.
See it drawn
Original diagrams for the ideas on this page. Illustrative, not real market data.