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:	580
Size:	107.0 KB
ID:	1090120
    Click image for larger version

Name:	chart.JPG
Views:	574
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:	570
Size:	155.3 KB
ID:	1090273

      Click image for larger version

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

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      44 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      54 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      34 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      94 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      56 views
      0 likes
      Last Post PaulMohn  
      Working...
      X