I am placing 2 buy orders using SetHoldings() function and 2 sell orders using StopMarketOrder() function. So 4 total trades are executed. Inside the OnOrderEvent() function i am logging the Order Id for each event. GetOrderById(orderEvent.OrderId)

Shouldnt each individual order have a unique Order ID? Or is the ID defined by the function used to place the order? ID 4 for SetHoldings and ID 2 for StopMarketOrder?

Below is what i see in my logs

2020-01-03 00:00:00 : Order ID 4 for Ticker XOM is executed with Quantity 836.0
2020-01-03 00:00:00 : Order ID 4 for Ticker BP is executed with Quantity 1529.0
2020-02-26 00:00:00 : Order ID 2 for Ticker XOM is executed with Quantity -836.0
2020-03-10 00:00:00 : Order ID 2 for Ticker BP is executed with Quantity -1529.0

Thanks in advance :)

Author