Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AddDataSeries() should be hardcoded

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

    AddDataSeries() should be hardcoded

    Greetings,

    I have in my indicator, with the line :
    AddDataSeries(Instrument.FullName, new BarsPeriod { BarsPeriodType = BarsPeriodType.Minute, Value = 1 }, 1800,"CME US Index Futures ETH BGW EOD 315 (1)", false);

    Would this cause the error :
    Indicator 'PD VA__Up': Error on calling 'OnStateChange' method: Object reference not set to an instance of an object. ?

    I'm trying to avoid having to re code 20 or 30 indicators every Rollover.

    Other than the error message, the indicator seems to load the 1 minute bars and function as expected, is there an alternative to rewriting at every Rollover ? What's the impact of leaving as is ?

    Thanks,

    Bruce

    #2
    Hello BGWTEX, thanks for your post.

    The only time this will be a problem is during an optimization in the Strategy Analyzer when new instances of the indicator are being created. Using variables in AddDataSeries is not something we support, so if you do have unforeseen issues we will not be able to find a resolution instead of suggesting to hard code the parameters. For loading on charts or using in a strategy it will work fine.

    Best regards,
    -ChrisL

    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thanks Chris

      That's exactly what I needed to know.

      Bruce

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Rapine Heihei, 04-23-2024, 07:51 PM
      2 responses
      30 views
      0 likes
      Last Post Max238
      by Max238
       
      Started by Shansen, 08-30-2019, 10:18 PM
      24 responses
      943 views
      0 likes
      Last Post spwizard  
      Started by Max238, Today, 01:28 AM
      0 responses
      9 views
      0 likes
      Last Post Max238
      by Max238
       
      Started by rocketman7, Today, 01:00 AM
      0 responses
      7 views
      0 likes
      Last Post rocketman7  
      Started by wzgy0920, 04-20-2024, 06:09 PM
      2 responses
      28 views
      0 likes
      Last Post wzgy0920  
      Working...
      X