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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        81 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        42 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        66 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        54 views
        0 likes
        Last Post CarlTrading  
        Working...
        X