Version: ml4t-backtest 0.1.8
The engine has no way to apply periodic funding cash flows to open perpetual-futures positions. There is no funding concept in the source. The only workaround is to write broker.cash directly from strategy code (or patch broker._update_time), which bypasses accounting: the transfers do not appear in fills, trades or the equity decomposition, and they are easy to apply at the wrong time relative to marks.
Requested:
- A funding input keyed by asset and timestamp (rate, or payment per unit of notional), applied to positions held at the funding time, long pays positive rate and short receives.
- Funding reported as its own cash-flow series in the result, so gross P&L, costs and funding can be separated.
- Clear timing: which mark the notional uses and whether a position opened at the funding timestamp pays.
A backtest of a perpetual-futures strategy without funding is wrong by the full carry, which for a funding-driven strategy is the whole return.
Version: ml4t-backtest 0.1.8
The engine has no way to apply periodic funding cash flows to open perpetual-futures positions. There is no funding concept in the source. The only workaround is to write
broker.cashdirectly from strategy code (or patchbroker._update_time), which bypasses accounting: the transfers do not appear in fills, trades or the equity decomposition, and they are easy to apply at the wrong time relative to marks.Requested:
A backtest of a perpetual-futures strategy without funding is wrong by the full carry, which for a funding-driven strategy is the whole return.