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 wzgy0920, 04-20-2024, 06:09 PM
        2 responses
        26 views
        0 likes
        Last Post wzgy0920  
        Started by wzgy0920, 02-22-2024, 01:11 AM
        5 responses
        32 views
        0 likes
        Last Post wzgy0920  
        Started by wzgy0920, Yesterday, 09:53 PM
        2 responses
        49 views
        0 likes
        Last Post wzgy0920  
        Started by Kensonprib, 04-28-2021, 10:11 AM
        5 responses
        192 views
        0 likes
        Last Post Hasadafa  
        Started by GussJ, 03-04-2020, 03:11 PM
        11 responses
        3,234 views
        0 likes
        Last Post xiinteractive  
        Working...
        X