Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Second indicator not plotting

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

    Second indicator not plotting

    I coding my first strategy and in it I have added 2 data series, a 1 minute and a 5 minute. When I apply it to a 1 minute chart, the indicator will plot for the one minute data series but doesn't plot for the 5 minute data series. The panel for the second indicator is blank. I have some conditional logic acting on the 5 minute indicator which seems to be working even though it is not plotting. I verified this by opening a 5 minute chart with the indicator. Why is the second indicator not plotting. Below is the Setup for the added data series and indicators

    State.Configure
    {
    AddDataSeries(Data.BarsPeriodType.Minute, 1);
    AddDataSeries(Data.BarsPeriodType.Minute, 5);​
    }

    State.DataLoaded
    {

    _smiOneMinute = Indicator(BarsArray[1], param, param);
    _smiFiveMinute = Indicator(BarsArray[2], param, param);

    AddChartIndicator(_smiOneMinute);
    AddChartIndicator(_smiFiveMinute);

    }​


    #2
    Hello Itachi,

    From the Desktop SDK:
    "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)​"
    Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.


    Below is a link to an example of adding a data series and setting plot values from the secondary series data.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    23 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    120 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    63 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    41 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    45 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X