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 bmartz, 03-12-2024, 06:12 AM
        4 responses
        31 views
        0 likes
        Last Post bmartz
        by bmartz
         
        Started by Aviram Y, Today, 05:29 AM
        4 responses
        12 views
        0 likes
        Last Post Aviram Y  
        Started by algospoke, 04-17-2024, 06:40 PM
        3 responses
        28 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by gentlebenthebear, Today, 01:30 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by cls71, Today, 04:45 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X