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