How does the backtesting engine determine if a passive order is filled?

hh722182hh722182 Posts: 2

In the case of equities, if I submit a (long) limit order at $100.00 as part of a backtest, what priority will it have in the queue of previous (or subsequent) limit orders submitted at that price, (and does this change if the current best-bid quote is several cents higher at the time?

Also, does the likelihood of being filled change if the size of my limit order is 300 shares whereas the trade message and/or best-ask-quote that -- I'm assuming -- might trigger the fill only has 100 shares associated with it?

More generally, what has to happen to the bid/ask price (or trade price) in order for my passive order to be assumed to have been filled?


  • ptunneyptunney Posts: 246

    The fill logic for limits is very simple.
    As soon as your limit price is hit by a trade at that price yours will fill - regardless of size.
    If you have two orders in, they will both fill - regardless of size.
    It is left up to the user to ensure that their model's order size is not excessive.

Sign In or Register to comment.