I'm coding under unmanaged approach, therefore it's necessary to think every tiny aspect of a logic flow in order to avoid errors. Sometimes weird time errors arise without any logic programming explanation. I suspect that this might be cause the order could be returned with certain error or "non-proper" state to work. At this moment I don't know which is the best method to call what the actual error status of an order is, thus I work just with all other general known states.
I did this little snippet, which might be non very useful but my intention is filtering orders if they have a proper state to work with.
protected override void OnExecution(IExecution execution)
{
if (lEntryOrder != null && lEntryOrder == execution.Order)
{
if (lEntryOrder.OrderState == OrderState.PendingCancel || lEntryOrder.OrderState == OrderState.PendingChange || lEntryOrder.OrderState == OrderState.PendingSubmit || lEntryOrder.OrderState == OrderState.Unknow)
{
return;
}
if (lEntryOrder.OrderState == OrderState.Filled || lEntryOrder.OrderState == OrderState.PartFilled || (lEntryOrder.OrderState == OrderState.Cancelled && lEntryOrder.Filled > 0))
{
// Work
}
}
}
2. Is there any method to know if an order has been returned with some error?

Comment