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 HappyTrader76, 03-17-2025, 04:14 PM
    9 responses
    52 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by Tessan, Today, 04:35 AM
    0 responses
    4 views
    0 likes
    Last Post Tessan
    by Tessan
     
    Started by CaseForeman, Today, 04:28 AM
    0 responses
    5 views
    0 likes
    Last Post CaseForeman  
    Started by Tessan, 03-14-2025, 11:44 AM
    2 responses
    25 views
    0 likes
    Last Post Tessan
    by Tessan
     
    Started by eiketre, Today, 03:23 AM
    0 responses
    11 views
    0 likes
    Last Post eiketre
    by eiketre
     
    Working...
    X