I hoping for some advice to protect from disconnects during automated trading.
I want to start automated trading using 2 connections, connection 1 for data and connection 2 for broker orders only (no data). The problem I see is that if I get a disconnect from connection 1, NT8 will automatically switch to connection 2 for data for the period of disconnection and therefore my chart will have innacurate data as it will be a mix of data from connection 1 and connection 2. I do not want my chart data to become innacurate and needs to all come from conneciton 1 only at all times.
I would like to put some logic in place which will stop NT8 processing any chart data from connection2 in the event of disconnect from connection 1. Actually I don;t want connection 2 to ever supply chart data if that is an easier solution. I'm not sure how to program the logic within ConnectionStatusUpdate to switch off data from connection 2. I considered a simple logic that if connection one disconnects then use the Disconnect() method on connection 2 however I see 2 problems with this;
1. I ideally want to stay connected to the broker so that I can implement a failsafe to flatten everything if the connection 1 data does not reconnect within a set time period
2. If I disconnect() connection 2, I cannot see a way to reconnect connection 2 once connection 1 is established.
If anyone can suggest or share logic to turn off the data from connection 2 that would be most appreciated.
Thanks for any input.
Comment