Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SUM indicator

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

    SUM indicator

    Hello-

    If I have this:

    Seriesvar[0] = ((Seriesvar1[0] + doublevar) * doublevar1) - ((Seriesvar2[0] + doublevar2) * doublevar3);
    Then I use:

    mySUM = (SUM(Seriesvar, Period)[0]);
    do the doublevar variables sum bars back, ...[period]+[1]+[0], like the Seriesvar[0], or do I get doublevar at bar[0] added together period times? Do all the variables in SUM have to be series variables in order to return the correct values?

    I guess this question also applies to all the MAs, MAX/MIN, and anything else.

    Thank you.

    #2
    Thanks for your post imalil,

    SUM will take a Series object which is a collection of values assigned for each bar, and a period describing how many values from the current bar to include in the summation. Since it is built as an indicator it works similarly to how an SMA would work.

    What you have written will take the last "Period" number of values from "Seriesvar" and add them together.

    The publicly available SUM documentation could be referenced for further explanation and examples, and the Strategy Builder can also be used to generate syntax for further understanding. I'll include a link to SUM's as well as Series<T>'s documentation and a sample explaining custom Series objects further.

    SUM - https://ninjatrader.com/support/help...mation_sum.htm

    Series<T> - https://ninjatrader.com/support/help...us/seriest.htm

    SampleCustomSeries - https://ninjatrader.com/support/help...taseries_o.htm

    Please let us know if we can be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    598 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    343 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    557 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    555 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X