I have been running an automated strategy in real time now for a few months with CalculateOnBarClose = True with no problems. After doing some testing I have found running the strategy on incoming ticks yields better results. I have made necessary adjustments in my code to handle the on demand processing but I worry of a potential black swan case where my system enters into a bad state of some circular logic where orders can potentially get placed very rapidly and unintentionally.
Obviously this comes down to me writing sound code, but aside from that. Is there any other protective methods/conventions you could recommend to prevent a case where lets say more than 10 orders get placed in a 5 second period? I use unmanaged order entries and it is possible for my system to place a couple orders all within one tick , but its unlikely there would ever be more than 5 or 6 orders placed at once.
So is there anything I could use/write that would prevent a disaster scenario ( dropped data feed connection, ninjatrader freeze, etc etc) that would shut down the system in a case like this, if more than X amount of orders are detected? I imagine I can write some sloppy code myself to do this but essentially looking for a more robust/cleaner way!
Thanks!

Comment