Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
I can not change the bar color.
Collapse
X
-
one more question;
this line return the current value:
double temp = FisherTransform( period )[ 0 ];
but this line make the indicator disappear, should it return the previous value instead?
//double temp1 = FisherTransform( period )[ 1 ];
Code:protected override void OnBarUpdate() { double temp = FisherTransform( period )[ 0 ]; // double temp1 = FisherTransform( period )[ 1 ]; if(temp < 0) { BackColor = Color.LightPink; // set back ground color HistDown.Set(temp); } if(temp > 0) { BackColor = Color.LightSeaGreen; // set back ground color HistUp.Set(temp); }
-
Your .cs had code errors. You should try in Initialize()Originally posted by nkhoi View PostI tried to change bar color of fishertransform but it didn't take. I can change the background color but the bar color stayed the same. In this code I tried to change the bar color when it was above zero to green.
Add(new Plot(new Pen(Color.Green, 3), PlotStyle.Bar, "HistTickUp"));
Add(new Plot(new Pen(Color.Blue, 3), PlotStyle.Bar, "HistTickDn"));
Plots[0].Min = 0;
Plots[1].Max = 0;
and then later just
HistTickUp.Set(temp);
HistTickDn.Set(temp);
Can't answer your other Q cause I don't use the indicator.
Comment
-
thanks MM, now I have 2 colors. For the histogram above zero I also want to color it red if current histogram < prev histogram. This code compiled np but I got only green color.Originally posted by marketmasher View PostYour .cs had code errors. You should try in Initialize()
Add(new Plot(new Pen(Color.Green, 3), PlotStyle.Bar, "HistTickUp"));
Add(new Plot(new Pen(Color.Blue, 3), PlotStyle.Bar, "HistTickDn"));
Plots[0].Min = 0;
Plots[1].Max = 0;
and then later just
HistTickUp.Set(temp);
HistTickDn.Set(temp);
Can't answer your other Q cause I don't use the indicator.
include is a mock up histogram and cs file.Code:if (fishValue > 0) { BackColor = Color.LightSeaGreen; // set back ground color if (fishValue > Value[1]) HistTickUp.Set(fishValue); if (fishValue < Value[1]) HistTickDn.Set(fishValue); }
Comment
-
NT 6.5 requires a different Plot statement for every color change, so you would have to add 2 more plots and then .Set them with conditions in your code.
Comment
-
add 3 more color plots, still got only 2 color histogram as before.
Code:Value.Set(fishValue); if (fishValue > 0) { BackColor = Color.LightSeaGreen; // set back ground color if (fishValue > fishPrev) HistTickUp.Set(fishValue); else if (fishValue < fishPrev) HistTickUpDn.Set(fishValue); else Neutral.Set(fishValue); }Attached Files
Comment
-
For that you need 6 Plots 1)Above 0 and > prev fishvalue 2)Above 0 and < prev 3)Below 0 and > prev 4)Below 0 and < prev 5)Above 0 and = prev 6)Below 0 and = prev. If you get 1 working, copy and edit for the rest.
Comment
-
It doesn't like my coding that is all I can tellCode:... 9/8/2009 10:50:37 AM fish value: 2.48662304611601 fishPrev: 2.94810260684861 9/8/2009 10:54:29 AM fish value: 2.21509302768946 fishPrev: 2.48662304611601 9/8/2009 10:57:19 AM fish value: 1.95689150455055 fishPrev: 2.21509302768946 9/8/2009 11:04:17 AM fish value: 2.05733592713933 fishPrev: 1.95689150455055 9/8/2009 11:09:18 AM fish value: 1.82711450569109 fishPrev: 2.05733592713933 9/8/2009 11:11:59 AM fish value: 1.2925382122535 fishPrev: 1.82711450569109 ...
Code:if (fishValue > 0) { Print(Time[0]+" fish value: "+ fishValue + " fishPrev: " + fishPrev); BackColor = Color.LightSeaGreen; // set back ground color } if (fishValue > 0 && fishValue > fishPrev) HistTickUp.Set(fishValue); if (fishValue > 0 && fishValue < fishPrev) HistTickUpDn.Set(fishValue);Attached Files
Comment
-
thanks, I see my error now plenty of fish value < 0 but not in negative I just auto assume that if it's < 0 then it's negative.Originally posted by NinjaTrader_Bertrand View Postnkhoi, it might be you can't see the color changes of the plots as the histograms overlap, have you using one bar style and one plot of linestyle in combination?
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
648 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
369 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
108 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
572 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
573 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment