NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > Application Technical Support > Connecting

Connecting Support for establishing connections to your broker or market data service provider.

Reply
 
Thread Tools Display Modes
Old 07-25-2012, 04:44 AM   #1
jbesada
Member
 
Join Date: May 2012
Posts: 73
Thanks: 3
Thanked 0 times in 0 posts
Default Connections break down

Hello,

I have a connection problem with my broker. In a first time IB lost the connection, NT detects it and tries to reconnect.
After several retries (between 5-10 minutes) IB reconnect again but NT seems to be not able to detect it and after the retries configured, it ends disabling the strategy.
So, the problem starts in IB but NT seems to don’t handle it properly.
I have detected the same behavior several nights. Is there any way to improve the robustness of NT retries?

Please, find a piece of the log file (time in GMT +1):

25/07/2012 5:59:05|1|2|Interactive Brokers: Primary connection=Connected, Price feed=ConnectionLost
25/07/2012 5:59:05|3|128|Strategy 'PairStrategy/34b3f18d0421464482db42bcfa3f7261' lost price connection but will keep running.
25/07/2012 5:59:17|1|2|Interactive Brokers: Primary connection=Connected, Price feed=Connected
25/07/2012 6:01:01|1|2|Interactive Brokers: Primary connection=Connected, Price feed=ConnectionLost
25/07/2012 6:01:01|3|128|Strategy 'PairStrategy/34b3f18d0421464482db42bcfa3f7261' lost price connection but will keep running.
25/07/2012 6:02:26|1|2|Interactive Brokers: Primary connection=Connected, Price feed=Connected
25/07/2012 6:26:25|1|2|Interactive Brokers: Primary connection=ConnectionLost, Price feed=ConnectionLost
25/07/2012 6:26:25|3|128|Strategy 'PairStrategy/34b3f18d0421464482db42bcfa3f7261' lost order connection but will keep running.
25/07/2012 6:26:25|3|128|Strategy 'PairStrategy/34b3f18d0421464482db42bcfa3f7261' lost price connection but will keep running.
25/07/2012 6:27:24|1|2|Interactive Brokers: Primary connection=Connected, Price feed=Connected
25/07/2012 6:27:24|1|64|Instrument='HG 09-12' Account='DU111745' Avg price=3,3689072 Quantity=1 Market position=Short
25/07/2012 6:27:24|1|64|Instrument='SI 09-12' Account='DU111745' Avg price=26,970464 Quantity=1 Market position=Long
25/07/2012 7:28:10|1|2|Kinetick Real Time: Primary connection=ConnectionLost, Price feed=ConnectionLost
25/07/2012 7:28:11|1|2|Kinetick Real Time: Primary connection=Connected, Price feed=Connected
25/07/2012 7:28:11|3|128|Strategy 'PairStrategy/34b3f18d0421464482db42bcfa3f7261' lost price connection but will keep running.
25/07/2012 7:28:11|1|2|Kinetick Real Time: Primary connection=ConnectionLost, Price feed=ConnectionLost
25/07/2012 7:28:11|1|2|Kinetick Real Time: Primary connection=Connected, Price feed=Connected
25/07/2012 7:28:11|3|128|Strategy 'PairStrategy/34b3f18d0421464482db42bcfa3f7261' lost price connection but will keep running.
.
.
.
25/07/2012 7:30:43|1|2|Kinetick Real Time: Primary connection=ConnectionLost, Price feed=ConnectionLost
25/07/2012 7:30:43|1|2|Kinetick Real Time: Primary connection=Connected, Price feed=Connected
25/07/2012 7:30:43|3|128|Strategy 'PairStrategy/34b3f18d0421464482db42bcfa3f7261' lost price connection but will keep running.
25/07/2012 7:30:43|3|128|Strategy 'PairStrategy/34b3f18d0421464482db42bcfa3f7261' lost price connection more than 100 times in the past 1 minutes and will be disabled.
25/07/2012 7:30:43|1|128|Disabling NinjaScript strategy 'PairStrategy/34b3f18d0421464482db42bcfa3f7261'

