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 geddyisodin, Yesterday, 05:20 AM
    7 responses
    45 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by gbourque, Today, 06:39 AM
    2 responses
    5 views
    0 likes
    Last Post gbourque  
    Started by cre8able, Yesterday, 07:24 PM
    1 response
    13 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by cocoescala, 10-12-2018, 11:02 PM
    6 responses
    939 views
    0 likes
    Last Post Jquiroz1975  
    Started by cmtjoancolmenero, Yesterday, 03:58 PM
    1 response
    17 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X