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

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

      Click image for larger version

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

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      106 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      54 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      37 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      38 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      75 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X