Version: ml4t-backtest 0.1.8
Events are keyed by exact timestamp. Daily bars for instruments whose sessions close at different times on the same trading day (for example CME products closing at 21:00 and 21:15 UTC) are delivered as separate on_data calls, each carrying only some assets:
events: [('01-02 21:00', ['ES']), ('01-02 21:15', ['ZC']), ('01-03 21:00', ['ES']), ('01-03 21:15', ['ZC']), ...]
For a cross-sectional strategy that rebalances all instruments on one decision per day, this is a trap: a target-weight rebalance on the first event sees only the assets in that event, and TargetWeightExecutor treats held positions missing from the target as positions to close. The workaround is to normalize timestamps to a session date before building the feed, which loses the actual close time used for fills.
Requested: an option to group bars into one event per trading session (a session key or calendar on the feed), with each asset still filled at its own bar; or, at minimum, documentation of the per-timestamp behavior and the recommended pattern for multi-session daily data.
Version: ml4t-backtest 0.1.8
Events are keyed by exact timestamp. Daily bars for instruments whose sessions close at different times on the same trading day (for example CME products closing at 21:00 and 21:15 UTC) are delivered as separate
on_datacalls, each carrying only some assets:For a cross-sectional strategy that rebalances all instruments on one decision per day, this is a trap: a target-weight rebalance on the first event sees only the assets in that event, and
TargetWeightExecutortreats held positions missing from the target as positions to close. The workaround is to normalize timestamps to a session date before building the feed, which loses the actual close time used for fills.Requested: an option to group bars into one event per trading session (a session key or calendar on the feed), with each asset still filled at its own bar; or, at minimum, documentation of the per-timestamp behavior and the recommended pattern for multi-session daily data.