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 argusthome, 03-08-2026, 10:06 AM
    0 responses
    65 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    41 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    23 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    26 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    52 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X