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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
67 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
36 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
60 views
1 like
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
62 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
53 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment