Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
how to paint specific bars
Collapse
X
-
how to paint specific bars
What property or static method allows me to color specific bars? For example if I wanted to color bars 0, 3 and 8...Tags: None
-
Painting Specific Bars
Can you add this to the wishlist? I am hitting this too. I have logic that determines a bar needs colorized much later than the current bar I am on, so I would like to colorize a bar in the past. Thanks!
Comment
-
BackColor by Time
Yes; you can check the time of each bar. I typically convert my times into a number; there might be a better way, but this seems to work for me:
I hope this helps!Code:DateTime now = Time[0]; string minute = now.Minute.ToString(); if (minute.Length == 1) minute = "0" + minute; int time = int.Parse(now.Hour.ToString() + minute); // too early! if (time < 820) { BackColor = Color.Red; }
Comment
-
See if this works for you. I use it to color the overnight session. you can adjust the times you want to use, or modify it to change colors.
VTAttached Files
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
60 views
0 likes
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
145 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
161 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
97 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
283 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|

Comment