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 argusthome, 03-08-2026, 10:06 AM
        0 responses
        116 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        61 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        40 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        43 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        82 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X