quantlab.execution.approximate.simulate#
- quantlab.execution.approximate.simulate(targets, decisions, entry, close, cost)[source]#
Simulate the targets decided at
decisionsin one pass over the bars;(value, traded, fill_value, filled).targets[k]([K, S]; an all-NaN row holds) is decided at rowdecisions[k](in time order, each before the last row) and fills at the next row’sentryprice;closeis the forward-filled valuation price. A fill costscosttimes its traded weight against the previous book marked at the fill’s prices. Returns the value per bar (1.0 before the first fill); for each fill, in order, the signed weight traded in each symbol ([F, S], the target less the previous book marked at the fill’s prices) and the value it was traded against (the book before the fill’s costs); and which decisions filled.