Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

stop and start strategy

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

    stop and start strategy

    Hello, I have a question on the workings of stop/start strategy from the strategies tab: if I start a strategy after using RightClick-> New Strategy I undestand the Initialize() is executed, and the OnBarUpdate() is ready to be triggered and being executed.

    Now what happens if I stop a running strategy and start it again by pressing the start button? Is the Initialize() member function executed?

    In other terms, if I stop and start the strategy, do I get a new instance of the object, or is it still the same, and therefore Initialize() is not executed?

    Thanks

    #2
    You get a new instance.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Do you mean that when pressing start (after stopping) Initialize() is executed and the variables are reinitialized?

      Comment


        #4
        No. You can see when Initialize() is called by adding a print command into it. You should not be placing variable initializes in there. You should do that in the Variables section of the code.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by set2win, 08-04-2021, 09:23 AM
        39 responses
        1,000 views
        0 likes
        Last Post WaleeTheRobot  
        Started by md4866, Today, 08:15 PM
        0 responses
        7 views
        0 likes
        Last Post md4866
        by md4866
         
        Started by mjbatts91, Yesterday, 04:48 PM
        2 responses
        23 views
        0 likes
        Last Post mjbatts91  
        Started by pibrew, Today, 06:10 PM
        1 response
        19 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by actualfacts.2021, 07-25-2021, 03:11 PM
        8 responses
        1,188 views
        0 likes
        Last Post linkcou
        by linkcou
         
        Working...
        X