Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by rtwave, 04-12-2024, 09:30 AM
    2 responses
    20 views
    0 likes
    Last Post rtwave
    by rtwave
     
    Started by tsantospinto, 04-12-2024, 07:04 PM
    5 responses
    67 views
    0 likes
    Last Post tsantospinto  
    Started by cre8able, Today, 03:20 PM
    0 responses
    6 views
    0 likes
    Last Post cre8able  
    Started by Fran888, 02-16-2024, 10:48 AM
    3 responses
    49 views
    0 likes
    Last Post Sam2515
    by Sam2515
     
    Started by martin70, 03-24-2023, 04:58 AM
    15 responses
    115 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X