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

using variables form a prior bar's calulations

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

    using variables form a prior bar's calulations

    I am building a Fourier transform indicator which calculates 50 values for a certain parameter, let's say the parameter is named "Real".
    So there is a Real[0] through Real[49] for the current bar (i.e. bar[0]).
    The calculation needs to reference the prior bar's 50 values for Real (i.e. Bar[1]) as well as the 50 values of Real for the bar before that (bar[2]).

    What NinjaTrader data type would I use to declare Real so that the prior bar's calculation values are available?

    The NinjaTrader DataSeries type
    only stores one value for each bar, not 50.

    Real is not a straight 2 dimensional array, since that would reset every thing to 0 each time the indicator executes.

    I really need sonething like this
    (conceptual example only, might not be correct C#)
    Real[3] = new DataSeries (this);
    to be referenced in code possibly like this
    N = Real[0][25] + Real[1][25] + Real[2][25];
    and possibly loaded something like this
    Real.Set(A*N-1)[0][25];

    I do not need to keep any more than 3 bars back worth of 50 values for each bar.

    If this is the wrong forum for this question, please direct me to the proper forum.

    #2
    Hello,


    Unfortunately this is outside the scope of what we can offer support for on the forums. You may find what you want over on MSDN because this is a more advanced C# issue.
    DenNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by bmartz, 03-12-2024, 06:12 AM
    4 responses
    31 views
    0 likes
    Last Post bmartz
    by bmartz
     
    Started by Aviram Y, Today, 05:29 AM
    4 responses
    12 views
    0 likes
    Last Post Aviram Y  
    Started by algospoke, 04-17-2024, 06:40 PM
    3 responses
    28 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by gentlebenthebear, Today, 01:30 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by cls71, Today, 04:45 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X