Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Tmeframe

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

    Tmeframe

    Hi!

    Which function returns the timeframe?
    I have tried with period() without success.
    TimePeriod() does also not work.

    #2
    Hello Stanfillirenfro,

    Thank you for your post.

    Time[ ] could be used to get the time of a bar.

    Time[ ] - https://ninjatrader.com/support/help...eries_time.htm

    If you would like to manipulate DateTime objects, please see the reference sample in this help guide documentation - https://ninjatrader.com/support/help...me_objects.htm

    Please let us know if we may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Many thanks Brondon for your reply.

      I am meaming the time frame and not the time at which a bar was formed.

      I mean for example 1 minute, 5 minutes, 1 hour, 2000 ticks ...bars time frames.

      Is there a function to get a given time frame?

      Best regards,

      Comment


        #4
        Can this function give me the current time frame?
        ToTime(Time[0])

        Comment


          #5
          Hello Stanfillirenfro,

          Thank you for that clarification.

          ToTime() would be used to get the current time in the format Hmmss where 7:30 AM would be 73000 and 2:15:12 PM would be 141512.

          I understand that you would like to get the bar period of the data series. For example. 1-minute bar, 2000 tick bar, etc.

          You could BarsPeriod.Value to get the period value of a bar within your script.

          See the help guide documentation below for more information.
          BarsPeriod - https://ninjatrader.com/support/help...barsperiod.htm

          Let us know if we may assist further
          <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

          Comment


            #6
            Many thanks Brondon for your reply and yyour valuable help.

            It is what I was looking for.

            Thanks again.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            603 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            349 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            104 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
            560 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X