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

BackColor Usage - Can the price panel (1) and an indicator panel (2) be different?

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

    BackColor Usage - Can the price panel (1) and an indicator panel (2) be different?

    Hi all,

    I've been combing through the forums and on the web for this, but it looks like it's a limitation in Ninjascript.

    Basically I want to be able to change the BackColor of the main candlestick area on a chart (Panel 1 - Input Series) AND change the color of my Volume Panel (Panel 2 - Indicator) to a DIFFERENT color using a completely different set of custom variables.

    Right now, I'm plotting all my draw objects in the main price panel (input series) since I'm assuming the above limitation. Please let me know if this is the case!

    Yours,
    Robert
    Last edited by Spiderbird; 09-29-2012, 03:46 PM. Reason: (minor grammatical changes)

    #2
    Spiderbird,

    You could try the following :



    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Thanks! But...

      Hi Adam,

      Thanks for the reply! Problem is, I'm currently using both custom colored candles and candle outlines to indicate other things related to the chart I'm using. Good suggestion though. I'll try incorporating that as a workaround.

      Appreciate the support!

      Yours,
      Spider

      Comment


        #4
        Hi Spiderbird,

        It is possible but since both panels actually sit on the same canvass you would have to paint the background color yourself in the lower panel and keep track of panel resizing in order to adjust your coverage.

        Comment


          #5
          Hi Zoes6,

          Thanks for that. Which Ninjascript codes should I reference in order to achieve canvas background coloring? You can even just copy/paste direct URL's if it's easier.

          - Spider

          Comment


            #6
            Hi Spiderbird,

            It isn't that simple. All the things relating to the canvass are in ChartControl and ChartControl items are not supported. However, here is the basic info you need:

            ChartControl.Bounds { X = 0, Y = 0, Width = 955, Height = 860} (sample chart size)
            ChartControl.Top = ChartControl.Bounds.Top = Y = 0
            ChartControl.Bottom = ChartControl.Bounds.Bottom = ChartControl.Height = Height = 860
            ChartControl.Left = ChartControl.Bounds.Left = X = 0
            ChartControl.Right = ChartControl.Bounds.Right = ChartControl.Width = Width = 955
            // Canvas is the actual thing the program draws the chart on, so canvas size is the actual size of the drawing area for the chart.
            ChartControl.CanvasTop = 5 // Ninja sets CanvasTop = 5 by default
            ChartControl.CanvasBottom = 785 // Ninja sets CanvasBottom 75 pixels less than the ChartControl Height by default
            ChartControl.CanvasLeft = 5 // Ninja sets CanvasLeft = 5 by default
            ChartControl.CanvasRight = 893 // Ninja sets CanvasRight 62 pixels less than the ChartControl Width by default
            ChartControl.Margin { Left = 3, Top = 3, Right = 3, Bottom = 3} <--- these are the default values set by Ninja

            Comment


              #7
              There actually is an easier way as well. Change the chart background color as part of the indicator you are using in Panel 2.

              Comment


                #8
                Thanks again Zeos6! It's been a while since I've visited the topic, but I followed your outline above and I've got the panels the way I want them. Thanks again for the detailed answers.

                Just out of curosity, is there a reference online somewhere that covers unsupported aspects of Ninjatrader (like ChartControl)?

                Comment


                  #9
                  Spiderbird,

                  There are quite a few unsupported features discussed in the following thread:

                  MatthewNinjaTrader Product Management

                  Comment


                    #10
                    Originally posted by Spiderbird View Post
                    Hi all,

                    I've been combing through the forums and on the web for this, but it looks like it's a limitation in Ninjascript.

                    Basically I want to be able to change the BackColor of the main candlestick area on a chart (Panel 1 - Input Series) AND change the color of my Volume Panel (Panel 2 - Indicator) to a DIFFERENT color using a completely different set of custom variables.

                    Right now, I'm plotting all my draw objects in the main price panel (input series) since I'm assuming the above limitation. Please let me know if this is the case!

                    Yours,
                    Robert
                    This can be done with 2 lines of codes, still using supported methods. Please call BackColorAll first, then BackColor second.

                    Code:
                    BackColorAll = Color.Blue; // color the background of the PRICE panel in blue
                    BackColor = Color.Red; // color the background of the INDICATOR panel in red
                    In the second command, you can use BackColor = ChartControl.BackColor to erase the background effect on the indicator panel.

                    Work perfectly if you have exactly 2 panels on your chart.

                    Thanks.
                    Pi
                    ninZa
                    NinjaTrader Ecosystem Vendor - ninZa.co

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by alifarahani, Today, 09:40 AM
                    6 responses
                    29 views
                    0 likes
                    Last Post alifarahani  
                    Started by Waxavi, Today, 02:10 AM
                    1 response
                    17 views
                    0 likes
                    Last Post NinjaTrader_LuisH  
                    Started by Kaledus, Today, 01:29 PM
                    5 responses
                    13 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Started by Waxavi, Today, 02:00 AM
                    1 response
                    12 views
                    0 likes
                    Last Post NinjaTrader_LuisH  
                    Started by gentlebenthebear, Today, 01:30 AM
                    3 responses
                    17 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Working...
                    X