• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy enable not reading options changes NT8 B12

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

    Strategy enable not reading options changes NT8 B12

    I had a similar problem to this thread
    https://ninjatrader.com/support/foru...ad.php?t=86233

    I started with the default settings in Options/Strategies/On Connection Loss
    My strategy was disabled by NT due to IB closing price connection for longer than 10 seconds.
    Attempted solutions:
    I go to Options/Strategies/On Connection Loss and change to Handling = Keep Running.
    However when I re-enable the strategy it does not read the new options settings. NT Output still says "Enabling NinjaScript strategy ... ConnectionLossHandling=Recalculate".
    I remove the strategy and re-add it. Enabling still says "ConnectionLossHandling=Recalculate".
    I stop and start NT. Enabling strategy still says "ConnectionLossHandling=Recalculate".
    However if I now remove and add the strategy and enable I finally get ConnectionLossHandling=KeepRunning
    But if I re-enable a strategy that was already added under the default options it still says
    "ConnectionLossHandling=Recalculate" .
    And weirdly if I now re-enable my strategy that was added after options change and NT restart, it flips back to "ConnectionLossHandling=Recalculate".
    I add the following line to SetDefaults in my strategy:
    ConnectionLossHandling = ConnectionLossHandling.KeepRunning;
    and re-enable the strategy but it still stubbornly says "ConnectionLossHandling=Recalculate"!

    There seems to be some code in B12 that tries to set ConnectionLossHandling.KeepRunning back to ConnectionLossHandling.Recalculate regardless of either the Options or even putting this line in code:
    ConnectionLossHandling = ConnectionLossHandling.KeepRunning
    Last edited by DaveE; 07-18-2016, 03:59 AM.

    #2
    Hello DaveE,

    So I may have a more complete picture of what is happening, would it be possible for you to send us a code sample containing your OnStateChange() method's source code?
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      I was using the example code from documentation for ConnectionLossHandling
      Code:
      protected override void OnStateChange() 
      {
          if (State == State.SetDefaults)
          {
              // Keeps the strategy running as if no disconnect occurred
              ConnectionLossHandling = ConnectionLossHandling.KeepRunning;
          }
      }
      However this example seems currently useless since something in NT is 're-configuring' back to ConnectionLossHandling=Recalculate between State.SetDefaults and State.Configure (even though I have Tools/Options/Strategies/On Connection Loss = Keep Running)

      I have found a work-around solution by moving
      Code:
      ConnectionLossHandling = ConnectionLossHandling.KeepRunning;
      into State.Configure

      Comment


        #4
        Hello, and thank you for your report. This behavior was confirmed on our end. We will be investigating this further. Please keep an eye on the NinjaTrader 8 Release Notes page for updates and bugfixes.

        http://ninjatrader.com/support/helpG...ease_notes.htm
        Jessica P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Velhinho, Today, 12:30 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by EF Hutton, Today, 12:36 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Melissa  
        Started by TraderIqbal, Today, 11:17 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by frankduc, Today, 11:42 AM
        3 responses
        11 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by bdelorm, Today, 11:10 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Working...
        X