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 NullPointStrategies, Today, 05:17 AM
    0 responses
    52 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    70 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    43 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    47 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X