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

Rules for order of Plots within an indicator

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

    Rules for order of Plots within an indicator

    What are the rules regarding multiple plots in an indicator and which ones are underneath and which ones are on top? I've created an indicator with several plots and it appears that some of the plots that should be in the background are bleeding through and are covering up the plots that should be on top.

    I assume its the order of the Add plot statements in the "protected override void Initialize()" section.

    Or is it the order of the Plot statements in protected override void OnBarUpdate()"?

    Regards,
    taddypole...

    #2
    taddypole, the order in the Initialize() would count here.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Bertrand,

      I'm still having problems with the Plot order.

      I created another Indicator taking great care to order the Plots in the initialize section to get the proper layering.

      But its not working.

      The most obvious example is Plot 6 and Plot 7.
      Plot 6 is the Macd Dot Shadow. It should be black and plot first.
      Plot 7 is the Macd Dot. It should be plotted last.

      Thus I want Plot 6 to be 1 size larger than Plot 7 to produce a shadow effect or ring around Plot 7.
      Its doing just the opposite.

      Can you explain?

      Thank you,
      taddypole...
      Attached Files

      Comment


        #4
        I would try making the dot bigger than the shadow, then you should see the effect you seek.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Bertrand,

          If I make Plot 6 a "3" and Plot 7 a "2" which is the way I want it, then the effect is I have a size 3 black Dot.

          If I make Plot 6 a "2" and Plot 7 a "3" I get a black smaller Dot circled by a colored Dot. This is not what I want.

          I want a colored dot surrounded by a Black circle or "shadow".

          To me, Plot 7 is plotting first which is the colored Dot, and Plot 6 is plotted last covering up Plot 6. I need Plot 6 to be plotted before Plot 7.

          Comment


            #6
            Attached is a picture of the Indicator properties.
            Is the order of the Plots in this property dialog indicative of the order the plots are placed on the chart?

            If this list is in the order plotted it would explain the difficulty I'm having.

            bbMacdDot would be plotted before MacdDotShadow and thus when I use 3 for MacdDotShadow, it would cover up bbMacdDot no matter what color I used.
            Attached Files

            Comment


              #7
              here is a picture of the undesired output.
              If i set the pixel size of the bbMacdDots to 4 and the MacdDotShadow to 2, i get the undesired effects.
              Attached Files

              Comment


                #8
                Sorry, I'm not following what undesired effects you're talking about - both plot and you could control the overlap with the pixelsize setting? If you want to control the ZOrder of the plots individually you could create 2 indicators and then change with Shift + the mouse scroll wheel on NT7.

                There's also a custom MACD BB Line indicator in the sharing, where I believe the plot method was overwritten to achieve more control in one indicator for what you seek.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Bertrand,

                  Attached is a picture of the desired look.
                  there are 3 plots for bbmacd.
                  the middle one is the desired look.
                  the bottom one has the proper settings but as you can see the dots are completely black.
                  the top one is the best I can do with the plot order as i have it implemented. I can only make a black center with a colored outer ring.

                  I also see that some of the histogram bars are covering the macd dots. But once I figure out how to control the plot layering, I will be able to fix this too.

                  So there is something I'm not understanding. I should be able to properly control the plot order and which plot is the last to paint.

                  I need a better understanding of the layering concept and what exactly controls it.

                  Thank you,
                  taddypole...
                  Attached Files

                  Comment


                    #10
                    Please see the simple test indicator attached - Plot0 draws 'over' Plot1.
                    Attached Files
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      Does this imply that Plot0 is the last to plot?

                      And in my case that Plot7 is the first to plot?

                      Comment


                        #12
                        Correct, for Plot0 to draw over Plot1 it has to be drawn last.
                        BertrandNinjaTrader Customer Service

                        Comment


                          #13
                          Bertrand,

                          Once I understood that the highest Plot # will be plotted first and Plot 0 last, I was able to get the results I wanted.

                          Thanks for you help,
                          taddypole...

                          Comment


                            #14
                            Glad to hear you've gotten it to work they way you seeked.
                            BertrandNinjaTrader Customer Service

                            Comment


                              #15
                              Plot order

                              This is not working for me. I have "Plot0" which I want to be drawn underneath everything, up to "Plot4" which I want on top of everything. This is not working for me. In "properties" the order is the same as the "Plots[]". What am I missing?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by rocketman7, Today, 02:12 AM
                              4 responses
                              21 views
                              0 likes
                              Last Post q0t6p5
                              by q0t6p5
                               
                              Started by trilliantrader, 04-18-2024, 08:16 AM
                              7 responses
                              27 views
                              0 likes
                              Last Post NinjaTrader_BrandonH  
                              Started by samish18, 04-17-2024, 08:57 AM
                              17 responses
                              65 views
                              0 likes
                              Last Post NinjaTrader_BrandonH  
                              Started by briansaul, Today, 05:31 AM
                              1 response
                              13 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by PaulMohn, Today, 03:49 AM
                              1 response
                              12 views
                              0 likes
                              Last Post NinjaTrader_BrandonH  
                              Working...
                              X