Thank you.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
bool statement
Collapse
X
-
Okay, thanks. Tell me if this is possible: (the function paints the bar a specific color for a specific reason; the bars will never be painted this color unless this reason is true.) Can I, therefore, say 'if the current bar is Pink, then DrawText.....'? Is this possible?Originally posted by NinjaTrader_CodyB View Post
Thank you.
-
Hello,
Yes you could do this by checking the BarColorSeries property. For example:
For more information on BarColorSeries please see the following link: http://ninjatrader.com/support/helpG...olorseries.htmCode:if(BarColorSeries == Color.Pink) { //DO Something }Cody B.NinjaTrader Customer Service
Comment
-
Thank you, on the right track, but getting error code CS0019. "== cannot be applied....ninja.data.colorseries' and 'system.drawing.colorOriginally posted by NinjaTrader_CodyB View PostHello,
Yes you could do this by checking the BarColorSeries property. For example:
For more information on BarColorSeries please see the following link: http://ninjatrader.com/support/helpG...olorseries.htmCode:if(BarColorSeries == Color.Pink) { //DO Something }
Comment
-
Thanks. I incorporated the BarColorSeries into my indicator and it's not recognizing it. For example, I'm doing this:
{ DrawText.....}if (BarColorSeries[0] == Color.DodgerBlue && + imbalance >= 1)
My indicator results are printing as if this statement were not there. I have many IF statements before my DrawText commands. For those bars that are not DodgerBlue I've included:
It compiles fine and there are no conflicts in commands, it is just behaving as if the BarColorSeries command is not there.if (BarColorSeries[0] != Color.DodgerBlue && + imbalance >......
Do you have any Idea what I'm doing wrong?
Thank you for the help.
Comment
-
Here's a print statement:
if (BarColorSeries[0] == Color.DodgerBlue && + imbalance >= 1)
{ DrawText("imbalance" + CurrentBar, AutoScale, (+ imbalance).ToString(), 0, Low[0], -(placementimballevel), Color.Pink, ChartControl.Font, StringAlignment.Center, Color.Transparent, Color.Transparent, 0);}
Print(BarColorSeries[0].ToString());
Print(ToTime(Time[0]));
Comment
-
I do not know how to answer your question as of right now.Originally posted by NinjaTrader_CodyB View PostHello,
This snippet does not seem to be setting the BarColorSeries.
Where in your code are you setting the BarColorSeries?
I look forward to your reply.
Could you please give me an example of setting the BarColorSeries? For example, the syntax and where in the code--OnBarUpdate, I assume--it goes.
Thank you.
Comment
-
Hello,
Yes you could set the BarColorSeries in the OnBarUpdate() method.
See below for an example of setting the BarColorSeries:
Please see the following link on BarColorSeries: http://ninjatrader.com/support/helpG...olorseries.htmCode:protected override void OnBarUpdate() { if(/* Condition for when you want to set the BarColorSeries */) { BarColorSeries[0] = Color.DodgerBlue; } }Cody B.NinjaTrader Customer Service
Comment
-
Then you need to be accessing the BarColorSeries of that indicator, not of the containing class.Originally posted by imalil View PostI understand what you're saying, but I'm using a 3rd party indicator which determines the condition that makes the bar DodgerBlue. I merely want to recognize if the bar is DodgerBlue, then, if it is, run my print statement.
Does this make sense?
Thanks.
Code:ThirdPartyInd.BarColorSeries[0]
Comment
-
The developer of my 3rd party indicators sent me this:
"All values are public IntSeries or public BoolSeries. BoolSeries gives True or False
values. Bullish signals generate values of +1; Bearish signals generate values of -1."
He is not in the business of selling indicators so he will not spent a lot of time with me.
Does this help your understanding of how I can access their values?
Thank you.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
607 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
353 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 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
560 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
561 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment