Thank's Frank
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!
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
NinjaTrader
Second Chart for Multi Instrument
Collapse
X
-
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.JesseNinjaTrader Customer Service
-
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
-
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.JesseNinjaTrader Customer Service
Comment
-
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 rjbtrade1, 11-30-2023, 04:38 PM
|
2 responses
75 views
0 likes
|
Last Post
by DavidHP
Today, 08:12 AM
|
||
Started by Stanfillirenfro, Today, 07:23 AM
|
3 responses
12 views
0 likes
|
Last Post Today, 09:14 AM | ||
Started by FitSpressoHonest, Today, 09:14 AM
|
0 responses
2 views
0 likes
|
Last Post Today, 09:14 AM | ||
Started by Davide999, 05-18-2023, 03:55 AM
|
4 responses
557 views
1 like
|
Last Post
by kcwasher
Today, 09:08 AM
|
||
Started by rexsole, Today, 08:39 AM
|
2 responses
8 views
0 likes
|
Last Post Today, 09:06 AM |
Comment