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

    Comment


      #3
      Thanks Chris

      That's exactly what I needed to know.

      Bruce

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      182 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      334 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      258 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      358 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      187 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X