protectedoverridevoid OnExecution(IExecution execution)
{
if(iOrderFirstAddContracts != null && iOrderFirstAddContracts == execution.Order)
if(execution.Order.OrderState == OrderState.Filled)
{
writeInfo("firstAddContracts");
}
}
iOrderFirstAddContracts was set as the return of the entry order.
I'm trying to get the report of a 5 contract fill. writeInfo was called three times. I have a later "if" statement for a different entry that is only for 1 contract and writeInfo then was only called once. I assume that it was called three times in the above code because of partial fills, but I thought that by using OrderState.Filled on execution it would wait until the order was completely filled.
What am I doing wrong?

Comment