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 Hwop38, 05-04-2026, 07:02 PM
        0 responses
        173 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        328 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        252 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        354 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        181 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X