I've managed to develop a strategy that is giving good results in backtesting, and I've been trying to forward trade it, and for the first time it's actually getting as good of results in live trading as it was in backtesting, which means I might really have an automated trading vehicle for the first time.
However, a critical snag has come along due to the fact that MB Trading's forex order servers seem to disconnect on average about 4 times per day between 1am and 6:30am which is also the specific time of day that my strategy is doing the best for returns - IF it can keep running.
What's happening is the MB Trading order server will disconnect for a minute at a time, and my strategy will try to either initiate a new position and get terminated (not so bad, just lose a chance for a gain is all)
or it will try to close down a losing position (I must not use stop losses, but rather market orders and reverse direction) and this is very bad because the strategy will terminate with me in an open position and I've woken up to having my account 10% down from the night before because of this.
Can someone please tell me if there's a way to simply have my strategy check if it is connected to the order server before trying to place an order? I've noticed in my log files that it will say "Disconnected from perm server" multiple times through the day, so Ninjatrader is aware of the disconnection -- so would using something like
if(ConnectionStatus == ConnectionStatus.Disconnected)
return;
(then try to manage positions after a reconnection)
Be starting in the right direction?
Thank you for taking a look at this!
Also, can anyone say whether Interactive Brokers has frequent disconnects like MB Trading does? I'm thinking of moving over to them if this keeps up because if I can't get a workaround for the connection - termination thing, I will have to either decide to stop trading it between midnight and 7am which is prime time for gainful trades, or changing brokers.
Thanks!
Comment