On order updates and executions I use the == operator to compare orders (remember - I only have one so far)
The comparison sometimes fails, even though the execution is positively for the order submitted. Following is the ToString() result for both orders (one from the parameter of OnOrderUpdate() and the other is the variable I previously stored on entry:
Argument:
Order='705e20ac8a5e40b4aefd10a52fbbbb8d/Sim02' Name='enter short HAL (Sim02)' State=Filled Instrument='HAL' Action=SellShort Limit price=0 Stop price=0 Quantity=2,600 Type=Market Tif=Day OverFill=False Oco='' Filled=2600 Fill price=38.1146153846154 Token='705e20ac8a5e40b4aefd10a52fbbbb8d' Gtd='1/1/0001 12:00:00 AM'
Variable:
Order='35f176909fed4d60aa032fe04ae626c4/Sim02' Name='enter short HAL (Sim02)' State=PendingSubmit Instrument='HAL' Action=SellShort Limit price=0 Stop price=0 Quantity=2,600 Strategy='MyTrendFollower1' Type=Market Tif=Day Oco='' Filled=0 Fill price=0 Token='35f176909fed4d60aa032fe04ae626c4' Gtd='12/1/2099 12:00:00 AM' @ 2/22/2012 8:41:12 AM
I expected argument==variable to be true (as the documentation indicates), but it is false.
What am I doing wrong?

Comment