Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Does the built-in Time DataSeries refer to beginning or end of bar?

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

    Does the built-in Time DataSeries refer to beginning or end of bar?

    Does the DateTime from builtin Time DataSeries refer to beginning or end of bar?

    For example, will Time[0] give me the DateTime of the start of the current bar or the end?

    #2
    Hello overflowing,

    That will depend on the settings of CalculateOnBarClose (COBC) setting. If COBC is true then it will give you the Time[] at the end of the current bar. If COBC is false, then it will be the Time[] of the incoming tick data from the provider from within the current bar.

    You can see more information about COBC on the following link.
    http://www.ninjatrader.com/support/h...onbarclose.htm

    Here is a forum post that you may want to read that goes over using [] brackets.
    http://www.ninjatrader.com/support/f...ad.php?t=19346

    Let us know if we can be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_JC View Post
      Hello overflowing,

      That will depend on the settings of CalculateOnBarClose (COBC) setting. If COBC is true then it will give you the Time[] at the end of the current bar. If COBC is false, then it will be the Time[] of the incoming tick data from the provider from within the current bar.

      You can see more information about COBC on the following link.


      Here is a forum post that you may want to read that goes over using [] brackets.


      Let us know if we can be of further assistance.
      Not quite. That is true for any non-fixed minute chart intervals. For fixed-minute intervals, you will always get the projected time that the bar ends if the bar has not closed, and the time the bar ended if the bar has closed. Those are, of course, the same absolute time.

      Comment


        #4
        i think the simple answer to the original question "will Time[0] give me the DateTime of the start of the current bar or the end" is clearly: End

        but i'm not sure i am clear about the COBC issue. if we're talking about a tick-based chart (eg. tick, range, renko, volume), then wouldn't COBC be irrelevant since Time[] always reflects the last incoming tick which is also the then-current last tick (end) of the bar?

        makes perfect sense for time-based series to be able to calculate/predict the bar.

        thanks in advance for clarifying :-)
        cheers,
        -e

        Comment


          #5
          Hello e-man,

          COBC will still be relevant in tick based charts since on a tick based chart you do not know when the end of the bar is going to be so you get the time of each incoming tick of data if COBC is set to false. For example if you are using a 500 Tick chart then use COBC set to true; your indicator/strategy will only run OnBarUpdate() once the bar is closed so you will get all the values at the end of the bar. If COBC is set to false then OnBarUpdate() will run on each incoming tick of data and if you use Time[0] then it will give you the DateTime of that Tick of data.

          http://www.ninjatrader.com/support/h....html?time.htm

          Let us know if we can be of further assistance.
          JCNinjaTrader Customer Service

          Comment


            #6
            crystal clear now - thanks @JC :-)

            cheers,
            -e

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            580 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            335 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            102 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