Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 bortz, 11-06-2023, 08:04 AM
            47 responses
            1,606 views
            0 likes
            Last Post aligator  
            Started by jaybedreamin, Today, 05:56 PM
            0 responses
            8 views
            0 likes
            Last Post jaybedreamin  
            Started by DJ888, 04-16-2024, 06:09 PM
            6 responses
            18 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by Jon17, Today, 04:33 PM
            0 responses
            4 views
            0 likes
            Last Post Jon17
            by Jon17
             
            Started by Javierw.ok, Today, 04:12 PM
            0 responses
            13 views
            0 likes
            Last Post Javierw.ok  
            Working...
            X