Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bar Index value

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

    Bar Index value

    Hi everyone.
    I am looking for a method to obtain the bar index value for each time frame in:

    1) a multi-time frame setup,
    2) 5 minutes bar as the time frame of the main instrument,
    3) tick for the secondary data set for the same main instrument instrument,
    4) Calculate OnEachTick

    Your help will be greatly appreciated.

    Dan
    Attached Files

    #2
    Hello Dan_D_Trader,

    Thanks for your post.

    We recommend a complete review of this section of the help guide that will cover you question and other critical concepts in the context of a multi time frame script: https://ninjatrader.com/support/help...nstruments.htm

    In general, the primary data series (the primary data series of the chart) will be known as BarsArray[0]. The first added data series will be BarsArray[1], the 2nd added data series will be BarsArray[2].

    Here is an example you can add to OnBarUpdate() to get you started: Print (Times[BarsInProgress][0]+ " BarsInProgress: "+BarsInProgress+" CurrentBar being processed is: "+CurrentBars[BarsInProgress])

    Comment


      #3
      Thank you Paul

      Dan

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      648 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      369 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      108 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
      575 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X