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 SantoshXX, Today, 03:09 AM
        0 responses
        6 views
        0 likes
        Last Post SantoshXX  
        Started by DanielTynera, Today, 01:14 AM
        0 responses
        2 views
        0 likes
        Last Post DanielTynera  
        Started by yertle, 04-18-2024, 08:38 AM
        9 responses
        41 views
        0 likes
        Last Post yertle
        by yertle
         
        Started by techgetgame, Yesterday, 11:42 PM
        0 responses
        12 views
        0 likes
        Last Post techgetgame  
        Started by sephichapdson, Yesterday, 11:36 PM
        0 responses
        2 views
        0 likes
        Last Post sephichapdson  
        Working...
        X