![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Jan 2010
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
|
I can't find a way to change the chart panel color for a previous bar on a custom indicator I developed. I know the Backcolor = Color.Salmon; command changes the color of the current bar to Salmon but is there a way to do this for a previous bar?
Similarly is there a way to change the colour of a previous bar on the chart panel. I know the Barcolor =Color.Salmon can only change the color of the current bar. Appreciate any help. |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: May 2008
Location: Denver, CO
Posts: 3,157
Thanks: 0
Thanked 3 times in 3 posts
|
Hello,
Please go here: http://www.ninjatrader-support.com/H...BackColor.html ...and copy and paste in the example section.
Ben
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jan 2010
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
|
I looked at the link posted. I guess that means that it's not possible to change for a previous bar then, only possible for the current bar? Actually what I want to do is to make known visibly in a chart, the previous bar selected by the NinjaTrader Swing().SwingHigh() function. Is there a way to do this?
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: May 2008
Location: Denver, CO
Posts: 3,157
Thanks: 0
Thanked 3 times in 3 posts
|
Hello,
The swing indicator won't work for this very well. Its values change retroactively. It takes a bit more programming to make that work.
Ben
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Aug 2009
Posts: 153
Thanks: 11
Thanked 5 times in 4 posts
|
Hi!
I want to backcolor the previous bar in a strategy. Code:
if (true)
{
set the backcolor of the previous bar to lime green
}
Since there isn't any bars_ago option in the Backcolor property, I'v tried to use the DrawRegion() method, But it don't woks the way I hoped. Code:
_zero.Set(0);
if (true)
{
DrawRegion("Mytag" + CurrentBar, CurrentBar-1, CurrentBar, _zero, 100000, Color.Empty, Color.Lime, 1);
}
Do you have any suggestion how I can backcolor the previous bar?
Last edited by poseidon_sthlm; 03-09-2010 at 07:03 AM.
|
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,404
Thanks: 252
Thanked 974 times in 957 posts
|
Have you tried something like this snippet below?
Code:
if (CurrentBar < 1) return;
DrawRegion("Region1", 1, 0, Low, High[1], Color.Black, Color.Blue, 5);
For an unsupported method you could check into the CandleStickPattern indicator and how it visualizes the found patterns.
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Bar/Candle color change with HMA slope??? | MiniDowTrader | Charting | 3 | 10-17-2012 09:00 AM |
| Get the plot/color of the of the previous bar? | Ninja B | General Programming | 3 | 01-23-2011 10:51 PM |
| I can not change the bar color. | nkhoi | General Programming | 16 | 09-08-2009 12:19 PM |
| Referencing the Color of a Previous Bar | jfalbert19 | Indicator Development | 2 | 02-17-2009 04:02 PM |
| how to change the color of a specific candlestick bar | clearpicks | Charting | 1 | 08-01-2008 02:24 PM |