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

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])
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thank you Paul

      Dan

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by haas88, 03-21-2024, 02:22 AM
      18 responses
      207 views
      0 likes
      Last Post haas88
      by haas88
       
      Started by Board game geek, Today, 02:20 AM
      0 responses
      1 view
      0 likes
      Last Post Board game geek  
      Started by knighty6508, Today, 01:20 AM
      2 responses
      13 views
      0 likes
      Last Post knighty6508  
      Started by franatas, Today, 01:53 AM
      0 responses
      2 views
      0 likes
      Last Post franatas  
      Started by knighty6508, Today, 01:17 AM
      0 responses
      9 views
      0 likes
      Last Post knighty6508  
      Working...
      X