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 argusthome, 03-08-2026, 10:06 AM
          0 responses
          110 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          59 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          37 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          41 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          78 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X