I haven't really used NT8 for live trading (in this case for a paper account) so I'm not sure if this is expected behaviour, but I really don't think it should be since I'm doing exactly the same thing in NT7.
So here's the code I have for OnExecutionUpdate:
protected override void OnExecutionUpdate(Execution execution, string executionId, double price, int quantity, MarketPosition marketPosition, string orderId, DateTime time) { Print ("A"); if (execution.Order.OrderState == OrderState.Filled) { Print ("B"); SendEmail(); } }
What I'm seeing though, is that "B" seems to get printed a variable number of times (and I'm also receiving the accompanying emails). Since the e-mails sent to me contain execution.Order.ToString(), I can confirm that it is the same orderId being "completely filled" multiple times. For five orders my strategies submitted today, I received:
3x triples
1x double
1x single (which is what it should be)
In case it matters, I'm enabling my strategies from the strategy grid rather than from a chart.
Thanks for the help.
Comment