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

Chart Time vs. CPU Time

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

    Chart Time vs. CPU Time

    Hello,

    How do I get the date/time of the current bar when using Replay and Strategy Analyzer, and not the CPU time?

    Thanks

    #2
    Hello Turtle Trader,

    Bar time stamps are accessed with Time[0].

    Help working with DateTime objects is available here.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      A further question.....say I have a tick or range chart, and the bars are not synched to minutes or seconds. Is there a way to know the actual chart time?

      For example, say I have a 20 range chart and I want to know when the hour changes. (assuming I am using Replay or Strategy Analyzer where I need to synch to the chart time..)

      I won't be able to get this from Time[0] as this is it only given on a tick basis. (On a really slow moving chart, the ticks may not be close together....)

      Thanks

      Comment


        #4
        Time[0] gives you the time stamp of bars. It indicates when the bars complete. There's no additional historical time properties available.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          repy

          Just a further clarification...

          Does Time[0] give the value of the current time tick within the bar?

          That should be sufficient.

          Comment


            #6
            No, it gives a date time object when the bar completed.

            Bar Time Stamp
            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.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              When employing range bars and updating intrabar what is used for a time stamp until the bar completes and the completion time is known?

              Comment


                #8
                sgordet, Time[0] will refer to the most recent update of the bar.
                AustinNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by gentlebenthebear, Today, 01:30 AM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by Aviram Y, Today, 05:29 AM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by cls71, Today, 04:45 AM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by TradeForge, Today, 02:09 AM
                1 response
                22 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by elirion, Today, 01:36 AM
                2 responses
                14 views
                0 likes
                Last Post elirion
                by elirion
                 
                Working...
                X