Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to get indicator to restart count daily?

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

    How to get indicator to restart count daily?

    I was wondering how do I get the indicator to restart its count based on the data at the start of the new daily session rather than looking backward to the previous day data? Coz when I do intraday trades during the strategy backtesting, I get some false indicator signals in the opening hours.

    #2
    Restart count of what? You could reset anything you want to reset when you start a new session.

    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Basically it is to restart the count of all the indicators that I use in my strategy when the new session begins.

      So I will just have to add if (Bars.SessionBreak) to cover my previous code in strategy and the indicators will start counting afresh during a new session?

      Comment


        #4
        You just want to reset any counter you have back to 0 when you have a session break. You do not want to blanket your whole code with such an if-statement.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Josh View Post
          You just want to reset any counter you have back to 0 when you have a session break. You do not want to blanket your whole code with such an if-statement.
          It is actually not a counter but some indicator I use in my strategy. I illustrate what I am trying to do in the attached pic.
          Attached Files

          Comment


            #6
            tjendra,

            In that case there is no clear way to proceed. You would have to reset your indicator states through the indicator code at each new session break. Whether this means setting all your variables back to 0 I could not say. Even then, it looks like some MA indicator so setting back to 0 wouldn't help since you are still processing historical bars. You will need to tweak your indicator logic to compensate for what you want.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Is there some way to get the indicator to start plotting after a certain number of bars has passed so that it wouldn't get the values from the previous day and enough bars are produced for the indicator to start a new calculation?

              Comment


                #8
                No, you will need to rework the indicator logic.
                Josh P.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                582 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                338 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                103 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                554 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                552 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X