Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Enabling 2nd DataSeries object kills indicator

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

    Enabling 2nd DataSeries object kills indicator

    I have an indicator with one dataseries plot that works by itself, but when I add a second DataSeries object to the indicator, the original indicator stops plotting. There is no Print output either. As soon as I comment out the DataSeries2.Set(5) line, the indicator works again.

    My intent is to populate the second dataseries object with SUM() data.

    I am using recorded market data captured. Are there any tips I can use to debug other than print, since it doesn't show anything?

    #2
    Are the logs showing you any error if this happens?

    Is the second dataseries being initialized() properly?

    Are you somehow attempting to access a 'nonpresent' value?

    Comment


      #3
      Right now I am just populating the dataseries with a number 5. I've initialized it as DataSeries DeltaSum = new DataSeries(this);

      In the log it reads ...on bar 0: Object reference not set to an instance of an object.

      Comment


        #4
        Tight Face, it is necessary to create and initialize DataSeries in two different locations. It needs to be declared in the variables section, then initialized in the initialize section.
        Code:
        #region Variables
        // Defines the DataSeries object
        private DataSeries myDataSeries;
        #endregion
        
        protected override void Initialize()
        {
        // Create a new DataSeries object and assign it to the variable myDataSeries declared in the ‘Variables’ region above
        myDataSeries = new DataSeries(this);
        }
        If that doesn't solve the issue, could you please post the full code sample of what you're trying to accomplish? Thank you.
        AustinNinjaTrader Customer Service

        Comment


          #5
          Austin,

          I see where my error was.

          In the Initialize method I was typing "DataSeries DeltaSum = new DataSeries(this);" I corrected this and it works now. Thanks!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          558 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          324 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          545 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          547 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X