Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Do stratgies get turned off completely after session is over?

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

    Do stratgies get turned off completely after session is over?

    in my strategy, i set a timer (System.Timer) that is set to trigger after the session on my chart has ended

    this timer never triggers

    my question is, does a strategy turn completely off after the session is over?
    is this the reason my timer does not fire?

    #2
    Hello,

    A strategy needs an incoming tick to trigger an iteration of you OnBarUpdate() block. So the answer is yes.
    Hopefully that helps.
    DenNinjaTrader Customer Service

    Comment


      #3
      To clarify: OnBarUpdate only would be triggered as ticks come in (like Ben said). However, your System.Timer would be triggered regardless -> there is something wrong your code. Please consult the Microsoft documents for how to properly use System.Timer.

      Comment


        #4
        my timer starts when the last bar of the session starts. i use 15 minute bars

        i set the timer to 1 millisecond and it triggers fine

        when i set the timer to 900,000 milliseconds (15 minutes) it does not trigger

        Comment


          #5
          Then your code most likely disables the Timer. There is nothing NT could to prevent a Timer you coded triggering, unless your code disabled that timer. I suggest debugging your strategy by putting in Print() statements where you code enables or disables the timer or where the timer is triggered.

          Comment


            #6
            i have print statements where the timer is started and when the timer is triggered

            the timer is never disabled in my code.

            Comment


              #7
              Please provide a simple as possible scenario to reproduce your issue. This should include:
              - a simple as possible strategy
              - any setup information needed to reproduce the problem

              Thanks

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              558 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              324 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              101 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              545 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              547 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X