Is it possible to make an indicator with 5 plots on it? The wizard can generate up to 4 plots. Is there a way to get 5 plots in the indicator by manually adding some code? Is yes, how to do?
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
More than 4 plots in an indicator?
Collapse
X
-
Hi,
I had already tried that, but there seems to be some error because after manually adding code it doesn't display any indicator anymore (also the other 4 disappear). So I must be overlooking something...
I already had 4 plots, now I try adding one more:
protected override void Initialize()
{
Add(new Plot(Color.Orange, PlotStyle.Bar, "PRVm1"));
Add(new Plot(Color.Green, PlotStyle.Bar, "PRVm2"));
Add(new Plot(Color.DarkViolet, PlotStyle.Bar, "PRVm3"));
Add(new Plot(Color.Firebrick, PlotStyle.Bar, "PRVm4"));
ADDED --> Add(new Plot(Color.Blue, PlotStyle.Bar, "PRVm5"));
protected override void OnBarUpdate()
{
PRVm1.Set(Close[0]);
PRVm2.Set(Close[0]);
PRVm3.Set(Close[0]);
PRVm4.Set(Close[0]);
ADDED --> PRVm5.Set(Close[0]);
#region Properties
[Browsable(false)]
[XmlIgnore()]
public DataSeries PRVm1
{
get { return Values[0]; }
}
[Browsable(false)]
[XmlIgnore()]
public DataSeries PRVm2
{
get { return Values[1]; }
}
[Browsable(false)]
[XmlIgnore()]
public DataSeries PRVm3
{
get { return Values[2]; }
}
[Browsable(false)]
[XmlIgnore()]
public DataSeries PRVm4
{
get { return Values[3]; }
}
ADDED --> [Browsable(false)]
ADDED --> [XmlIgnore()]
ADDED --> public DataSeries PRVm5
ADDED --> {
ADDED --> get { return Values[4]; }
ADDED --> }
Comment
-
I got this message:
"2007-07-12 16:08 Default Error on calling the 'OnBarUpdate' method for indicator 'PRV5min2' on bar 0: Index was outside the bounds of the array."
But after closing NT6 completely and restarting, now it does display 5 indicators!
(and no error message)
So either my PC configuration is unstable or there is still some bug in NT6.
Anyway, it works now!
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by andrewtrades, Today, 04:57 PM
|
1 response
5 views
0 likes
|
Last Post Today, 05:02 PM | ||
Started by chbruno, Today, 04:10 PM
|
0 responses
3 views
0 likes
|
Last Post
by chbruno
Today, 04:10 PM
|
||
Started by josh18955, 03-25-2023, 11:16 AM
|
6 responses
436 views
0 likes
|
Last Post
by Delerium
Today, 03:42 PM
|
||
Started by FAQtrader, Today, 03:35 PM
|
0 responses
7 views
0 likes
|
Last Post
by FAQtrader
Today, 03:35 PM
|
||
Started by rocketman7, Today, 09:41 AM
|
5 responses
19 views
0 likes
|
Last Post Today, 03:33 PM |
Comment