Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AddPlot - Stroke opacity has no effect

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

    AddPlot - Stroke opacity has no effect

    I'm adding a plot in State.Configure:
    Code:
    AddPlot(new Stroke(VwapFallingBrush, (DashStyleHelper)VwapLineDashStyle, VwapLineThk, VwapLineOpacity), PlotStyle.Line, "VWAP");
    This plot has always 100% opacity regardless what I set here as VwapLineOpacity value. Has this opacity overload no effect when adding a new plot?

    When I google for "nt8 addplot opacity" I get a result which also mentions that 50% opacity - but in the help file itself (online) these 50% opacity aren't anywhere in the help text anymore
    Attached Files

    #2
    Hello Heart,

    Below are links to the help guide on AddPlot() and Stroke.



    Attached is a test script where I have copied and pasted the sample code from the help guide.
    Attached Files
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks NinjaTrader_ChelseaB - I adapted the code to my circumstances (e.g. AddPlot() in State.Configure and having different colors for rising/falling line using PlotBrushes).

      Here setting the opacity to a plot has no effect anymore.
      Attached Files

      Comment


        #4
        Hello Heart,

        I am not showing that you are using any opacity when setting PlotBrushes. Where you have set PlotBrushes, there will be no opacity.

        The code you have:
        Code:
        if (IsRising(RegularPlot))
        PlotBrushes[0][0] = Brushes.Blue;
        Assigns Brushes.Blue which is a brush object with no opacity.

        Set the opacity on the brush object if you want the brush object to have opacity. And make sure you freeze the brush after setting the opacity.

        Below is a link to the help guide.
        https://ninjatrader.com/support/help...gcustombrushes
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Ok, got it! That was the missing puzzle piece for me - Thanks NinjaTrader_ChelseaB

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          63 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          90 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          47 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          105 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          63 views
          0 likes
          Last Post PaulMohn  
          Working...
          X