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 CaptainJack, 05-29-2026, 05:09 AM
|
0 responses
240 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 05:09 AM
|
||
|
Started by CaptainJack, 05-29-2026, 12:02 AM
|
0 responses
156 views
0 likes
|
Last Post
by CaptainJack
05-29-2026, 12:02 AM
|
||
|
Started by charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
165 views
1 like
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
247 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
199 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|

Comment