Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Coloring Transparent Plots

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

    Coloring Transparent Plots

    Have a small question:

    If I add a new Plot(Color.Gray, " "), I can use PlotColors[] to overwrite the color for each bar. However, if I add a new Plot(Color.Transparent, " "), this does not work. Why?

    Now you will ask, why I want to add a transparent plot. Sometimes I simply do not want to display it and I also want to access the indicator via another indicator. In both cases, just to make it faster, I do not want to set the PlotColors.

    I have found a small workaround via OnBarUpdate()

    Code:
    if (ShowPlot)
    	Plots[0].Pen.Color = Color.Gray;
    else 
    	Plots[0].Pen.Color = Color.Transparent;
    When changing indicator settings, via this code I make sure that the pen color is set to Gray first, when I want to display the Plot, so that setting PlotColors[0][0] is accepted. Also with this code I do not need to set the PlotColors, if ShowPlot is false.

    But this approach is a somewhat ridiculous. It is like painting a balustrade twice, first using a varnish against the vicissitudes of NinjaTrader, then adding the paint on top for display.

    #2
    Hi Harry, I'll look into it - I could reproduce your observation here, too.

    Comment


      #3
      I also ran into this recently.

      It occurred to me that it could be a feature, not a bug, so I did not post.

      It makes it easy to turn a plot off, by setting its Pen to be transparent, without the need to also clear PlotColors. It is also non-destructive -- you can turn the plot back on and PlotColors will have been preserved.

      --EV

      Comment


        #4
        Guys, we looked into it and unfortunately an expected limitation you're running into, transparent can't be overwritten as they are custom handled in terms of scaling.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        560 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        325 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
        547 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        547 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X