Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    BertrandNinjaTrader Customer Service

    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.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by pechtri, 06-22-2023, 02:31 AM
        9 responses
        122 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by frankthearm, 04-18-2024, 09:08 AM
        16 responses
        66 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by habeebft, Today, 01:18 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by benmarkal, Today, 12:52 PM
        2 responses
        17 views
        0 likes
        Last Post benmarkal  
        Started by f.saeidi, Today, 01:38 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Working...
        X