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 Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          578 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          334 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          554 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X