I'm doing a MarketOrder, and checking order status at OnOrderEvent.

The weird thing is that security price at this point is 1009, while FillPrice is 1020.

Even weirder is FillPrice is 1020 on EVERY order fill, while security price is changing.

What is wrong with the data??

Thanks!!

public override void OnOrderEvent(OrderEvent orderEvent)
{
var order = Transactions.GetOrderById(orderEvent.OrderId);
_FillPrice = orderEvent.FillPrice;

if (orderEvent.FillQuantity > 0 && _FillPrice > 0)
{
Log("Order FillPrice " + _FillPrice);
Log("Stock Price " + Securities[orderEvent.Symbol].Price);
}
}

 

Example output:

2017-07-31 09:37:33 Order FillPrice 1020.01000000000
2017-07-31 09:37:33 Stock Price 1013.71

2017-07-31 09:51:55 Order FillPrice 1020.01000000000
2017-07-31 09:51:55 Stock Price 1009.16

2017-07-31 10:23:28 Order FillPrice 1020.01000000000
2017-07-31 10:23:28 Stock Price 1002.31

 

Backtest properties:

SetStartDate(2017, 07, 31);

SetEndDate(2017, 08, 01);

Symbol = "AMZN",   Exchange = "P"