Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Loss of strategy functionality after loss of connection

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

    Loss of strategy functionality after loss of connection

    Hello,
    I trade using Ninjascript strategies that send trades to Interactive Brokers. Recently, Interactive Brokers advised me to log off and back on to TWS daily to ensure TWS stability. Since I have started doing this, my Ninjascript strategies appear to have lost some functionality as soon as I reconnect. When I reconnect, everything appears normal, and the strategies restart where they left off and make no syncing adjustments to my positions or orders. However, the following stops working:

    1) A piece of code that writes strategy status info to an external text file every hour
    2) A piece of code that adjusts the stoploss as the position becomes more profitable, through SetStopLoss()

    Both of these pieces of code execute as long as Position.MarketPosition is Long or Flat, which is pretty much every hour the strategy is turned on.

    My NinjaScript options have "Disconnect delay seconds" = 240, and Handling = KeepRunning, and I can easily reconnect within 240 seconds.

    Can you advise what might cause the loss of functionality, or what else might be going on?

    Thanks,
    Ian

    #2
    Hi Ian, which sync and startup options are you working with here? Which TWS and NT versions are used in the setup by you?

    So you only shutdown the TWS and restart in this case as IB's advice?
    BertrandNinjaTrader Customer Service

    Comment


      #3
      I did some additional troubleshooting and determined that after reconnecting to Interactive Brokers, if I disable the strategy and then re-enable it, the strategy will resync the stoplosses so they update properly, and writing to the external log file will resume.

      In short, disabling and re-enabling retores the strategy functionality.


      Thanks for your follow-up.

      Comment


        #4
        Thanks for letting us know this update, have a great 4th.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by jaybedreamin, Today, 05:56 PM
        0 responses
        2 views
        0 likes
        Last Post jaybedreamin  
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        18 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Jon17, Today, 04:33 PM
        0 responses
        1 view
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        6 views
        0 likes
        Last Post Javierw.ok  
        Started by timmbbo, Today, 08:59 AM
        2 responses
        10 views
        0 likes
        Last Post bltdavid  
        Working...
        X