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

Color both background of price chart and indicator panel

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

    Color both background of price chart and indicator panel

    Hello,

    I have a indicator which has a panel to display plots separate from the price panel.

    I would like to be able to color both the background of the indicator and the price panel.
    When I use BackColor, it colors the background of the indicator panel (which I use for one purpose). How do I color the background of the price panel for another purpose?

    Thanks.

    #2
    Hello wintermelon,

    Thank you for your post.

    You can use BackColorAll to color all panel backgrounds on the chart. You can find information on BackColorAll at the following link: http://www.ninjatrader.com/support/h...ckcolorall.htm

    You would not be able to color the price panel alone without the indicator being plotted in that panel as well and using BackColor. Otherwise you can use BackColorAll to color all panels.

    You can take a look at the following thread for information on coloring the price panel and indicator panel differently with unsupported methods: http://www.ninjatrader.com/support/f...ad.php?t=52870

    Please let me know if you have any questions.

    Comment


      #3
      Thanks Patrick, looks like it requires the use of unsupported methods.

      I'll expose a variable and create another indicator to read that just to paint the background of the price panel. It's probably easier than fiddling with ChartControl.

      Comment


        #4
        Hi,

        BackColor works on the indicator panel only. ChartControl.BackColor works on the entire chart - price oppanel and indicator panels. Use ChartControl.BackColor in OnStartUp() to set the color for the price and indicator panels. Then use BackColor to set the color of the indicator panels. Hope this helps.

        Comment


          #5
          Originally posted by NinjaTrader_PatrickH View Post
          Hello wintermelon,

          Thank you for your post.

          You can use BackColorAll to color all panel backgrounds on the chart. You can find information on BackColorAll at the following link: http://www.ninjatrader.com/support/h...ckcolorall.htm

          You would not be able to color the price panel alone without the indicator being plotted in that panel as well and using BackColor. Otherwise you can use BackColorAll to color all panels.

          You can take a look at the following thread for information on coloring the price panel and indicator panel differently with unsupported methods: http://www.ninjatrader.com/support/f...ad.php?t=52870

          Please let me know if you have any questions.
          We can still use supported methods to do this, assuming that you know the background color of your chart (say White):

          BackColorAll = Color.Red; // highlight the background of the PRICE panel in red
          BackColor = Color.White; // restore the background of the INDICATOR panel
          To have a universal solution, you will still need to access the unsupported property ChartControl.BackColor to get the background color of your chart programmatically:
          BackColorAll = Color.Red; // highlight the background of the PRICE panel in red
          BackColor = ChartControl.BackColor; // restore the background of the INDICATOR panel
          The order is critical. Make sure you call BackColorAll first, and BackColor second.

          The only drawback is that if you have more than 2 panels, then all the panels (except the one where we attach our programmed indicator) will have the background effect. The solution is perfect if we have exactly 2 panels.

          Please see the attached screenshot.

          Thanks.
          Pi
          Attached Files
          Last edited by ninZa; 12-08-2014, 08:48 PM.
          ninZa
          NinjaTrader Ecosystem Vendor - ninZa.co

          Comment


            #6
            At one time I did have a indicator that would paint background with the 'Slope MA' It had option for selecting background or not. I'm having a hard time bringing up this indicator in the 'search' window.

            I think it was called ... ana slope .. ? something like that? I'm still looking for it.

            Comment


              #7
              Hello trdninstyle,

              Thank you for your post and welcome to the NinjaTrader Support Forum!

              I was unable to locate such an indicator based off of your description. However, one of our members may be familiar with the indicator you are looking for.

              Comment


                #8
                Thank you Patrick.. sorry it took so long to get back.. wasn't use to posting & reading responses. Just the other day you helped me over the ph. w/ adding 2 charts in one but in unirenko which we found out it can't do it. So I can read trigger lines from alt charts on 1 chart.

                Go Bears!

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by XXtrader, Yesterday, 11:30 PM
                2 responses
                11 views
                0 likes
                Last Post XXtrader  
                Started by Waxavi, Today, 02:10 AM
                0 responses
                6 views
                0 likes
                Last Post Waxavi
                by Waxavi
                 
                Started by TradeForge, Today, 02:09 AM
                0 responses
                11 views
                0 likes
                Last Post TradeForge  
                Started by Waxavi, Today, 02:00 AM
                0 responses
                2 views
                0 likes
                Last Post Waxavi
                by Waxavi
                 
                Started by elirion, Today, 01:36 AM
                0 responses
                7 views
                0 likes
                Last Post elirion
                by elirion
                 
                Working...
                X