Strategy: Using OnOrderUpdate() and OnExecution() methods to submit protective orders
I assume the point of the example is to show how to submit stops and targets in the OnExecution method--but in the reference the stopOrder is submitted in the OnBarUpdate method once price has moved 4 ticks in our favor
Is there a reason that the stopOrder is submitted in the OnBarUpdate method and not in the OnExecution method? Is it because we can't get the 'last' trade price (Close[0]) in the OnExecution method?
I am not clear when to use OnBarUpdate vs. OnExecution (I realize that OnBarUpdate is triggered either at the start of a new bar or by tick-by-tick depending on CalculateOnBarClose setting while the OnExecution is triggered on Order executions)--but seems like if the point is to submit changes in stop orders or targets as soon as possible-that we would always use OnExecution.
So could you expand on when you should NOT use OnExecution methods to handle changes in stop orders, etc.
thanks.

Comment