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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    81 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    64 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    66 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X