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

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 andrewtrades, Today, 04:57 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by chbruno, Today, 04:10 PM
        0 responses
        6 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by josh18955, 03-25-2023, 11:16 AM
        6 responses
        436 views
        0 likes
        Last Post Delerium  
        Started by FAQtrader, Today, 03:35 PM
        0 responses
        9 views
        0 likes
        Last Post FAQtrader  
        Started by rocketman7, Today, 09:41 AM
        5 responses
        19 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X