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!
See more
See less

Partner 728x90

Collapse

Chart background color

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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. thanks

    #2
    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>
    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      thanks Kate, but I'm not looking to customize the platform skin, just the background color for a specific chart.

      Comment


        #4
        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


          #5
          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


            #6
            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


              #7
              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


                #8
                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


                  #9
                  I would like to be able to change a chart background color based on conditions of an indicator on the chart. Can this be done?

                  Comment


                    #10
                    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 Files
                    Kate W.NinjaTrader Customer Service

                    Comment


                      #11
                      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 algospoke  
                      Started by ghoul, Today, 06:02 PM
                      3 responses
                      14 views
                      0 likes
                      Last Post NinjaTrader_Manfred  
                      Started by jeronymite, 04-12-2024, 04:26 PM
                      3 responses
                      45 views
                      0 likes
                      Last Post jeronymite  
                      Started by Barry Milan, Yesterday, 10:35 PM
                      7 responses
                      22 views
                      0 likes
                      Last Post NinjaTrader_Manfred  
                      Started by AttiM, 02-14-2024, 05:20 PM
                      10 responses
                      181 views
                      0 likes
                      Last Post jeronymite  
                      Working...
                      X