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

Comment