quantlab.portfolio.predefined.approximate.topk_dropout.holdings#

quantlab.portfolio.predefined.approximate.topk_dropout.holdings(weights, entry, close)[source]#

A book filled at entry marked at close, as weights of its value, cash included.

A price missing on either side counts as no change.

Examples

>>> holdings(np.array([0.5, 0.5]), np.array([10.0, 10.0]), np.array([20.0, np.nan])).round(4)
array([0.6667, 0.3333])