Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Yet another connection loss-question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Yet another connection loss-question

    Hi,
    I'm still having problems with occasional connection losses. In case of a connection loss, the output is: "strategy xyz lost price connection but will keep running" - but in fact it doesn't. To prove this I've inserted a print-statement in onBarUpdate() which won't be executed anymore after a connection loss and a re-establishment of the price-feed connection.
    In the strategies tab I've set Handling to KeepRunning. I would have expected that the strategy just keeps on running, and when the price connection reappears, all the event-driven methods such as onBarUpdate() will be executed again. However this doesn't seem to be the case.
    Also I don't really understand the difference between KeepRunning and recalculate.

    Thank you very much in advance for your help.

    #2
    Ignignokt, what datafeed / broker are you using here? Do you loose the connection only partially, so only the price feed?

    KeepRunning will pretend no disconnect occured and thus simply resume the strategy actions once connectivity is back.

    Recalculate reruns all historical calcs up the the reconnection point and if the connection held 'stable' for the RestartDelaySeconds set.

    Comment


      #3
      Hi Bertrand,
      I'm using IB as a broker and datafeed. The problem does only occur on full connection losses (datafeed+order server), i.e. when TWS shuts itself down.

      Whenever this occurs I have to disable and re-enable my strategies.

      Comment


        #4
        Ignignokt, that would be unfortunately expected in this case, a solution would be consistently changing the TWS shutdown time so it would not occur during the week. I would suggest a Google search around that topic since there are 3rd party tools out there that help with this process.

        Comment


          #5
          I know about the restrictions concerning TWS, but as far as I know there's no way to keep up the connection over the weekend.
          Why does NT handle (full) connection losses that way? Is this what you think is the best solution for system traders? - Please don't get me wrong, I'm really just trying to understand things.

          Comment


            #6
            Ignignokt, I can understand your perspective here for sure, but that's not something that NT would impose on the connection handling, but the IB API demands a reconnect in this case.

            Comment


              #7
              My latter question was absolutely honest: I was wondering why your developers chose this behaviour. From my point of view it doesn't fit to what I am used to from other platforms or to what I would expect. I think NT-strategies should just keep on running when the connection is re-established, no matter if there was a 1 second connection loss to the datafeed or a 3 days connection loss to the broker server.

              So is there a work-around? Would I be able to keep on trading without having to restart my strategies with the recalculate-setting?

              Maybe I should tell a few words about the background of my questions. At the moment I'm running just 3 strategy-instances on one account to evaluate NT. But having to restart my strategies on every connection loss would absolutely keep me from expanding my trading until NT's behaviour won't be changed or I find a work-around. We're currently running 30+ strategy instances on 11 accounts with Metatrader and jForex. Migrating this constellation 1:1 to NT would result in non-acceptable manual efforts.

              Comment


                #8
                Ignignokt, for the complete connection loss where you would need to reconnect to TWS : you would unfortunately need to restart / enable your strategies, for a partial connection loss that could be restored you could give the strategies more time / restart attempts until the connection is recovered as needed :

                Comment


                  #9
                  Well, maybe there's still some room on the feature-list of any upcoming version for this issue. Would make life a lot easier for system traders. This, and getting access to the account balance to be able to set up a precise money-management.
                  For us this is not so much a nice-to have, it's more of a KO-argument against NT.

                  Comment


                    #10
                    Thanks for the feedback, I will make sure to have it added to our tracking lists - for the account balance you could use :



                    What are you missing for the money management calcs?

                    Comment


                      #11
                      Thank you! I'm wondering where this feature comes from!? We've discussed this just a few weeks ago: http://www.ninjatrader.com/support/f...ad.php?t=38030
                      I said:
                      I'm still looking for a "best practice" approach to realize fixed fractional position sizing in NT. This is actually a really basic concept, yet it seems difficult to realize in NT, since it's not possible to get the current account balance.
                      So either this is a brand-new feature or I wasn't able to make clear what I needed!
                      But thank you anyway and have a nice weekend.

                      Comment


                        #12
                        This is not a new feature, introduced with NT7 - you asked for access to the account positions, this would still not be possible, but those 3 accountitems are supported for access through NinjaScript.

                        Enjoy your weekend as well!

                        Comment


                          #13
                          Hi Bertrand,
                          now we have a situation like mentioned before in this thread but the effect is different than expected: a strategy opened a position on friday evening which was not closed until end of the trading session. Also 1 LMT-order (Takeprofit) and 1 Stop-Order (Stoploss). Over the weekend TWS shut down.

                          A few minutes ago I recreated the TWS-connection and restarted the strategy. Then 2 things happened which I don't understand:

                          1. NT cancelled the LMT-Order. Then a NT-popup showed "Unable to cancel out live orders. Strategy ... was not started". In fact the strategy wasn't started. I've tried to start the strategy 4 times.

                          2. Then NT closed my position. Closing this position had absolutely nothing to do with my strategy! Also the Stop-Order was cancelled. The strategy was still not started. Even after the position was closed AND there were not more pending orders the strategy wouldn't start and still say "Unable to cancel out live orders. Strategy ... was not started".

                          In the strategies tab I have unchecked both options that would allow NT to delete pending orders. So why did NT cancel my LMT-/STP-orders and close this position?

                          I made a loss of 397 EUR on this trade plus x for potential profit.
                          Last edited by Ignignokt; 08-21-2011, 04:15 PM.

                          Comment


                            #14
                            I'd like to add question #3: a minute ago I've switched to another market while watching a chart. Then NT crashed. After having restarted NT and re-enabling my strategies, it closed another open position.
                            Loss this time: 41 EUR plus x.

                            Comment


                              #15
                              Ignignokt, if you reenable a strategy it would get up to 40 secs to map any historical orders to live ones seen and it would have to be a 100% match, if this is not possible the strategy would be terminated and the position attempted to be closed (default error handling taking over).

                              The different case scenarios for the possible startup options are listed and explained here -

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by NullPointStrategies, 03-13-2026, 05:17 AM
                              0 responses
                              87 views
                              0 likes
                              Last Post NullPointStrategies  
                              Started by argusthome, 03-08-2026, 10:06 AM
                              0 responses
                              151 views
                              0 likes
                              Last Post argusthome  
                              Started by NabilKhattabi, 03-06-2026, 11:18 AM
                              0 responses
                              79 views
                              0 likes
                              Last Post NabilKhattabi  
                              Started by Deep42, 03-06-2026, 12:28 AM
                              0 responses
                              53 views
                              0 likes
                              Last Post Deep42
                              by Deep42
                               
                              Started by TheRealMorford, 03-05-2026, 06:15 PM
                              0 responses
                              62 views
                              0 likes
                              Last Post TheRealMorford  
                              Working...
                              X