Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Best way to calculate look up 'where I am' in a multi timeframe case

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

    Best way to calculate look up 'where I am' in a multi timeframe case

    In a multi timeframe case, what is the best/efficient way to look up 'which bar I am in' from one timeframe to another?

    Let's say I am in BarArray[1] and wants to find which bar I am in, in BarArray[0]'s 'space',
    I know it can be done as

    BarArray[0].GetBar(Time[0])

    My question is, is this the best way, as I am doing a lots of this, among multiple timeframes, back and force...

    #2
    Hello,

    You would want to use CurrentBars[]



    This can also be used to ensure enough bars have been loaded across all series so that you don't get out of bounds errors.

    Let me know if I can be of further assistance.
    LanceNinjaTrader Customer Service

    Comment


      #3
      Thanks for the reply, but you misunderstood my question.
      I am not talking about 'right now', I am talking about
      for any given bar in 5 min time frame, how would I calculate it's place in 2-min timeframe?

      Comment


        #4
        Hello,

        If that is the case then yes, this will be the simplest way to obtain this data. Sorry for the confusion, when I saw you were using Time[0] I assumed you just wanted to get the most current bar.
        LanceNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        649 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        370 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        109 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        573 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        576 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X