Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Opacity of BarPlot Indicator

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

    Opacity of BarPlot Indicator

    Anyone figure out how to do an Opacity of 50% for bar plots in an indicator?

    I tried this and it seems to ignore the Opacity of 50% by the time the indicator runs.

    Code:
     [COLOR=#080808]Pen[/COLOR] [COLOR=#080808]m_PinkPen50[/COLOR]=[COLOR=#0000ff]new[/COLOR] [COLOR=#080808]Pen[/COLOR]([COLOR=#0000ff]new[/COLOR] [COLOR=#080808]SolidColorBrush[/COLOR]([COLOR=#080808]Colors[/COLOR].[COLOR=#080808]DeepPink[/COLOR]),[COLOR=#ff8c00]0.5[/COLOR]); 
     [COLOR=#080808]Pen[/COLOR] [COLOR=#080808]m_BlackPen50[/COLOR]=[COLOR=#0000ff]new[/COLOR] [COLOR=#080808]Pen[/COLOR]([COLOR=#0000ff]new[/COLOR] [COLOR=#080808]SolidColorBrush[/COLOR]([COLOR=#080808]Colors[/COLOR].[COLOR=#080808]Black[/COLOR]),[COLOR=#ff8c00]0.5[/COLOR]); 
     
     [COLOR=#080808]AddPlot[/COLOR]([COLOR=#080808]Brushes[/COLOR].[COLOR=#080808]LimeGreen[/COLOR], [COLOR=#b22222]"LinRegSmoothed"[/COLOR]);
     [COLOR=#080808]AddPlot[/COLOR]([COLOR=#080808]Brushes[/COLOR].[COLOR=#080808]Red[/COLOR], [COLOR=#b22222]"Slope"[/COLOR]);
     [COLOR=#080808]AddPlot[/COLOR]([COLOR=#080808]Brushes[/COLOR].[COLOR=#080808]Black[/COLOR], [COLOR=#b22222]"Accel"[/COLOR]);
     [COLOR=#080808]AddPlot[/COLOR]([COLOR=#080808]m_PinkPen50[/COLOR],[COLOR=#080808]PlotStyle[/COLOR].[COLOR=#080808]Bar[/COLOR], [COLOR=#b22222]"SlopeInt"[/COLOR]);
     [COLOR=#080808]AddPlot[/COLOR]([COLOR=#080808]m_BlackPen50[/COLOR],[COLOR=#080808]PlotStyle[/COLOR].[COLOR=#080808]Bar[/COLOR], [COLOR=#b22222]"AccelInt"[/COLOR]);

    #2
    That's 1/2 of 1%.


    Comment


      #3
      Okay,

      I think I figured it out... That was WIDTH not Opacity in the PEN constructor. This works:
      Code:
       [COLOR=#080808]Brush[/COLOR] [COLOR=#080808]b_Pink[/COLOR]=[COLOR=#0000ff]new[/COLOR] [COLOR=#080808]SolidColorBrush[/COLOR]([COLOR=#080808]Colors[/COLOR].[COLOR=#080808]DeepPink[/COLOR]);
       [COLOR=#080808]b_Pink[/COLOR].[COLOR=#080808]Opacity[/COLOR]=[COLOR=#ff8c00]0.5[/COLOR];
       
       [COLOR=#080808]Brush[/COLOR] [COLOR=#080808]b_Black[/COLOR]=[COLOR=#0000ff]new[/COLOR] [COLOR=#080808]SolidColorBrush[/COLOR]([COLOR=#080808]Colors[/COLOR].[COLOR=#080808]Black[/COLOR]);
       [COLOR=#080808]b_Black[/COLOR].[COLOR=#080808]Opacity[/COLOR]=[COLOR=#ff8c00]0.5[/COLOR];
       
       [COLOR=#080808]Pen[/COLOR] [COLOR=#080808]m_PinkPen50[/COLOR]=[COLOR=#0000ff]new[/COLOR] [COLOR=#080808]Pen[/COLOR]([COLOR=#080808]b_Pink[/COLOR],[COLOR=#ff8c00]1.0[/COLOR]); 
       [COLOR=#080808]Pen[/COLOR] [COLOR=#080808]m_BlackPen50[/COLOR]=[COLOR=#0000ff]new[/COLOR] [COLOR=#080808]Pen[/COLOR]([COLOR=#080808]b_Black[/COLOR],[COLOR=#ff8c00]1.0[/COLOR]); 
       
       [COLOR=#080808]AddPlot[/COLOR]([COLOR=#080808]Brushes[/COLOR].[COLOR=#080808]LimeGreen[/COLOR], [COLOR=#b22222]"LinRegSmoothed"[/COLOR]);
       [COLOR=#080808]AddPlot[/COLOR]([COLOR=#080808]Brushes[/COLOR].[COLOR=#080808]Red[/COLOR], [COLOR=#b22222]"Slope"[/COLOR]);
       [COLOR=#080808]AddPlot[/COLOR]([COLOR=#080808]Brushes[/COLOR].[COLOR=#080808]Black[/COLOR], [COLOR=#b22222]"Accel"[/COLOR]);
       [COLOR=#080808]AddPlot[/COLOR]([COLOR=#080808]m_PinkPen50[/COLOR],[COLOR=#080808]PlotStyle[/COLOR].[COLOR=#080808]Bar[/COLOR], [COLOR=#b22222]"SlopeInt"[/COLOR]);
       [COLOR=#080808]AddPlot[/COLOR]([COLOR=#080808]m_BlackPen50[/COLOR],[COLOR=#080808]PlotStyle[/COLOR].[COLOR=#080808]Bar[/COLOR], [COLOR=#b22222]"AccelInt"[/COLOR]);
      hopefully I get the hang of Brushes & Pens soon... Seems complex to do simple things... Think this requires a helper class in my mind.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by JonesJoker, 04-22-2024, 12:23 PM
      8 responses
      41 views
      0 likes
      Last Post JonesJoker  
      Started by timko, Today, 06:45 AM
      0 responses
      3 views
      0 likes
      Last Post timko
      by timko
       
      Started by Waxavi, 04-19-2024, 02:10 AM
      2 responses
      37 views
      0 likes
      Last Post poeds
      by poeds
       
      Started by chbruno, Yesterday, 04:10 PM
      1 response
      44 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by Max238, Today, 01:28 AM
      1 response
      25 views
      0 likes
      Last Post CactusMan  
      Working...
      X