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
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); }
-
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
-
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.
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
-
Code:... 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
-
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 kaywai, 09-01-2023, 08:44 PM
|
5 responses
601 views
0 likes
|
Last Post Today, 12:32 AM | ||
Started by xiinteractive, 04-09-2024, 08:08 AM
|
6 responses
22 views
0 likes
|
Last Post Today, 12:31 AM | ||
Started by Pattontje, Yesterday, 02:10 PM
|
2 responses
19 views
0 likes
|
Last Post
by Pattontje
Yesterday, 11:49 PM
|
||
Started by flybuzz, 04-21-2024, 04:07 PM
|
17 responses
230 views
0 likes
|
Last Post
by TradingLoss
Yesterday, 11:45 PM
|
||
Started by agclub, 04-21-2024, 08:57 PM
|
3 responses
17 views
0 likes
|
Last Post
by TradingLoss
Yesterday, 11:42 PM
|
Comment