The goal is to have the strategy survive disconnects
but it doesn't...
What happens is:
1. I run my strategy
2. it enters a position
3. i manually forced a disconnect from the connections menu
4. so far so good
5. I manually reconnect from the connections menu
6. there is no output from ninjatrader to the output window (I mean nothing to warn anything about connections being lost/reconnected or strategies being disabled / terminated)
7. my strategy outputs the text below
8. position is closed because the strategy is terminated
so the problem is that the strategy is getting terminated upon reconnect.
How can I avoid this?
note: I do have several CloseStrategy() calls in my code, however it cannot be one of them because all of them are preceded by print statements and none of those print statements appear in the output
this is the output (from my print code) I capture upon reconnect:
else if (State == State.Terminated)
else if (State == State.Configure) { ConnectionLossHandling = ConnectionLossHandling.KeepRunning; DisconnectDelaySeconds = 99999; NumberRestartAttempts = 999;
Comment