What's the most straightforward way to programmatically (in an indicator's code) change the background color of a panel? I mean all the background of the panel at once, not just the part corresponding to one given bar. Thanks.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to code change of color of a panel background
Collapse
X
-
How to code change of color of a panel background
Hello,
What's the most straightforward way to programmatically (in an indicator's code) change the background color of a panel? I mean all the background of the panel at once, not just the part corresponding to one given bar. Thanks.Tags: None
-
Hello RyanM,
Thank you. Can the original (unmodified) color be accessed somewhere or do I have to store it in a variable if I want to get it back after I modified the values of BackColorSeries?
Comment
-
You would have to store it somewhere. Once it's been changed by code, any calls to the BackColor property will return the modified color.
Here's a quick snippet that tests for conditions in real time and changes background colors. When the conditions aren't true, it colors red.
Code:if (!Historical && Close[0] > Open[0]) for (int x = 0; x < CurrentBar; x++) { BackColorSeries[x] = Color.Green; } else for (int x = 0; x < CurrentBar; x++) { BackColorSeries[x] = Color.Red; }Ryan M.NinjaTrader Customer Service
Comment
-
Thanks a lot. I understand the values in BackColorSeries can't be recalled once they're modified but is there a property that contains the background color for the panel as it is defined by the user in the graphical interface?
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
82 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
43 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
64 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
68 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
56 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment