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
Chart background color
Collapse
X
-
Chart background color
Hi, i'm looking to set the chart background color that is typically set in the chart "Properties" screen in my program. But I want it set it to a custom color, not limited to the standard brush colors NT8 offers. I would also like to select the custom color in the indicator's parameter section. Any guidance or example on how this can be done is appreciated. thanksTags: None
-
Hello pman777,
Thank you for your note.
You'd actually want to customize the skin you're using for the platform rather than use an indicator.
That is actually easier than you may expect. In the xaml file for the Skin that you are using, you should find a list of defined brushes to be included in color-picker lists, near the bottom of the file, within the block <collections:ArrayList x:Key="customColorPickerList">.
You should be able to add a Brush via xaml within that block, and then select the brush via any color picker list throughout NinjaTrader 8. You should be able to use this process for any supported brush type.
Here's further information from our help guide regarding creating your own skins:
Here's some example code one user utilized to add a custom color to the color picker list:
Code:<collections:ArrayList x:Key="customColorPickerList"> <LinearGradientBrush StartPoint="0.5, -0.05" EndPoint="0.5, 0.66" po:Freeze="true"> <LinearGradientBrush.GradientStops> <GradientStop Color="{StaticResource ButtonBackgroundStop1}" Offset="0" /> <GradientStop Color="{StaticResource ButtonBackgroundStop2}" Offset="1" /> </LinearGradientBrush.GradientStops> </LinearGradientBrush> <LinearGradientBrush StartPoint="0.5, -0.05" EndPoint="0.5, 0.66" po:Freeze="true"> <LinearGradientBrush.GradientStops> <GradientStop Color="#8f6849" Offset="0" /> <GradientStop Color="#8f6849" Offset="1" /> </LinearGradientBrush.GradientStops> </LinearGradientBrush> </collections:ArrayList>
Kate W.NinjaTrader Customer Service
-
Hello pman777,
ChartControl.Properties.ChartBackground would be the property for the chart background. Note that our Help Guide advises that ChartControl Properties are intended to be set by the user and are not guaranteed to be set from a script, so mileage may vary.
ChartControl.Properties - https://ninjatrader.com/support/help...properties.htm
As for creating a custom color, you could create a brush for your own color.
Working with Brushes - https://ninjatrader.com/support/help...th_brushes.htm
As for creating a property for your indicator, you could create a string property, or you could just add a regular Brush property and type the hex code for the brush directly into the brush picker. A New indicator Wizard can be used to generate the syntax for user defined strings and brushes.
NinjaScript Wizards - https://ninjatrader.com/support/help.../ns_wizard.htm
We look forward to assisting.JimNinjaTrader Customer Service
Comment
-
RE: your post about Custom Skin changes... have been into the Blueprint file of my SlateLight subdirectory,
but only want to change two things, and can't readily determine which to change, as that file a bit complex:
First, the common backgrounds of all the Control Window tabs. i.e., Log, Accounts, Positions, ...etc.
Second, the upper chart border that holds the Navigation Bar.
SlateLight skin too white, SlateDark too black. And would suggest a happier medium as future enhancement.
Can you please tell which items I need to change for just these?
thxs much, Will
Comment
-
Hello valhallafutures,
Thank you for your reply.
The background for the Control Center is WindowBottomGradientStopColor; however, this is tied to other places within the platform as well.
The chart menu bar is controlled by BackgroundCaptionBar and BackgroundCaptionBarInactive.
A trick that helps us to find skin items is having a program that can sample hex codes to pull hex codes out of the app and then we can search the skin files and filter down the hits based on the comments.
Please let us know if we may be of further assistance to you.Kate W.NinjaTrader Customer Service
Comment
-
Kate W, thxs for these custom skin specs. Have chosen the Light Skin as the basis for Custom changes because of the need for a black font. But seems in this change, a critical little button icon arrow in the top right corner of each chart, with a hover label called "Scroll to Last Bar" has turned black with it, and because of chart backgrounds, is now lost visually. Is there a line item for just this icon arrow within the BluePrint file that does NOT change the NavBar items and dialogue box font back to white? thxs
Comment
-
Hello valhallafutures,
Thank you for your reply.
You can change the color of the Scroll to Last Bar arrow with ChartControl.AxisPen. However, this will also affect the color of the x and y axis as well, but would not affect the nav bar items or dialogue boxes.
Please let us know if we may be of further assistance to you.Kate W.NinjaTrader Customer Service
Comment
-
Hello bermarti,
Thank you for your reply.
Yes, you can control the chart background color from a script using BackBrush:
You could either modify the original indicator to change the BackBrush value to a different color based on conditions within the indicator, or you could create your own indicator, call the indicator within it and change BackBrush based on the values returned from the indicator in question. I've attached a simple example indicator that changes the background color of its panel based on whether an EMA is rising or falling that may be helpful.
Please let us know if we may be of further assistance to you.
Attached FilesKate W.NinjaTrader Customer Service
Comment
-
Hello, I
I 100% agree with OP the Black is too dark and the Gray is wayyyy to light, Additionally, if you wanted to color your chart orange or blue, you definetly cant use a predefined brush for that:
Go Ahead and Stick this in OnRender using your chartControl variable whatever it is:
chartControl.Properties.ChartBackground = new System.Windows.Media.SolidColorBrush (System.Windows.Media.Color.FromRgb (22, 26, 37));
Bye.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by algospoke, Yesterday, 06:40 PM
|
2 responses
23 views
0 likes
|
Last Post
by algospoke
Today, 07:04 PM
|
||
Started by ghoul, Today, 06:02 PM
|
3 responses
14 views
0 likes
|
Last Post Today, 06:43 PM | ||
Started by jeronymite, 04-12-2024, 04:26 PM
|
3 responses
45 views
0 likes
|
Last Post
by jeronymite
Yesterday, 10:10 PM
|
||
Started by Barry Milan, Yesterday, 10:35 PM
|
7 responses
22 views
0 likes
|
Last Post Today, 06:16 PM | ||
Started by AttiM, 02-14-2024, 05:20 PM
|
10 responses
181 views
0 likes
|
Last Post
by jeronymite
Today, 06:11 PM
|
Comment