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 inanazsocial, Today, 01:15 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Jason  
    Started by rocketman7, Today, 02:12 AM
    0 responses
    6 views
    0 likes
    Last Post rocketman7  
    Started by dustydbayer, Today, 01:59 AM
    0 responses
    1 view
    0 likes
    Last Post dustydbayer  
    Started by trilliantrader, 04-18-2024, 08:16 AM
    5 responses
    23 views
    0 likes
    Last Post trilliantrader  
    Started by Davidtowleii, Today, 12:15 AM
    0 responses
    3 views
    0 likes
    Last Post Davidtowleii  
    Working...
    X