Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Reinitialize indicator on Session Break

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

    Reinitialize indicator on Session Break

    Is there a way to reinitialize an indicator to start plotting fresh on a session break? I have a moving average that I'd like to start fresh each day instead of carrying over from the previous day. Any suggestions will be greatly appreciated...

    #2
    Hello leafsfan,

    Thanks for your post.

    Regrettably there is not without doing some custom coding to the moving average either based on a specific time or on a session break. Also, keep in mind that the moving average would require a number bars (period) before it is functionally correct.

    If you would like to modify an indicator to do this, I would be glad to assist you with links to learning Ninjascript.

    Alternatively if you would like we can provide a list of 3rd party programmers who could do this for you.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Regarding to session break, do you mean by using : BarsSinceSession for example ? or is there any simpler way?

      Comment


        #4
        Hello pstrusi,

        Thanks for your post.

        I'm not sure if you were responding to me or the thread starter but to share my thoughts, yes BarsSinceSession would be one way however the threadstarter might be wanting to not include the evening session so perhaps they might want to start at a specific time. The process would be the same in either case, simply clear out any variables and start the indicator again understanding the limitations of what re-initializing means in the context of what you are trying to measure.
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Hi Paul, yes, it was a quick question by curiosity, however I think the same, the best way to clear all variables out is through a time module. What I did was a simple script within the OnConnectionStatus methods, cause IB reset servers after every session, so I reset my Algo's variables as well.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Waxavi, Today, 02:00 AM
          0 responses
          2 views
          0 likes
          Last Post Waxavi
          by Waxavi
           
          Started by elirion, Today, 01:36 AM
          0 responses
          4 views
          0 likes
          Last Post elirion
          by elirion
           
          Started by gentlebenthebear, Today, 01:30 AM
          0 responses
          4 views
          0 likes
          Last Post gentlebenthebear  
          Started by samish18, Yesterday, 08:31 AM
          2 responses
          9 views
          0 likes
          Last Post elirion
          by elirion
           
          Started by Mestor, 03-10-2023, 01:50 AM
          16 responses
          391 views
          0 likes
          Last Post z.franck  
          Working...
          X