Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time Stamps

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

    Time Stamps

    Hi,

    Is there any way to get access to bar time stamps with milliseconds? Clearly this is available as my Data Box show bar times: 18:00:00:023 (bar index 447), 18:00:00:023 (bar index 448), 18:00:00:023 (bar index 449), 18:00:00:023 (bar index 450) . This time stamp is not available with Time[0] which only gives 18:00:00 (actually 6:00:00 PM) for those bars. If yes, how? Please advise. Thank you.

    #2
    Hello Zeos6,

    Thanks for opening the thread.

    You can read the milliseconds of a DateTime object by changing the format.

    For example:

    Print(Time[0].ToString("hh:mm:ss.fff"));

    For more information on customizing DateTime strings please see the publicly available reference found here: https://docs.microsoft.com/en-us/dot...format-strings

    Please let me know if I may be of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hi Jim,

      Thank you for your response. I am aware of changing the format but did not think of applying it to Time[0]. D'oh!

      However, that isn't what I was after. I asked my question poorly. Here is a clarification...

      In the drawing objects, one of the options for drawing a line is startTime and endTime, which are DateTimes. If Time[0] is used as a start or end time, the "default" format of Time[0] is used; i.e. time stamp accurate only to seconds. Is there a way of being able to use a time stamp with milliseconds accuracy in the drawing objects?

      Comment


        #4
        Hello Zeos6,

        Thanks for your reply.

        As I understand this inquiry is related to your other post below?



        The Drawing Tools will snap to an associated slot and there would not be a way to have it plot to an exact time. I have submitted a feature request on your behalf for Drawing Tool overloads that plot an exact time.

        In the meantime, you would be able to do this via custom rendering. Keep in mind that the implementation would be very specific and involved for your purposes and providing clear direction for such an advanced technique begins to escape the scope of services we may provide.

        If you have additional questions surrounding this matter, let's keep our conversation in one thread so we may keep the discussed information in one place.
        JimNinjaTrader Customer Service

        Comment


          #5
          Thanks Jim. I appreciate the clarification. Drawing Tool overloads that plot an exact time would be most helpful.

          EDIT:
          In the mean time I am using ChartBars.GetBarIdxByTime to convert to a bar index, and that seems to be working fine.
          Last edited by Zeos6; 09-20-2017, 07:08 AM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Barry Milan, Today, 10:35 PM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by WeyldFalcon, 12-10-2020, 06:48 PM
          14 responses
          1,428 views
          0 likes
          Last Post Handclap0241  
          Started by DJ888, Yesterday, 06:09 PM
          2 responses
          9 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by jeronymite, 04-12-2024, 04:26 PM
          3 responses
          40 views
          0 likes
          Last Post jeronymite  
          Started by bill2023, Today, 08:51 AM
          2 responses
          16 views
          0 likes
          Last Post bill2023  
          Working...
          X