Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to set set background colors

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

    How to set set background colors

    Hello,
    please with regard to the attached chart and code can you help on how:
    to modify line 106 so that only on panel 1 is applied a DarkGreen background color with the option to select a degree transparency;
    to modify line 108 so that only on the lower panel of the indicator is applied a LightGreen background color, here with the option to select a degree transparency should be already working ok as it is now.
    Thank you.
    gt

    Click image for larger version

Name:	code.JPG
Views:	572
Size:	107.0 KB
ID:	1090120
    Click image for larger version

Name:	chart.JPG
Views:	563
Size:	282.7 KB
ID:	1090121

    #2
    Hello guidoisot,

    Thanks for your post.

    The BackBrushAll method applies the back coloring across all panels regardless of the panel it is generated from. The BackBrush method would apply the back coloring to only the panel that the indicator is applied to. There are no means to have it color one color in one panel and a different color in another when applied from the same indicator.

    To have a " degree transparency" you would need to create a custom brush that you can then set the opacity to your preference. I would suggest doing this once in State.Configure, so that you are not creating an excessive number of custom brushes (unintentionally). here is an example code of creating a custom brush with 50% opacity:

    else if (State == State.Configure)
    {
    Brush temp = Brushes.DarkGreen.Clone();
    temp.Opacity = 50/ 100.0;
    temp.Freeze();
    myBrush = temp; // note myBrush was created at the class level as private Brush myBrush;
    }


    Comment


      #3
      Thank you very much @NinjaTrader_Paul.
      It worked

      Click image for larger version

Name:	ES 03-20 (1 Minute) 2020_03_12 (00_34_58).png
Views:	560
Size:	155.3 KB
ID:	1090273

      Click image for larger version

Name:	code.JPG
Views:	521
Size:	48.5 KB
ID:	1090274

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      37 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      18 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      25 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      34 views
      0 likes
      Last Post CarlTrading  
      Working...
      X