Regards
jbesada is offline  
Reply With Quote
Old 07-25-2012, 04:53 AM   #2
NinjaTrader_Jason
NinjaTrader Customer Service
 
NinjaTrader_Jason's Avatar
 
Join Date: Aug 2007
Location: Breda, Netherlands
Posts: 11,324
Thanks: 92
Thanked 354 times in 345 posts
Default

Hello jbesada,

The log information displays you are re-connected after each disconnection you experienced with IB.

I see strategies are disabled if you experience a disconnection 100 times in one minute. Am I corrrect you experience many disconnections/re-connections during 7:30?

You could also set Handling to KeepRunning at Control Center-->Tools-->Options-->Strategies-->NinjaScript-tab. Subsequently automated strategies will continue to run during a disconnection. More information can be found at the link below.
http://www.ninjatrader.com/support/h...tegies_tab.htm

We realize that lost connections can be frustrating. A connection state between NinjaTrader and your broker/market data vendor is not dictated by NinjaTrader. The NinjaTrader application only reports the connection state as it is reported by the API you are connected through. NinjaTrader behaves like a radio receiver in that it receives signals from the connected server. If the signals are not coming through, the underlying broker/market data vendor API reports this to the NinjaTrader application which in turn reports this back to you. Once a loss of connection is reported, NinjaTrader or the underlying API will continuously try to re-establish a connection.
Common reasons that contribute to connection stability are:
  • ISP issues
  • Hardware firewall changing IP addresses frequently
  • Dynamic IP addresses changing frequently intraday. Usually this happens once a week but you may want to check with your ISP. If they do change daily, requesting a static IP address may help.
  • Broker/market data servers may be experiencing temporary downtime
NinjaTrader_Jason is offline  
Reply With Quote
Old 07-25-2012, 05:24 AM   #3
jbesada
Member
 
Join Date: May 2012
Posts: 73
Thanks: 3
Thanked 0 times in 0 posts
Default

Hi,

KeepRunning was already active as you can see in the log.

I agree Broker is losing the connection (I have checked it in broker logs), but Broker is recovering the connection several minutes after but NT doesn’t. I have checked broker logs and connection is running again while NT is trying to reconnect with Broker without success (100 times every minute).


My broker has answered me that in this time window (05:45 - 06:45 CET) they can shut down server for maintenance several minutes.

So, to summarize, reconnection between NT and IB API is not working fine in some situations. I have tested it with manual disconnect and reconnection works fine, but in real situation during the night reconnection fails.

Regards
jbesada is offline  
Reply With Quote
Old 07-25-2012, 05:33 AM   #4
NinjaTrader_Jason
NinjaTrader Customer Service
 
NinjaTrader_Jason's Avatar
 
Join Date: Aug 2007
Location: Breda, Netherlands
Posts: 11,324
Thanks: 92
Thanked 354 times in 345 posts
Default

Hello jbesada,

The information you included displays you are re-connected after each IB disconnection. Once you are re-connected to IB at 6:27, you experience disconnections with Kinetick. Can you please send me all logs and trace files. Go to Control Center-->Help-->Mail to Support in NinjaTrader. Put 'Attn Jason, Connections break down' in the subject field and enable 'Log and trace files'.
NinjaTrader_Jason is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Code Break buylosellhi General Programming 8 09-20-2011 03:02 PM
Break Even in OnOrderUpdate daxtrading Strategy Development 2 06-20-2011 07:10 AM
break out questforconsistency Strategy Analyzer 6 10-18-2010 07:46 AM
Break out maninjapan Strategy Development 31 04-16-2009 12:17 AM
Pivot line shifts at day break, not session break?? billy822 Charting 4 03-23-2009 10:19 AM


All times are GMT -6. The time now is 07:40 PM.