NinjaTrader won't reconnect (AKA I hate this software so much!)
I've been having a really rough time with trying to keep NT running overnight for a simple open to close strategy. I'm using Kinetick and IB for data and broker. About 20% of the time, there is some sort of brief connection outage, and it causes NT to not execute the strategy. Sometimes it disconnects completely, but sometimes it says it is connected, and doesn't receive new data, doesn't update the chart, and doesn't seem to trigger onBarUpdate in the strategy. My restart settings, in both Options panel, and in the strategy, are:
Disconnect Delay Settings: 1200
Number of restart attempts: 4000
Restarts within X minutes: 300
Restart Handling: Recalculate
Dealing with NinjaTrader support has been frustrating. It was clear that they didn't look at my logs. At first they said, oh you need to restart TWS every day (as if I wouldn't realize that TWS was shutting itself down everyday for the last 4 months). And now they say that Kinetick requires a daily reconnect. This doesn't sound correct since first of all, I always restart NT and reconnect to all data provider /brokers every night (since TWS forces me to), and second, I would think it should happen more regularly (like how TWS force quits). The support rep doesn't seem to believe that I restart each day, and only took a look at my logs after the 3rd exchange:
"What I see in your trace is that Kinetick gets a disconnect and then while it attempts to reconnect it losses a connection again. This results in Kinetick getting stuck in a connection loop. This is your issue. This is know to be more likely to happen when a daily restart is not completed which is why it is recommended with Kinetick.
Development has improved the connection handling for when this happens with NinjaTrader 8."
It is frustrating to be told that this is MY issue, when they seem to be unable to consistently keep a connection to their own supported and preferred data provider. This doesn't do me much good seeing how NT8 isn't out yet, and there is not official ETA. If things really work better, I think they should backport a fix to NT7. They did mention a workaround using IQFEED instead of Kinetick, but using my Kinetick login, which I will try, though I am nervous because I have had similar issues with IB, though not as frequently.
Anyhow, I'm writing partly to see if anyone has any advice with a similar issue (best restart settings in the Options panel?), and partly as a cautionary tale for those considering NT as a automated trading platform. It just doesn't seem robust enough for prime time. I wrote in another thread that I'm planning on transitioning to something else, and I am in process, but it is taking time.
The following user says Thank You to hayday for this post:
I am on IQfeed, machine runs overnight without problems.
Disconnects happen rarely, but connection re-establishes smooth.
It also alows me to use the BaBar tool to download historic tick data for the GOMI tools, in case my machine was not running to record the data.
The following user says Thank You to rleplae for this post:
When I was running NT+Kinetick it would never disconnect. I had it running pretty much 24x7 without restarting Ninja. BUT, every night at either 11 or 11:30PM Central IB would disconnect and take a minute or two to reconnect. I don't think it was a Ninja issue since I could see the IB TWS trying to reconnect in the background. I figured it was something on IB's side like rebooting servers or maintenance or something.. but Kinetick never disconnected on me.
The following user says Thank You to sman73 for this post:
Howdy @hayday no clue and no help But have you ruled out all other possibilities on your end: i.e.
router, firewall, ISP, etc....??
I ask because obviously here there would be more posts if was Global problem--Meaning if alot of people experiencing same or similar issues would without a doubt be speaking up here at futures.io (formerly BMT).
Last edited by learning0101; August 20th, 2014 at 06:45 PM.
Reason: thought of more
The following user says Thank You to learning0101 for this post:
Interactive Brokers (at least when I used them) has a nightly maintenance where there are one or more disconnects shortly after midnight (ET). These usually last from less than a minute to several minutes. Sometimes NT is not able to reconnect from one of these. Also IB has a forced daily disconnect where you can specify the time of the disconnect in the IB Trader Workstation software.
In my opinion IB is not very user friendly for anyone interested in 24hr trading such as automation. That is why I eventually disconnected them as one of my brokers.
The following user says Thank You to Seahn for this post:
There have been times when it has been on my end, but I suspect most of the time it is temporary outages at either IB or Kinetick because they rarely go down together. It's almost always one or the other. I'm surprised others aren't seeing it. And they do not happen at regular times. It's all different times throughout the night. Short of colocating a server, I don't know what to do to make my network more reliable. Fairly new router and cable modem. Internet in general seems to stay up even while certain data connections go down.
And yes, I definitely know about the TWS daily shutdown. That's why I have to restart NT every night, which I've grown to accept.
My concern isn't with the outages themselves. I just feel that NT should be able to gracefully reconnect. They have all these settings that make it seem like it should, but it is rare that it happens for me. Perhaps there is some optimal set of settings for these like Disconnect Delay Seconds, but I certainly don't know it. I set the settings to basically try for as long as reasonably possible. But it doesn't seem to help. I know there was some bug where reconnect took half an hour due to TCP/IP timeouts, but that doesn't seem to be my issue. It never reconnects when it goes down.
The following user says Thank You to hayday for this post:
Before you condemn NT you need to get a good data provider. IB's data is very poor and as was stated above. IB disconnects daily. Reconnection issues when the data provider drops out is not an NT problem.
I used to have IB and now I don't.
There are many threads about the disconnect issue with IB.
As far as I know, no one has resolved the disconnects issue.
If there were a solution, it would be for your strategy to reconnect after a data drop. This would require a script to run after a set number of minutes to reconnect. If it fails, then reconnect again after the time out period.
If you still don't like NT then perhaps you should get another platform. You will find the same disconnects with everyone.
Rejoice in the Thunderstorms of Life . . .
Knowing it's not about Clouds or Wind. . .
But Learning to Dance in the Rain ! ! !
The following 3 users say Thank You to DavidHP for this post:
Echoing what @DavidHP said, I too, had multiple disconnects when using IB several years ago. Finally switched to Mirus/Dorman/Zenfire and the problems magically disappeared, until the ZenFire fiasco. Then switched to Optimus / Rithmic. Again - no disconnects, unless I lose internet connection, which sometimes happens during thunderstorms, etc., but it's not the fault of Optimus or Rithmic.
My suggestion - drop IB and get another data provider. It's not worth it for the low commissions IB offers, considering what you have to put up with.
And, I don't have to fool around with that annoying TWS daily signoff / sign back on S**T!
After all, it's what you learn AFTER you know it all, that counts!
The following 3 users say Thank You to TheWizard for this post:
As the thread going in the direction of IB disconnects - wanted to re-iterate an option to avoid the daily disconnect issues with IB TWS. Once connected to IB Gateway - it stays on until you physically disconnect ( No daily disconnect issues)
Solution - Use IB Gateway instead of IB TWS
Way to connect to IB Gateway using NT(with proper portmap ofcourse):
- Launch IB Gateway - Connect using real account
- Launch IB TWS - connect using edemo account
- Launch NT
- Connect from NT - This would just check if TWS is active or not - but actually connect to IB gateway ( as long as you have proper ports configured )
- Now you can close IB TWS
- NT would continue to work with IB Gateway
This would solve the annoying issue of daily disconnects of IB TWS...
The following 3 users say Thank You to ejtrader for this post: