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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        117 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        166 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        85 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        130 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        88 views
        0 likes
        Last Post PaulMohn  
        Working...
        X