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 Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
628 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
359 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
562 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
568 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment