Is it possible to set a max and min value for the panels below the price pane? I would like to set the y-axis to be between min = 0 and max = 1.35. If yes, how? Thank you.
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
Panel Plot Min and Max
Collapse
X
-
Zeos,
Unfortunately there is no way to set the indicator scale by code. It's based on the highest and lowest values of the indicator.
One work around to this is setting upper / lower bound plot values to the same color as the chart background.
Please let me know if I may assist further.Adam P.NinjaTrader Customer Service
-
Zeos,
Sure, http://www.ninjatrader.com/support/f...ead.php?t=3227
Please let me know if I may assist further.Adam P.NinjaTrader Customer Service
Comment
-
Zeos,
Basically :
if ( MyDataseries[0] > 1.35)
{
//set color to same as background
}
else if ( MyDataseries[0] < 0 )
{
//set color to same as background
}
I believe Color.Transparent will work. The reference sample I provided should allow you to figure out how to change colors for your plots.
Please let me know if I may assist further.Adam P.NinjaTrader Customer Service
Comment
-
Hi Adam_P,
Thank you. Your code simply cuts off the display of the data. I wanted the panel plot to remain between y-min and y-max because all values would always remain between those min and max values. So for example, if your values are always between 0 and 1 then you want the y-axis of the panel to always remain between 0 and 1. The idea is to set a min and a max value for the plot.
One way to do it would be to plot a transparent horizontal line at the min and max values but I thought that there might be a cleaner way to do this via some setting.
In fact Chart Controls allow you to set Axis.Minimum and Axis.Maximum so it should be doable in NInja.Last edited by Zeos6; 02-14-2012, 03:35 PM.
Comment
-
Zeos,
If you want to totally cut out these values, you could simply check for max/min and truncate.
I.e.
If ( MyDataSeries[0] > 1.35)
{
MyDataSeries[0] = 1.35;
}
Something like that. You can even keep track of a secondary data series that is the actual values, then truncate only the plot values.Adam P.NinjaTrader Customer Service
Comment
-
Limit a plot value
Hi Adam I have read through this post as I want to set a max value for a plot. Hope you can help as the suggestions made did not work and it is because I am working with time.
I have written a simple code to time a volume bar relative to previous bars and then color it accordingly. This shows me whether the volume is accelerating or not. I want to limit the plot value of each bar to a max of 120 secs regardless of the actual time value.
I want to do this as the first bar on Sunday pm is 179,100 secs (fri close to sunday pm open)
and the average is about 70 secs during trading hours so the 70 gets lost from the graph once the bar is plotted. Same problem over night as well.
Obviously I cant have anything less or more than 86,400 secs in a day but I was hoping to be able to terminate the plot (not the value) at 120 secs per bar.
Any ideas?
Code:
TimeSpan timer = Time[0] - Time[1];
Value.Set(timer.TotalSeconds);
Thanks;
Ben.
Comment
-
Originally posted by stocktraderbmp View PostHi Adam I have read through this post as I want to set a max value for a plot. Hope you can help as the suggestions made did not work and it is because I am working with time.
I have written a simple code to time a volume bar relative to previous bars and then color it accordingly. This shows me whether the volume is accelerating or not. I want to limit the plot value of each bar to a max of 120 secs regardless of the actual time value.
I want to do this as the first bar on Sunday pm is 179,100 secs (fri close to sunday pm open)
and the average is about 70 secs during trading hours so the 70 gets lost from the graph once the bar is plotted. Same problem over night as well.
Obviously I cant have anything less or more than 86,400 secs in a day but I was hoping to be able to terminate the plot (not the value) at 120 secs per bar.
Any ideas?
Code:
TimeSpan timer = Time[0] - Time[1];
Value.Set(timer.TotalSeconds);
Thanks;
Ben.
What is your CalculateOnBarClosed set to? Could you possible clarify what you are trying to do here? I am not sure I understand.
Setting max / min values for a plot is different than max/min amount of time you want to take into consideration for a plot.Adam P.NinjaTrader Customer Service
Comment
-
Hi Adam;
I have had a reply from one of the other guys thank you, who has solved the problem using 'Math.Min'.
Obvious when you see the answer but I was trying to formulate a maximum value during the calculation rather than when the plot is 'Set'.
Thanks for your time,
Ben.
Comment
-
Originally posted by NinjaTrader_AdamP View PostZeos,
Unfortunately there is no way to set the indicator scale by code. It's based on the highest and lowest values of the indicator.
I have the same problem. My indicator on the secondary pane usually fluctuates around 2,000 (it is >= 1950) so because NinjaTrader shows price scale from 0 to 2000, the plot becomes really flat.
is there any way to move min price scale value of 0 (why is it zero btw?) to the minimum of indicator's series value?
Thank you.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by JGriff5646, Today, 10:02 PM
|
0 responses
1 view
0 likes
|
Last Post
by JGriff5646
Today, 10:02 PM
|
||
Started by AdamDJ8, Today, 09:18 PM
|
0 responses
2 views
0 likes
|
Last Post
by AdamDJ8
Today, 09:18 PM
|
||
Started by knowmad, Today, 03:52 AM
|
2 responses
27 views
0 likes
|
Last Post
by knowmad
Today, 09:03 PM
|
||
Started by ETFVoyageur, Today, 07:05 PM
|
0 responses
10 views
0 likes
|
Last Post
by ETFVoyageur
Today, 07:05 PM
|
||
Started by Orion815, 05-02-2024, 08:39 AM
|
2 responses
18 views
0 likes
|
Last Post
by Orion815
Today, 06:24 PM
|
Comment