Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to make sure indicator is calculated until last (existing) bar

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

    How to make sure indicator is calculated until last (existing) bar

    I would like to create a list until last bar. What is the best way I should do it in a indicator?

    Should I create a list in "OnBarUpdate()" or on region "Miscellaneous"?

    Please help. thanks

    #2
    Hello LadGta2018,

    When you say a list until last bar, do you mean a series of data that gets updates similar to the Close series?

    Your title implies that you want to call update on the indicator to make sure its updated, can you provide a little more detail about what you want to do or if you are seeing a problem what problem you are having?


    I look forward to being of further assistance.

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello LadGta2018,

      When you say a list until last bar, do you mean a series of data that gets updates similar to the Close series?

      Your title implies that you want to call update on the indicator to make sure its updated, can you provide a little more detail about what you want to do or if you are seeing a problem what problem you are having?


      I look forward to being of further assistance.
      Thanks for your quick response.

      What I would like to do is: When the last bar is closed, the indicator will create a list (points).

      If I put it in "OnBarUpdate()", it will be check every time when the bar got updated. Is there any section in NT indicator, the code got executed when the last bar is closed? what is the best way I should do?

      Thanks

      Comment


        #4
        Hello LadGta2018,

        OnBarUpdate would be what is called for the bar close events, I am not certain I understand the question as it is worded. Are you asking to do something once per bar, not necessarily once per OnBarUpdate assuming you were using OnEachTick calculation.

        I look forward to being of further assistance.

        Comment


          #5
          Originally posted by NinjaTrader_Jesse View Post
          Hello LadGta2018,

          OnBarUpdate would be what is called for the bar close events, I am not certain I understand the question as it is worded. Are you asking to do something once per bar, not necessarily once per OnBarUpdate assuming you were using OnEachTick calculation.

          I look forward to being of further assistance.
          Thanks for response.

          No, I am not do something once per bar. I only want to do it once when the last bar is closed.

          for example, there are 100 bars in the chart. I only want to do something when the 100th bar is closed. only do it once.

          Comment


            #6
            Hello LadGta2018,

            Thanks for the example, You can use the State for this:
            if(State == State.Realtime)

            You could do your calculation the first time the state is seen which would be after the 100th bar is closed assuming that was the last historical bar.



            Please let me know if I may be of additional assistance.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Today, 05:17 AM
            0 responses
            38 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            124 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            64 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            41 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            46 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X