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 f.saeidi, Today, 01:32 PM
          2 responses
          4 views
          0 likes
          Last Post f.saeidi  
          Started by alifarahani, 04-19-2024, 09:40 AM
          9 responses
          55 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by mmckinnm, Today, 01:34 PM
          3 responses
          5 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by Conceptzx, 10-11-2022, 06:38 AM
          3 responses
          60 views
          0 likes
          Last Post NinjaTrader_SeanH  
          Started by traderqz, Today, 12:06 AM
          9 responses
          16 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Working...
          X