quantlab.portfolio.predefined.approximate.top_n#

The approximate backtest’s top-n: every decision bar’s equal-weight book at once.

The implementation quantlab.portfolio.approximate.implementation chooses for a TopNConstructor; it reads the rule’s config. Each bar’s book is the one TopNConstructor.construct gives the bar with nothing locked: the same picks (a stable sort, ties resolved by symbol order), top_n reduced where fewer symbols can be picked (one warning names those bars), and 1 / k (0.5 / k per side long-short) on each pick. The tie events are not counted. The books do not read the holdings.

Functions

decide

Return every bar's top-n book; top-n reads neither the holdings nor a stopping rule.