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 samish18, Today, 01:01 PM
    0 responses
    5 views
    0 likes
    Last Post samish18  
    Started by WHICKED, Today, 12:56 PM
    0 responses
    7 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Started by Spiderbird, Today, 12:15 PM
    2 responses
    11 views
    0 likes
    Last Post Spiderbird  
    Started by WHICKED, Today, 12:45 PM
    0 responses
    8 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Started by FrazMann, Today, 11:21 AM
    2 responses
    8 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Working...
    X