Skip to content
Discussion options

You must be logged in to vote

With only external daily bars, there is no native “submit after bar N closes, fill at bar N+1 open” mode.

The important detail is the backtest event order:

  1. the exchange processes all four prices of bar N,
  2. your strategy receives on_bar(N),
  3. orders submitted by that callback are settled against the current book, which now reflects N's close.

This is why the market order fills at today's close. Adding a small LatencyModel does not turn it into a next-open order either: with bar-only data, the next bar's OHLC sweep occurs before the delayed command is drained, so it will generally see the next bar's close. The current bar-execution documentation describes both behaviors and explicitly notes …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Hari-Shankar-Karthik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants