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 Kaledus, Today, 01:29 PM
      3 responses
      9 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by frankthearm, Yesterday, 09:08 AM
      14 responses
      47 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Started by gentlebenthebear, Today, 01:30 AM
      2 responses
      13 views
      0 likes
      Last Post gentlebenthebear  
      Started by PaulMohn, Today, 12:36 PM
      2 responses
      17 views
      0 likes
      Last Post PaulMohn  
      Started by Conceptzx, 10-11-2022, 06:38 AM
      2 responses
      56 views
      0 likes
      Last Post PhillT
      by PhillT
       
      Working...
      X