Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Why no Enable(), if we have Disable()?

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

    Why no Enable(), if we have Disable()?

    Any possibility of providing an Enable() method to Strategies? If we have Disable(), why not a method to Enable() at some later time, after Disable()ing?

    #2
    Originally posted by koganam View Post
    Any possibility of providing an Enable() method to Strategies? If we have Disable(), why not a method to Enable() at some later time, after Disable()ing?

    I wonder if one could follow the same template and Create a Strategy, like creating an indicator.

    I can declare a variable of a strategy,

    Code:
    private SampleMACrossOver  strat1;
    But NT won't let me know what the constructor is. And I'm not about to guess all those parameters.

    Code:
    strat1 = SampleMACrossOver  ( ???, ???, ??? );

    (The code section for the constructor isn't available in the NTScript source, like for an indicator).

    Even the Sample ATM Strategy takes a special call to create in code.

    Looks like things have been really locked down.

    And disable applies only to the current object, would be kind of hard for it to get called after that to be re-enabled?...

    Unless you are past all my questions, and have points to objects, and can Disable a strategy from some where else. If you do, I have more catching up to do.

    Comment


      #3
      Hello koganam,

      Thank you for your post.

      There is no method to 'enable' a strategy after it has been disabled in NinjaScript.

      There is the option to use 'Enabled = true;', however this cannot be called after a strategy is disabled as the strategy is no longer running at that point.

      Looking into using another strategy that runs continuously and enables and disables other strategies may be a feasible option to your inquiry, unfortunately we do not have documentation on this.

      I will forward this to our development team as a suggestion for potential implementation in a future release of NinjaTrader.

      Comment


        #4
        Hello koganam,

        Thank you for your patience.

        This suggestion has been added with the unique tracking Id # of 2321.

        As suggested by my colleague, an option would be instead of disabling just halt calculations and start them in your strategy based on your conditions within the strategy.

        Please let me know if I may be of further assistance.

        Comment


          #5
          Originally posted by NinjaTrader_PatrickH View Post
          ... As suggested by my colleague, an option would be instead of disabling just halt calculations and start them in your strategy based on your conditions within the strategy.

          Please let me know if I may be of further assistance.
          Well that is already what we do with a Time Filter.

          My query was more directed at the inability to enable a strategy, but being able to disable the strategy in code. I was thinking more in terms of being able to reenable a strategy, in the event that I am not in front of the computer when it gets disabled for any reason.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          83 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          47 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          29 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          32 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          66 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X