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

Transarent plots

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

    Transarent plots

    Hi,

    I have seen variations on this question but none directly address my issue. I have two plots and I want to shade (DrawRegion) the space between them differnt colors under different conditions.

    So far so good, but I would like the actual boundary lines not to show so I am left with only the shading. I have tried both using the background color of the chart and Transparent but if I use plot the lines using the background color, everything goes away in the panel.

    If I use Transparent for both the plot colors, I get essentially a line the color of how I shaded the region i.e. blue shaded region with transparent plots leaves me with a flat blue line. Then if the next area would have been shaded gold, I get a flat gold line.

    If I change the plot colors to anything else, I get everything back to normal but then of course, I have the plots showing.

    If it is possible to change the plot color dynamically, since I know the color that is used for shading, I could change the plot color to that color but that seems to have other side affects.

    Interestingly enough, I have discovered I can set one of the two plots to transparent and still get the shading now if I could just get rid of the other plot.

    Seems there should be a way around this but no luck on my end.

    Best Regards,
    Scott
    Last edited by ScottB; 02-24-2011, 12:17 AM.

    #2
    Hi Scott, interesting question - why use the plots then at all?

    You would want to use the sharing / drawregion only as visualization, correct? In this case just calculate your boundary values as internal dataseries and use those for the drawregion then.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Bertrand, I tried that but all I get is the flat line of different colors I described above.

      Scott

      Comment


        #4
        Scott, would you share the code with me at support at ninjatrader dot com I could give it a run here on my end?

        Thanks,
        BertrandNinjaTrader Customer Service

        Comment


          #5
          There are two ways that I can think of.

          1. Do not use plots. Instead put your calculated plot values into 2 separate DataSeries, and shade the region between the DataSeries.

          OR

          2. In the code block where you change the region color, also change the plot colors to the same.

          Code:
          if(ConditionIsMet)
          {
          PlotColors[0][0] = Color.RegionColor;
          PlotColors[1][0] = Color.RegionColor;
          DrawRegion(... ,RegionColor, ...)
          }

          Comment


            #6
            koganam, thanks for the idea. I tried that but apparently when you are in a panel (not the main chart), you have to have at least one plot.

            Comment


              #7
              Originally posted by ScottB View Post
              koganam, thanks for the idea. I tried that but apparently when you are in a panel (not the main chart), you have to have at least one plot.
              It sounds to me that you must have something else wrong then. Attached is a picture of my TrendIntensityMap indicator. The top band shows the bullish intensity, the middle the bearish, and the bottom the combined. It has no Plot and it uses the technique with DataSeries, that I described, for coloring the regions. You can see that there is no bounding line on any of the ribbons.
              Attached Files

              Comment


                #8
                Nice work, I will look at it some more. Thanks for taking the time.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Waxavi, Today, 02:10 AM
                0 responses
                3 views
                0 likes
                Last Post Waxavi
                by Waxavi
                 
                Started by TradeForge, Today, 02:09 AM
                0 responses
                7 views
                0 likes
                Last Post TradeForge  
                Started by Waxavi, Today, 02:00 AM
                0 responses
                2 views
                0 likes
                Last Post Waxavi
                by Waxavi
                 
                Started by elirion, Today, 01:36 AM
                0 responses
                4 views
                0 likes
                Last Post elirion
                by elirion
                 
                Started by gentlebenthebear, Today, 01:30 AM
                0 responses
                4 views
                0 likes
                Last Post gentlebenthebear  
                Working...
                X