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 cre8able, Today, 01:16 PM
    2 responses
    9 views
    0 likes
    Last Post cre8able  
    Started by chbruno, 04-24-2024, 04:10 PM
    3 responses
    48 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by samish18, Today, 01:01 PM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by WHICKED, Today, 12:56 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by WHICKED, Today, 12:45 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X