Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Times[0] vs. System.DateTime.Now

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

    Times[0] vs. System.DateTime.Now

    Hi Ninjatrader,

    I've searched and hope this hasn't been answered before, if so I apologize and request a link to the answer.

    I am seeing time differences in the bar Times[0] value and the current system time and having ruled out NTP clock disparity and want to understand why. For a liquid and actively traded security (emini S&P) the Time[0] timestamp with CalculateOnbarUpdate=true and the local system time varies greatly.

    Is the difference due to the time between the bar close and next tick received ? I understand that the bar will not be closed until an "after" tick is received, but given a liquid active contract in the middle of a busy session (emini s&p), I would assume that tick time to be insignificant. What am I missing in my reasoning?

    Thanks for insight.

    Number1

    #2
    Hello Number1,

    Thank you for your post.

    The Time[0] or Times[0[ is the bar's timestamp at close. The DateTime.Now is the PC clock time. These can varry based on when the bar closed and if the timestamps are local to your PC or native to the data provider's server. Information on the timestamps for each provider can be found at the following link: http://www.ninjatrader.com/support/h...rical_data.htm

    Comment


      #3
      Originally posted by number1 View Post
      Hi Ninjatrader,

      I've searched and hope this hasn't been answered before, if so I apologize and request a link to the answer.

      I am seeing time differences in the bar Times[0] value and the current system time and having ruled out NTP clock disparity and want to understand why. For a liquid and actively traded security (emini S&P) the Time[0] timestamp with CalculateOnbarUpdate=true and the local system time varies greatly.

      Is the difference due to the time between the bar close and next tick received ? I understand that the bar will not be closed until an "after" tick is received, but given a liquid active contract in the middle of a busy session (emini s&p), I would assume that tick time to be insignificant. What am I missing in my reasoning?

      Thanks for insight.

      Number1
      If you want the bars' TimeStamp to match the computer time, you must either use bars which are not time delimited, or else use CalculateOnBarClose = false;

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      606 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      351 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      560 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      561 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X