Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

"Reset" Strategy

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

    "Reset" Strategy

    I am sure this is not a common request, but I am hoping an NT guru has some insight into less used features (intentional or not).

    I would like to be able to "reset" a strategy on a chart programmatically. Basically it would reapply the strategy to the bars. Obviously NT does this already (the first time the strategy is added) and I am hoping that it can be done with a call (set of calls) from inside the strategy itself.

    Is there a way to "start-over" from within a strategy?

    #2
    Hello Wbmstrmjb,

    Thank you for your post and welcome to the NinjaTrader support forum!

    You may be looking to reset your values on each trading day, if you are looking for this or on how to reset values please visit the following link for a reference sample detailing how to reset the values: http://www.ninjatrader.com/support/f...ad.php?t=19182

    Please let me know if you have any questions.

    Comment


      #3
      Thanks, but that is not what I am referring to. I mean reset the whole thing.

      Assume we are looking at Daily bars for the past month.

      Strategy currently goes long on 2nd day, short on the 5th, long again on 12th, back to flat on 15th....

      Now in code I want to "reset" the whole thing (because maybe I have changed the strategy programmatically). Now it "reapplies" the strategy to the chart and the new one goes long on 3rd day, short on 4th, etc... A whole new series.

      I know it's not this easy, but something like calling "Initialize()" again to start over.

      Comment


        #4
        Hello Wbmstrmjb,

        Thank you for your response.

        This would require manual input to disable and re-enable the Strategy, there are no supported methods in NinjaScript to achieve this.

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

        Comment


          #5
          That seems to be a very simple thing to implement. This one feature alone would make NT leaps and bounds better than the rest. I just finished trialing MultiCharts.NET with the hope that it did something similar and it does not.

          This would allow advanced developers to really create some amazing strategies based on tweaking their logic based on performance. Things like hill-climbing algorithms and genetic algorithms would be possible.

          This should be added to NT8. Easy addition and would really set NT apart from the competition.

          Comment


            #6
            Hello Wbmstrmjb,

            Thank you for your response.

            Correction here as this is possible via the use of Enabled = true; and Enabled = false;

            Any of the Parameters for your Strategy can be accessed in a similar manner.

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

            Comment


              #7
              That actually doesn't do it. It just "pauses" the strategy until Enabled is "true" again. Need to reset. I am thinking this might not be implemented, but it could be very easily.

              Comment


                #8
                Hello Wbmstrmjb,

                Thank you for your response.

                Please define what items you are looking for the strategy to disable/reset.

                Comment


                  #9
                  I think I did pretty clearly in the original request. The effect would be identical to removing and then reapplying a strategy. "Start-over" if you will. If I have 100 bars in the chart, I want the "start-over" to apply to all 100 bars.

                  Comment


                    #10
                    Hello Wbmstrmjb,

                    Thank you for your response.

                    This is done with the Enable parameter. Set to True to enable, set to False to disable. There is no other method to achieve this item.

                    Comment


                      #11
                      That is for the GUI. That is not true in code. If you do:

                      Enabled = false;
                      Enabled = true;

                      It does not reset anything. It does not start over.

                      Comment


                        #12
                        Originally posted by Wbmstrmjb View Post
                        That is for the GUI. That is not true in code. If you do:

                        Enabled = false;
                        Enabled = true;

                        It does not reset anything. It does not start over.
                        You would have to use SendKeys to send the F5 key. which is just emulating how you manually start over to begin with.

                        Comment


                          #13
                          No, that doesn't do it either. I am not trying to screen scrape the GUI and fake the button clicks. I am INSIDE a strategy and just want to restart it. It really shouldn't be this hard.

                          Comment


                            #14
                            Originally posted by Wbmstrmjb View Post
                            No, that doesn't do it either. I am not trying to screen scrape the GUI and fake the button clicks. I am INSIDE a strategy and just want to restart it. It really shouldn't be this hard.
                            ??? SendKeys is a programming instruction, sent from inside code, not a screen scrape.

                            Comment


                              #15
                              Seriously? Yes I know what SendKeys does. You clearly missed the exaggeration of my post. Anyone using SendKeys is not developing software, they are making hacky garbage (ie screen scrape, faking button clicks).

                              I am surprised there are not more software developers in this space. Or if there are, they hide in the shadows so as not to divulge anything. It seems that most of the content in the support forums are from (semi-)experienced traders pointing out slight calculation/timing errors with NT, or wannabe programmers asking how to make a line blue.

                              Is this really not the solution for anyone trying to make a real automated trading system? It seems NT is for the day trader who wants to try and automate his thought process with a few dozen or MAYBE hundred lines of code, and not for any real automation.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              668 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              377 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              110 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              575 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              580 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X