I am running a backtest with Minute resolution, working only with NYSE Equity and am not setting Time Zone explicitly in code. I rarely run into a case where, OnOrderEvent gets called twice for the same OrderID and orderEvent.Status.IsFill() is true for both calls and has the same quantity. 

Not 100%, but I suspect this is because I may be calling Update on the same event twice in the same minute - one from a scheduled event (because of some trigger) and one via ondata (to achieve trailing stop loss).

1. Is it ok that OnOrderEvent gets called twice for the same OrderID and orderEvent.Status.IsFill() is true for both calls and has the same quantity? Do we know when that would happen?

A few questions if calling Update on the same event twice in the same minute may be causing the problem:

a. If multiple updates to the order cause (1), whats the recommeded approach to avoid this situation? I tried comparing current Time with OrderTicket.Time to avoid a double update at the same time, but the time values for seem Time and OrderTicket.Time seem to be very different (perhaps the TZ is different on the ticket vs current).

b. Even if comparing last update time (2) worked, I still wouldnt be able to control which update takes precedent. Whats the sequence of scheduled vs ondata calls? Does one always get called before the other?

Thank you.

Author