Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Second Chart for Multi Instrument

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

    Second Chart for Multi Instrument

    Is it possible to show a second chart of a second instrument in a multi Instrument strategy? With all Entries and Exits as for the main instrument?

    Thank's Frank

    #2
    Hello,

    Thank you for the question.

    While it is not directly possible to display the secondary series directly in a new panel, you can cause an indicator to plot prices or other values in a second panel.

    Using AddChartIndicator you can add a secondary indicator to perform plotting in another panel, we have a strategy example that demonstrates this concept: https://ninjatrader.com/support/foru...ead.php?t=6651

    Using the dummy indicator, the strategy could tell it to plot things as you need them like markers for executions or plots etc..

    I look forward to being of further assistance.

    Comment


      #3
      Thank's Jesse!

      I tried the sampleStrategyPlot. Can You help me with the syntax of OverlayPlot and PanelPlot. I want them to plot my secondary data series ^NDX.

      else if (State == State.Configure)
      {

      AddDataSeries("^NDX", BarsPeriodType.Day, 1);

      OverlayPlot = ???
      PanelPlot = ???

      Frank

      Comment


        #4
        Hello,

        You could see the following document which explains how to access data in a multi-series script:


        The first example ( Accessing the Price Data in a Multi-Bars NinjaScript) demonstrates the general syntax needed to reference your secondary series.

        You could use Closes[1][0] as one option to plot the Close price.

        I look forward to being of further assistance.

        Comment


          #5
          That works :-)


          AddDataSeries("^NDX", BarsPeriodType.Day, 1);

          OverlayPlot = new Series<double>(this);
          PanelPlot = new Series<double>(this);

          //Create an indicator which is set to overlayplot. The indicator will use this strategies references OverlayPlot series to plot.
          SampleOverlayPlot sampleOverlayPlot = SampleOverlayPlot();
          sampleOverlayPlot.Strategy = this;
          AddChartIndicator(sampleOverlayPlot);

          //Create an indicator which is set for a panel plot. The indicator will use this strategies references PanelPlot series to plot.
          SamplePanelPlot samplePanelPlot = SamplePanelPlot();
          samplePanelPlot.Strategy = this;
          AddChartIndicator(samplePanelPlot);
          }
          }

          protected override void OnBarUpdate()
          {
          //Set your plots here.
          OverlayPlot[0] = Closes[1][0];
          PanelPlot[0] = Closes[1][0];
          }

          [Browsable(false)]
          [XmlIgnore()]
          public Series<double> OverlayPlot;

          [Browsable(false)]
          [XmlIgnore()]
          public Series<double> PanelPlot;
          }
          }


          Thank's Frank

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CarlTrading, 03-31-2026, 09:41 PM
          1 response
          72 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          39 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          63 views
          2 likes
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          63 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          53 views
          0 likes
          Last Post CarlTrading  
          Working...
          X