![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Senior Member
Join Date: Aug 2008
Location: Orlando, Florida
Posts: 166
Thanks: 0
Thanked 0 times in 0 posts
|
I've followed the example in the help document and I'm having some trouble. I am using the follow code.
Code:
protected override void Initialize()
{
Add(new Plot(Color.DarkGray,PlotStyle.Bar,"myplot");
}
protected override void OnBarUpdate()
{
if (x && y && z)
Plots[0].Pen= new Pen(Color.Yellow);
if (!x && !y && !z)
Plots[0].Pen= new Pen(Color.Blue);
}
|
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,164
Thanks: 6
Thanked 46 times in 32 posts
|
Yes, you are changing the color of the entire plot (all histogram bars) not just single ones. To do what you want, add X number of plots where X is the number of different colors used. If you want to show color A, set the value only for plot A, if you want to show color b, set the value only for plot B.
Check out the system indicator source code VolumeUpDown for an example of this.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Aug 2008
Location: Orlando, Florida
Posts: 166
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks Ray!
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Get the plot/color of the of the previous bar? | Ninja B | General Programming | 3 | 01-23-2011 10:51 PM |
| Could you guys please rethink plot color changes | hygm | General Programming | 1 | 02-11-2008 10:26 PM |
| Sma To Plot Color Bars Not Lines | avlasov | Indicator Development | 4 | 12-08-2007 03:37 PM |
| Dynamic plot coloring | ThePatientOne | Indicator Development | 11 | 04-02-2007 01:06 AM |
| Changing Plot color within code | tquinn | Indicator Development | 8 | 02-19-2007 08:27 AM |