quantlab.portfolio.predefined.approximate.topk_dropout#
The approximate backtest’s TopkDropout: the decision bars solved forward, the book drifting between them.
The implementation quantlab.portfolio.approximate.implementation chooses
for a TopkDropoutConstructor; it reads the rule’s config. TopkDropout reads
the holdings, so the bars are decided in time order: a bar’s holdings are the
last decided book (or prices.previous) at its fill prices, marked at the
bar’s valuation price over the book’s value, cash included, as
quantlab.execution.approximate.mark_book marks it; a held symbol that is
not tradable at the bar is locked. Each bar is then decided by the rule’s own
book step (TopkDropoutConstructor.book), so the picks, the sells and
the buys’ weights are the per-bar rule’s. What the approximate backtest gives
up is the exact book’s: an order a backtest run rejects, a settled delisting
or a buy capped by cash leaves the run’s book different from the decided one.
Functions