Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is there a way to get the time associated with a bar?

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

    Is there a way to get the time associated with a bar?

    Hello,

    I'm doing some work on a custom indicator and need to review the bars that have occurred since the market opened, but not before.

    Is there something like Time[0] that indicates what time a bar occurred? That would let me go back to the bar that started the day. Another option would be something that would tell me how many bars have occurred since the market opened.

    I understand that I would need to use CurrentBar to make sure that I didn't ask for data that had not been loaded.

    My fallback is to use datetime.now and count the number but I wanted to see if there was something built in first.

    thanks!

    john

    #2
    Duh, never mind, just found it.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    384 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    250 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    211 views
    1 like
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    298 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    262 views
    0 likes
    Last Post CarlTrading  
    Working...
    X