On Execution Price

As you submit orders in your strategies, you will probably notice that orders are executed at prices that seem to be using non-trivial rules. You will find them detailed in this article.

Close Price

To get accurate close prices, we use the settlement price as the close price for our market data. It is generally more accurate than the one provided by market data providers. However, under some circumstances, this close price may actually be lower than the low price. Conversely, it may be higher than the high price.
In these cases, when the close price falls out of the high/low boundaries, we cap this close price with high and low prices to get our execution price.

Market Orders

When Market Orders are executed at the end of a bar, the close price is use as the price for the instrument. As noted previously, if the close price falls out of the high/low boundaries then the order will be exectuted at the high or low price.

Stop Orders

Stop Orders are executed at their stop level, as long as this level is reached by the bar e.g. if Low < Stop Level < High.
If a Stop Order is not executed in a bar and if the next bar opens at a price that triggers the Stop Level, it is then executed at that Open price.
If the Stop Level is reached by the Close price but not within the bar e.g. out of the High/Low boundaries, then the Stop Order is not executed.

Limit Orders

Regarding execution prices, Limit Orders follow exactly the same rules as the Stop Orders with the following exception: when placed on a bar Open, the execution of a Limit Order for that bar does not take account of the Open price of that bar.

Examples

Open High Low Close Order Executes at
2 4 1 1.5 Buy or Sell 1.5 (Close)
2 4 1 0.5 Buy or Sell 1 (Low, because Close < Low)
2 4 1 4.5 Buy or Sell 4 (High, because Close > High)
2 4 1 3 Buy Limit @ 1.5 1.5 (Limit Level)
2 4 1 3 Buy Limit @ 0.5 Not Executed
2 4 1 3 Sell Limit @ 2.5 2.5 (Limit Level)
2 4 1 3 Sell Limit @ 5 Not Executed
2 4 1 3 Sell Stop @ 1.5 1.5 (Stop Level)
1 4 1 3 Sell Stop @ 1.5 1 (Open, because Open < Sell StopLevel)
2 4 1 3 Buy Stop @ 3.5 3.5 (Stop Level)
2 4 1 3 Buy Stop @ 1.5 2 (Open, because Open > BuyStopLevel)
2 4 1 5 Buy Stop @ 4.5 Not Executed (Close > High and High < Stop Level)
2 4 1 0 Sell Stop @ 0.5 Not Executed (Close < Low and Low > Stop Level)
2 4 1 3 Buy Limit @ 2.5 placed on bar Open 2.5 (Open not taken into account)
2 4 1 3 Buy Stop @ 1.5 placed on bar Open 2 (Open, because Open > BuyStopLevel)