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

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 ageeholdings, Today, 07:43 AM
    0 responses
    6 views
    0 likes
    Last Post ageeholdings  
    Started by pibrew, Today, 06:37 AM
    0 responses
    4 views
    0 likes
    Last Post pibrew
    by pibrew
     
    Started by rbeckmann05, Yesterday, 06:48 PM
    1 response
    14 views
    0 likes
    Last Post bltdavid  
    Started by llanqui, Today, 03:53 AM
    0 responses
    6 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    12 views
    0 likes
    Last Post burtoninlondon  
    Working...
    X