• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 :

    http://www.ninjatrader.com/support/h...olorseries.htm

    http://www.ninjatrader.com/support/h...tlinecolor.htm
    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:

                  http://ninjatrader.com/support/forum...ad.php?t=22435
                  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

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by tgn55, Today, 08:57 PM
                    0 responses
                    3 views
                    0 likes
                    Last Post tgn55
                    by tgn55
                     
                    Started by chartish, Today, 04:43 PM
                    1 response
                    10 views
                    0 likes
                    Last Post NinjaTrader_EricB  
                    Started by Trader17, Today, 04:07 PM
                    0 responses
                    6 views
                    0 likes
                    Last Post Trader17  
                    Started by GussJ, Today, 01:30 PM
                    2 responses
                    20 views
                    0 likes
                    Last Post GussJ
                    by GussJ
                     
                    Started by GARZONJ, Today, 12:25 PM
                    3 responses
                    18 views
                    0 likes
                    Last Post NinjaTrader_PaulH  
                    Working...
                    X