Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

What is the correct syntax to set 600 as the "barsToLoad"

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

    What is the correct syntax to set 600 as the "barsToLoad"


    The NT8 help guide is a little light in detail on "barsToLoad" https://ninjatrader.com/support/help...dataseries.htm


    What is the correct syntax to set 600 as the "barsToLoad" to the first data set I am loading.

    AddDataSeries("ES 06-20", Data.BarsPeriodType.Tick, 300, Data.MarketDataType.Last);
    AddDataSeries( ...

    Thanks!


    #2
    Just thought I would add.

    The link above provides the following syntax
    AddDataSeries(string instrumentName, BarsPeriod barsPeriod, int barsToLoad, string tradingHoursName, bool? isResetOnNewTradingDay)

    But when that line in the code gets was I thought was that simple update
    Was: AddDataSeries("ES 06-20", Data.BarsPeriodType.Tick, 300, Data.MarketDataType.Last);
    Now: AddDataSeries("ES 06-20", Data.BarsPeriodType.Tick, 300, 600, Data.MarketDataType.Last);

    The NS compiler balks.. see images.

    Comment


      #3
      Hello hedgeplay,

      Thanks for the post.

      The problem is that you are not using a valid overload set, they cannot be changed or combined so it would need to match exactly how it is shown in the help guide.
      This is what you provided:
      Code:
      Now: AddDataSeries("ES 06-20", Data.BarsPeriodType.Tick, 300, 600, Data.MarketDataType.Last);
      And what the platform expects:
      Code:
      AddDataSeries(string instrumentName, BarsPeriod barsPeriod, int barsToLoad, string tradingHoursName, bool? isResetOnNewTradingDay)
      It should instead look like the following when using this overload:

      Code:
      AddDataSeries("ES 06-20", Data.BarsPeriodType.Tick, 600, "Default 24/7", true);
      Substituting the Default 24/7 with the trading hours you are using.

      If you need to use 600 BarsToLoad but need one of the other overloads that don't include that you would need to use a chart directly and not use the control center when applying the strategy. A chart will allow for you to set this but the strategy would need to be applied to a chart to make use of that feature.

      I look forward to being of further assistance.

      Comment


        #4
        Thanks Much Jesse!

        Comment


          #5
          Originally posted by NinjaTrader_Jesse View Post
          Hello hedgeplay,

          Thanks for the post.

          The problem is that you are not using a valid overload set, they cannot be changed or combined so it would need to match exactly how it is shown in the help guide.

          ...

          If you need to use 600 BarsToLoad but need one of the other overloads that don't include that you would need to use a chart directly and not use the control center when applying the strategy. A chart will allow for you to set this but the strategy would need to be applied to a chart to make use of that feature.

          Hi Jesse,

          Felt like I circle back to this topic.

          Honestly I was in a little disbelief that BarsToLoad was not available in more overloads so I must be missing something and asked for help.

          As the larger players in the trading industry move toward FPGA programming to deploy the algos we are trading against so for us to compete successfully I and I think NinjaTrader customers and therefore NinjaTrader will need to continue this wonderful evolution to help us build less complex, faster, smaller, deployments with fewer dependencies.

          So I would like to submit a feature enhancement request for a AddDataSeries() overload that includes BarsToLoad and the following "BarsPeriodType periodType, int period, MarketDataType marketDataType"


          Thanks!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          93 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          138 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          68 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          123 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          73 views
          0 likes
          Last Post PaulMohn  
          Working...
          X