I have an int for barNumberOfOrder and barNumberOfEntry which I set to CurrentBar at appropriate times.
The barNumber ofOrder is for limit orders so that I can see if it "sits" there as pending for too long. For barNumberOfEntry, I also track to see how many bars I've been in a trade.
I'm trying to determine if this could/or should be set in OnOrderUpdate or OnExecution immediately after the trade is executed or if it should only be done in OnBarUpdate.
Thanks,
Kirk
ps, I've already looked at the SampleCancelOrder.cs - that file doesn't show where to reset the barNumberOf Order to zero which I need to understand as well...

Comment