Two nights ago my automated strategy was disabled due to bad connection with the broker. on average this happens at least once every other hour with my broker and they're showing no interest in rectifying this (see log). At the time It left an open position and 2 pending stop orders. When the connection came back, it cancelled the stop orders but left the open position running well into risky territory.
I have read the relevant thread on syncing account positions.
My strategy's start.behavior was set to "wait until flat" - which i understand would leave the open position running. My requirements are:
1. minimize lost connection
2. should the lost connection happen again, that my strategy retains all orders and position as before the disconnect
3. If the strategy must synchronize virtual and physical positions by force, that it kills all pending orders AND open positions.
4. Keep the strategy running with as little user intervention as possible.
On top of that I would also like to put a hard stop on open positions at 3:10am and be flat till 5am without disabling my strategy.
I have proceeded to do the following
1. Run my strategy and ninjatrader from virtual private server
2. Uncheck Option > strategy > on connection loss> cancel exit and entry orders (this was never checked off before)
3. Option > strategy> on connection loses > set strategy to "keep running"
4. Set auto-close at 3:00am to close all position
My questions are
1. Is it still necessary to run start.behavior as WaitUntilFlat, synchronize to achieve my objectives?
1. It seems to me that the error handling in my strategy did include "close position" (look closely on the red circle at 1:32am), but it was not executed. Why did it not send a close order?
2. If I set my strategy to "keep running" under lost connection, will it still be disabled when open positions are auto-closed?
3. Is there a way to do auto-close without disabling strategy?
4. What other ways might the strategy be disabled without user intervention?
thank you
Comment