Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unable to Re-enable a Strategy

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

    Unable to Re-enable a Strategy

    Hi

    I have a strategy applied to a chart which is working fine. However, if I manually close a trade that is being managed by the strategy and the strategy is then disabled (as expected) it is not possible to re-enable it.
    I set 'Enabled' back to true, click apply or OK but the strategy does not load. If I go back into the 'Strategies' window, 'Enabled' has gone back to false.
    The only way around this is to remove the strategy and then re-load.

    Is this expected behaviour or am I missing something.

    Using NT7 Beta 14

    Thanks.
    Last edited by FatCanary; 04-15-2010, 01:40 PM.

    #2
    FatCanary,

    I just tried this with SampleMACrossOver and I was able to start up the strategy again. Can you please clarify the steps you are using to have the strategy disappear from the grid? Thank you.

    Anything in the Control Center logs?
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Hi Josh

      I had a strategy controlled trade running in SIM mode and manually closed it by clicking 'Close'. I went into the 'Strategies' window to set 'Enabled' back to true to restart the strategy. I clicked 'Apply' but the chart did not show the strategy so I clicked 'Close' but still no strategy running.
      I went back into the 'Strategies' window and 'Enabled' had gone back to false. I reset it to true and this time clicked 'OK' but still no strategy.

      The log only shows 3 entries (all the same timestamp) stating 'Disabled strategy...' and then one entry stating 'Disabling NinjaScript strategy...' but no errors.

      I've come across the same re-enable issue a few times after I have modified a parameter (whilst flat) but cannot now replicate.

      I have also just tried the SampleMACrossover and it restarts fine.

      Just tried to restart my own strategy and have noticed an error in the log - Failed to call method 'Initialize'...
      I've been running this strategy whilst it's been open in the NinjaScript editor. If I've made changes to it and not recompiled would this have any affect on the strategy restarting?

      Comment


        #4
        FatCanary,

        If you made changes you will want to add a new instance of your strategy for the changes to propagate through.

        The error is likely what is stopping your strategy. Please check into your Initialize() method code.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Hi Josh

          All that's in the 'Initialize() method is:

          protected override void Initialize()
          {
          SetStopLoss("", CalculationMode.Ticks, MyStopLoss, false);

          CalculateOnBarClose = true;
          }

          and this was generated with the strategy wizard.

          I'll review the situation to see if it happens again. In the meantime, thanks for the help.

          Comment


            #6
            Just for anybody else that may have encountered this issue:
            There was certain code within the strategy (nothing to do with Initialize) that caused the strategy to not 'run'.
            It compiled fine but I think I was trying to get the strategy to do something that it's just not possible to do!

            I've had this situation occur several times during development. I can't say exactly what the errors were as they were different each time.

            Comment


              #7
              Thanks for posting your findings!
              BrettNinjaTrader Product Management

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              605 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              351 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              105 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              560 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              561 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X