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 quantismo, 04-17-2024, 05:13 PM
          3 responses
          25 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by ScottWalsh, 04-16-2024, 04:29 PM
          7 responses
          34 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by cls71, Today, 04:45 AM
          0 responses
          5 views
          0 likes
          Last Post cls71
          by cls71
           
          Started by mjairg, 07-20-2023, 11:57 PM
          3 responses
          214 views
          1 like
          Last Post PaulMohn  
          Started by TheWhiteDragon, 01-21-2019, 12:44 PM
          4 responses
          547 views
          0 likes
          Last Post PaulMohn  
          Working...
          X