Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Calculating and storing in DataSeries

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

    Calculating and storing in DataSeries

    While my system compiles, using print statements I found that it doesn't get very far before packing it in. I've found the problem line here:

    ZamLRavg.Set((ZamLRquick + ZamLRmedium + ZamLRslow) / 3.0);

    I want to store an average of 3 values into a DataSeries as I need to access history of this variable. I have created these in the Variable section as follows:

    double ZamLRquick = 0.0;
    double ZamLRmedium = 0.0;
    double ZamLRslow = 0.0;

    private DataSeries ZamLRavg;

    I'm a Tradestation programmer so all this is new (and painfully difficult) to me.

    Thank you for any help you can offer.

    #2
    Hello,

    I am sorry, I don't know what that custom call is so I can't help you. Try printing out the inputs to the line you are having issues with and see if any of the input values are strange looking.

    Also, are you created a DataSeries to do this?:
    DenNinjaTrader Customer Service

    Comment


      #3
      Problem is fixed

      Hi Ben,

      You did help me actually. While I declared the DataSeries variable, I forgot to initialize it with

      ZamLRavg = new DataSeries(this);

      It seems to be working fine now.

      Thanks - I appreciate the help.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      633 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      364 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      567 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      568 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X