Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Plotting an Indicator on a DataSeries

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

    Plotting an Indicator on a DataSeries

    I know it is possible to plot an indicator on a backtest chart by using the Add() method in the Strategy's Initialize() method (this is shown here).
    However, if I try to add an indicator which accepts a DataSeries object, NinjaTrader crashes with 'Stack overflow'.
    For example, the following code causes the crash:
    Code:
    private DataSeries mySeries;
    protected override void Initialize()
    {  
        mySeries = new DataSeries(this);            
        Add(SUM(mySeries, 10));
        CalculateOnBarClose = true;
    }
    Using the default DataSeries does not crash:
    Code:
    protected override void Initialize()
    {  
        Add(SUM(10));
        CalculateOnBarClose = true;
    }

    Is it possible to Add() an indicator to the chart where its input is a custom DataSeries object?

    Thanks,
    Boaz

    #2
    Hello Boaz,
    Unfortunately you cannot reference any other dataseries while adding an indicator via the initialize section of the strategy.
    JoydeepNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by judysamnt7, 03-13-2023, 09:11 AM
    4 responses
    59 views
    0 likes
    Last Post DynamicTest  
    Started by ScottWalsh, Today, 06:52 PM
    4 responses
    36 views
    0 likes
    Last Post ScottWalsh  
    Started by olisav57, Today, 07:39 PM
    0 responses
    7 views
    0 likes
    Last Post olisav57  
    Started by trilliantrader, Today, 03:01 PM
    2 responses
    21 views
    0 likes
    Last Post helpwanted  
    Started by cre8able, Today, 07:24 PM
    0 responses
    10 views
    0 likes
    Last Post cre8able  
    Working...
    X