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

Name:	chart.JPG
Views:	376
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;
    }


    Paul H.NinjaTrader Customer Service

    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:	381
Size:	155.3 KB
ID:	1090273

      Click image for larger version

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

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by gentlebenthebear, Today, 01:30 AM
      0 responses
      1 view
      0 likes
      Last Post gentlebenthebear  
      Started by samish18, Yesterday, 08:31 AM
      2 responses
      8 views
      0 likes
      Last Post elirion
      by elirion
       
      Started by Mestor, 03-10-2023, 01:50 AM
      16 responses
      389 views
      0 likes
      Last Post z.franck  
      Started by rtwave, 04-12-2024, 09:30 AM
      4 responses
      31 views
      0 likes
      Last Post rtwave
      by rtwave
       
      Started by yertle, Yesterday, 08:38 AM
      7 responses
      29 views
      0 likes
      Last Post yertle
      by yertle
       
      Working...
      X