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

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

      Click image for larger version

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

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      163 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      83 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      126 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      207 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      185 views
      0 likes
      Last Post CarlTrading  
      Working...
      X