Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

gradual opacity for backbrush

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

    gradual opacity for backbrush

    Hello,
    with regard to indicator VolumeSpickeNT8 small body candles are not clearly visible when overlapped by backbrush. I have tried to solve this by modifying the code as follows:
    {
    //BackBrush = Brushes.Green;
    Draw.RegionHighlightX(this, @"longSignal_1 " + Convert.ToString(CurrentBars[0]), 1, 0, Brushes.Transparent, Brushes.Green, Convert.ToInt32(Opacity));
    }
    But in this way the background color does not exactly overlap to the bar as it was the case before using BackBrush. Is there a way to have selectable opacity for the BackBrush? so that the color is centered on the candle? Thx.
    Click image for larger version

Name:	ES 06-20 (7 Minute) 2020_05_04 (20_33_47).png
Views:	489
Size:	127.5 KB
ID:	1099035


    #2
    Hello guidoisot,

    Thanks for your post.

    The Draw methods will draw from the center of one bar to the center of another bar.
    The BackBrush method has been designed to be centered on the bar that it is applied to.

    You can create a brush and set its opacity as you wish, that brush can then be applied to the BackBrush method.

    Here is an example, done in State.Configure:

    Brush temp = PanelColorCrossAbove.Clone(); // Create a temporary copy of the user created Brush PanelColorCrossAbove
    temp.Opacity = BackgroundOpacity / 100.0; // set the desired opacity
    temp.Freeze(); // freeze the brush (required)
    PanelColorCrossAbove = temp; // assign the temp brush to the brush that will be used later in OnBarUpdate[/CODE]




    Comment


      #3
      Thank you Paul. I remember now you already explained this, or something very similar, in a previous post ... apologies for duplicating the question. Best.

      Comment

      Latest Posts

      Collapse

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