Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
      JesseNinjaTrader Customer Service

      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 inanazsocial, Today, 01:15 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Jason  
          Started by rocketman7, Today, 02:12 AM
          0 responses
          10 views
          0 likes
          Last Post rocketman7  
          Started by dustydbayer, Today, 01:59 AM
          0 responses
          2 views
          0 likes
          Last Post dustydbayer  
          Started by trilliantrader, 04-18-2024, 08:16 AM
          5 responses
          23 views
          0 likes
          Last Post trilliantrader  
          Started by Davidtowleii, Today, 12:15 AM
          0 responses
          3 views
          0 likes
          Last Post Davidtowleii  
          Working...
          X