• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Access intraday bars for prior time window

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

    Access intraday bars for prior time window

    Hello, on an intraday chart (FX), how would I access the indexes of the bars that occurred during a previous time window?

    For example if the chart is 60M, 7 bars into the day with 7th bar still open, how would I be able to know that the 60M bars that make up yesterday are [7] through [30]?

    On a 240M, 4 bars in to a new week with 4th bar still open, how could I know that the indexes of bars [4] through [33] make up the previous week?

    Thanks!

    #2
    Originally posted by entropy View Post
    Hello, on an intraday chart (FX), how would I access the indexes of the bars that occurred during a previous time window?

    For example if the chart is 60M, 7 bars into the day with 7th bar still open, how would I be able to know that the 60M bars that make up yesterday are [7] through [30]?
    Bars.GetBar(Time[0].AddDays(-1))
    On a 240M, 4 bars in to a new week with 4th bar still open, how could I know that the indexes of bars [4] through [33] make up the previous week?

    Thanks!
    Same idea. Find the number of bars ago that represent the bar number that you seek, using the current bar time, and the required offset in time.

    Look up Bars.GetBar() in the NT Help.
    Last edited by koganam; 07-12-2015, 06:04 PM.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by DariusDeck, Yesterday, 04:22 PM
    5 responses
    37 views
    0 likes
    Last Post NinjaTrader_EricB  
    Started by StevenNelson, Today, 05:49 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_PatrickG  
    Started by fx.practic, Today, 01:41 AM
    0 responses
    12 views
    0 likes
    Last Post fx.practic  
    Started by wolfcuring, Today, 01:29 AM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by BrandonT1292, 06-17-2019, 03:03 PM
    2 responses
    32 views
    0 likes
    Last Post thinarthrill  
    Working...
    X