Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Adding instrument and controlling the # of its bars

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

    Adding instrument and controlling the # of its bars

    How can I set the number of bars to be loaded when adding a Bars object, regardless of the base chart "Load data base on" and "Days/Bars to load" values?

    #2
    savekad,

    Unfortunately there isn't any way to force a number of bars to load currently. Essentially the bars will start with the first one on your chart and iterate forward from there.

    If you ensure that you have historical data saved for the instruments you are loading you should have access to it depending on the time frame.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      But AFAIK, added Bars object gets the same number of bars as the base chart Bars object only when "Load data based on" property is set to 'Bars'.

      And one other thing, is there maybe a way to condition an indicator to execute its logic only if "Load data based on" is set to 'Bars' and has at least a certain number of bars?

      Comment


        #4
        Hello,

        You would not be able to check that specifically but you can access the from and to date that is generated from the setting the user specifies.

        Bars.BarsData.From
        Bars.BarsData.To

        Furthermore you could access the number of bars on the chart:


        Bars.Count


        -Brett
        BrettNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        630 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        364 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        565 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        568 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X