Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Adding Chart Indicators to a Strategy from Multiple Data Series

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

    Adding Chart Indicators to a Strategy from Multiple Data Series

    Hello,

    I am currently messing around with NinjaScript and strategy building and ran into something I couldn't figure out. I have a strategy that uses a secondary data series inside of it. I am familiar with how to access it with BarsArray[1] et cetera. The strategy seems to pull the data from the additional data series and the logic works well. However, I want to add the indicator used with the secondary data set to the chart (presumably with AddChartIndicator()). This works fine with the primary data set. I can run the backtest and see the indicator on the backtest chart for analysis. The indicator for the additional data set does not show up. The panel is present, but the indicator values are not.

    The photo below shows a chart with ths strategy activated and a data box. You can see that the one indicator show fine. However, the one attached to the 30m series is greyed out and doesn't show on the chart.

    The code below is what I'm using. Called within State.DataLoaded.

    Code:
    AddChartIndicator(EMA(12));
    AddChartIndicator(EMA(BarsArray[1], 12));


    Where am I going wrong? Any help would be greatly appreciated.

    - atariaf

    Click image for larger version

Name:	image.png
Views:	527
Size:	43.7 KB
ID:	1277358

    #2
    Hello atariaf,

    Indicators using secondary bar series cannot be added to the chart with AddChartIndicator. Your strategy would have to add its own plot and then re plot the indicator value if you wanted to visualize one of the indicators plots.

    Comment


      #3
      Jesse,

      Thanks for the rapid response and the answer I needed. That makes sense and (of course) now I see it written write in front of the me on the documentation page. I will pay attention to the Notes section better in the future.

      - atariaf

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      58 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      133 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      73 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      50 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X