I noticed this during some testing.
I added an OnExecutionUpdate handler to an indicator, as I have done before. This works perfectly well when orders are executed for the most part, but I noticed an oddity when testing with the 'Order Ticket' window.
Assume my OnExecutionUpdate function simply prints e.Execution.ToString(); The indicator does nothing else. If I buy and sell via any chart window using charttrader, this works fine. I see the indie print of the execution lines.
Now, If I try to sell via the Order Ticket window, assuming I have no existing position, this works fine, too. As expected. But, if I start with a buy and no initial position, OnExecutionUpdate never fires. It does for the closing sell order.
In fact, I can click buy from flat multiple times and OnExecutionUpdate does not fire. The moment I hit sell, it does. This ONLY happens from the 'Order Ticket' window. If I hit buy or sell from ChartTrader buttons, works as expected. Given the latter works and my code is just doing the aforementioned dump of the string, I cannot imagine it is code related.I would add that the DOM buy and sell buttons work exactly as expected, also. It only happens with the order Ticket window. NT8 ver is 8.0.26.1 64-bit
Is this a known 'feature'? Are my expectations incorrect?
Thanks.
Comment