Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Minute Bars timestamped with bar close time

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

    Minute Bars timestamped with bar close time

    Hello NT8 Support,

    I have been noticing over the past few weeks that on my minute charts, all bars are timestamped with the bar close time. This becomes very obvious in larger intervals. For example, the 30-minute bar that starts at 6AM and ends at 6:30AM is given a timestamp at 6:30AM.

    Unfortunately, this also throws off any indicators looking at bar times.

    I suspect this is not intentional. Can you advise? I've attached a screenshot that should demonstrate the issue. The PC's time in the screenshot is 6:17am (pacific). It shows a chart with 2 panes, two data series - a 60 minute and a one minute. The time on the chart reads 7AM. Below that chart, is another one with just the minute bars, which is giving the last bar a stamp of 6:18.

    Can you replicate this issue or do I have a problem on my end?

    Your assistance is greatly appreciated as always.

    Thank you.
    Attached Files

    #2
    To clarify, this is on Continuum / CQG

    Comment


      #3
      This is expected and by design.

      NinjaTrader stamps a bar with the closing time of the bar. For example, a minute bar with a time of 9:31:00 AM has data from 9:30:00 AM through 9:30:59 AM. Using end of bar time stamps is required in order to be able to plot multiple series of differing time frames within a single chart all accurately synchronized to time.

      You can see the help guide link below for more information on how bars are built in NinjaTrader:

      Comment


        #4
        Ah, OK, thank you Patrick. Guess I have a case of RTFM here, my apologies.

        In light of this (is this new to NT8? I don't remember having to worry about this in NT7) is there a code reference sample that illustrates best practices for referencing Time[x] to establish time filters?

        In this reference example http://ninjatrader.com/support/forum...ead.php?t=3226 we have code

        if ((ToTime(Time[0]) >= 93000 && ToTime(Time[0]) < 120000) .... ) {DO STUFF}

        But if I'm reading this correctly, this time filter would filter IN the bar pre-open, and filter OUT the bar pre-noon. Depending on the period interval (say 60 minutes or 30 minutes) this could be a significantly variable window.

        So is it best now to look at Time[1] instead of Time[0]? Do we need to check the period type and period value to ensure consistency?

        If I'm missing something simple, please let me know. Perhaps just changing above, flip-flopping the >= and <, to > and <=:

        if ((ToTime(Time[0]) > 93000 && ToTime(Time[0]) <= 120000) .... ) {DO STUFF}

        Thank you again.
        Last edited by greagrea; 11-23-2016, 09:41 AM.

        Comment


          #5
          Hello greagrea,

          The behavior of NinjaTrader is the same.

          Below is a link to the NinjaTrader 7 help guide on how bars are built.


          Also, below I am providing a link to a reference sample on using a time filter.


          With the condition:
          Code:
          (ToTime(Time[0]) >= 93000 && ToTime(Time[0]) < 120000)
          This will allow any action to occur if the time is equal to or greater than 9:30 AM and is also less than 12:00 PM.
          If you are using this to place an entry, the entry placed from this condition would only be allowed between these hours.

          Using Time[1] would be the previous bars time.
          If the current bar has closed at 9:22:00 AM on a 1 minute bar interval, using Time[1] would return 9:21:00. If used for an entry, and the time is required to be 9:22, no entry would be allowed until 9:23 as the previous bar would have to have the time of 9:22.
          Last edited by NinjaTrader_ChelseaB; 11-23-2016, 11:31 AM.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by greagrea View Post
            In this reference example http://ninjatrader.com/support/forum...ead.php?t=3226 we have code

            if ((ToTime(Time[0]) >= 93000 && ToTime(Time[0]) < 120000) .... ) {DO STUFF}

            But if I'm reading this correctly, this time filter would filter IN the bar pre-open, and filter OUT the bar pre-noon. Depending on the period interval (say 60 minutes or 30 minutes) this could be a significantly variable window.
            You are correct. But this is a filter for trade entry hours, not processing hours.

            Your 'significantly variable window' is only for the processing hours - the window to enter trades is the same regardless of bar series -- no trades will entered before 9:30 and no trades will be entered on or after 12pm -- that's all it says.

            In the example, above, those timestamps for the bar are only for a point of reference, aka, a poor man's clock.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by JonesJoker, 04-22-2024, 12:23 PM
            8 responses
            41 views
            0 likes
            Last Post JonesJoker  
            Started by timko, Today, 06:45 AM
            0 responses
            3 views
            0 likes
            Last Post timko
            by timko
             
            Started by Waxavi, 04-19-2024, 02:10 AM
            2 responses
            37 views
            0 likes
            Last Post poeds
            by poeds
             
            Started by chbruno, Yesterday, 04:10 PM
            1 response
            44 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by Max238, Today, 01:28 AM
            1 response
            25 views
            0 likes
            Last Post CactusMan  
            Working...
            X