Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Issue with AddChartIndicator() not Plotting in Strategy

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

    Issue with AddChartIndicator() not Plotting in Strategy

    Hi,

    I've added an AddChartIndicator through Strategy Builder. The indicator is not plotting in my strategy. The indicator is on a secondary data series and inside the indicator file it does have another secondary data series to use Volumetric bars. Below is what I've:

    Code:
    IndicatorName1 = IndicatorName(BarsArray[1], Setting1, Setting2);
    IndicatorName1.Plots[0].Brush = Brushes.Blue;
    AddChartIndicator(IndicatorName1);

    #2
    Hello AgriTrdr,

    From the help guide:
    "An indicator being added via AddChartIndicator() cannot use any additional data series hosted by the calling strategy, but can only use the strategy's primary data series. If you wish to use a different data series for the indicator's input, you can add the series in the indicator itself and explicitly reference it in the indicator code (please make sure though the hosting strategy has the same AddDataSeries() call included as well)​"

    This means that BarsArray[1] cannot be supplied to the indicator if you plan to use this with AddChartIndicator().

    Instead, add the data series in the indicator with AddDataSeries() (and to the host script) and use that series to perform the calculations.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X