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 SalmaTrader, 07-07-2026, 10:26 PM
|
0 responses
52 views
0 likes
|
Last Post
by SalmaTrader
07-07-2026, 10:26 PM
|
||
|
Started by CarlTrading, 07-05-2026, 01:16 PM
|
0 responses
23 views
0 likes
|
Last Post
by CarlTrading
07-05-2026, 01:16 PM
|
||
|
Started by CaptainJack, 06-17-2026, 10:32 AM
|
0 responses
16 views
0 likes
|
Last Post
by CaptainJack
06-17-2026, 10:32 AM
|
||
|
Started by kinfxhk, 06-17-2026, 04:15 AM
|
0 responses
23 views
0 likes
|
Last Post
by kinfxhk
06-17-2026, 04:15 AM
|
||
|
Started by kinfxhk, 06-17-2026, 04:06 AM
|
0 responses
24 views
0 likes
|
Last Post
by kinfxhk
06-17-2026, 04:06 AM
|

Comment