I would like to ask if anyone knows how to access the background color of a chart programatically? I am specifically referring to the color you set in Chart properties under Window and then Background color. I change the background color as part of my indicator set ups and I would like to revert to the original color via the program when I am done. Thank you.
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Accessing Chart Background Color
Collapse
X
-
Accessing Chart Background Color
Hi,
I would like to ask if anyone knows how to access the background color of a chart programatically? I am specifically referring to the color you set in Chart properties under Window and then Background color. I change the background color as part of my indicator set ups and I would like to revert to the original color via the program when I am done. Thank you.Tags: None
-
Hello Zeos6,
Thank you for your post.
We do not have a supported method to access the chart color properties, however another member may have some experience they can share with you.
You can always use the BackColor property to access the color value that an indicator is using.
if (BackColor == Color.Green)
// do something
More information on BackColor can be found below:
MatthewNinjaTrader Product Management
-
Originally posted by Zeos6 View PostThank you Mathew. I am aware of what you have indicated.
I understand that you do not have a supported method to access the Chart Properties but can you at least tell me where they are stored; i.e. System.Control.... or System.Windows.Forms...
Thank you.
Comment
-
I normally do not work weekends, I'm filling in for a colleague who is out enjoying the summer, but we normally have techs scheduled working the weekend.
In the case you wish to change the background under a specific condition, you may use the supported 'BackColor" property:
MatthewNinjaTrader Product Management
Comment
-
That is nice to know, that somebody is available at weekends. :-)
I know BackColorAll, but it colors only the background of bars an not the whole chart background.
Imagine, you have 10 charts on yours screen and just need to glance at it to know which is trending.
Thanks
Thomas
Comment
-
Thomas,
In that case, you'd have to use the ChartControl property in OnBarUpdate:
Code:protected override void OnBarUpdate() { if(Close[0] > SMA(5)[0]) ChartControl.BackColor = Color.Green; else if(Close[0]< SMA(5)[0]) ChartControl.BackColor = Color.Red; }
MatthewNinjaTrader Product Management
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by kempotrader, Today, 08:56 AM
|
0 responses
6 views
0 likes
|
Last Post
by kempotrader
Today, 08:56 AM
|
||
Started by kempotrader, Today, 08:54 AM
|
0 responses
4 views
0 likes
|
Last Post
by kempotrader
Today, 08:54 AM
|
||
Started by mmenigma, Today, 08:54 AM
|
0 responses
2 views
0 likes
|
Last Post
by mmenigma
Today, 08:54 AM
|
||
Started by halgo_boulder, Today, 08:44 AM
|
0 responses
1 view
0 likes
|
Last Post Today, 08:44 AM | ||
Started by drewski1980, Today, 08:24 AM
|
0 responses
4 views
0 likes
|
Last Post
by drewski1980
Today, 08:24 AM
|
Comment