Day 150 — Borrow and financing, the costs with no price print
Sunday, 3 January 2027 · Week 22 of 52 · The research harness · Study day · 65 min
The two costs you cannot see in any price series, which is exactly why they are the ones most often left out of a backtest and most reliably present in a brokerage statement.
What you should be able to do tonight
- Compute the annual financing and borrow cost of a long-short book at stated rates, and express it as a Sharpe reduction.
- Say what happens to the calculation when one name in your short book becomes hard to borrow.
Tasks 65 min
30 min Add financing to qlib/costs.py: a daily charge on the net debit balance at the broker call rate, and a daily borrow fee on the short market value at a per-name rate defaulting to general collateral. Apply it to your pairs strategy and report the drag in basis points a year and the Sharpe before and after.
25 min Model the tail: assume 5 percent of your short positions become hard to borrow at 8 percent a year for a quarter of the holding period, and recompute. Then say what a recall would cost on top, using your day 12 notes. Borrow costs are not symmetric and the tail is what matters.
10 min Write the assumption list for financing into the milestone report, since every number here is an assumption rather than a measurement until phase 10.
Resources
Deliverable
Financing and borrow costs in qlib/costs.py, with the pairs strategy’s Sharpe before and after and a hard-to-borrow tail scenario.
Checkpoint
Your market-neutral book is 100 long and 100 short. What does it cost to carry for a year before you trade at all?
Prepare for tomorrow
Ten minutes tonight so Day 151, Monday, 4 January 2027 starts clean. This is what the evening email sends you.
Compute the annual turnover of both your strategies as a fraction of portfolio value, one-way.
Divide by 252 to get the daily fraction traded.
Two numbers per strategy. Tomorrow turns them into money.