Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 Pole123, Today, 06:02 PM
    0 responses
    8 views
    0 likes
    Last Post Pole123
    by Pole123
     
    Started by samish18, Today, 05:27 PM
    0 responses
    5 views
    0 likes
    Last Post samish18  
    Started by Tonkingrf1551, Today, 03:59 PM
    0 responses
    10 views
    0 likes
    Last Post Tonkingrf1551  
    Started by rocker84, Today, 03:10 PM
    0 responses
    12 views
    0 likes
    Last Post rocker84  
    Started by Oracletrades, 02-21-2020, 01:37 PM
    17 responses
    2,066 views
    0 likes
    Last Post Ttrade12  
    Working...
    X