Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to control Z order of plots within Indicator

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

    How to control Z order of plots within Indicator

    If I have an Indicator plotting a Line( PlotStyle Line) and a Histogram ( PlotStyle Bar ) How do I keep the line plot on top of the Histogram plot. I seem to remember it had to do with which is plotted first or last. But I tried reversing them and it made no difference.

    thanks

    #2
    Hello JerryWar,

    The z-order of the plots will be determined by the order in which the plots are added to the indicator code. The last one added will have the top most z-order.

    For example,

    Code:
    	AddPlot(new Stroke(Brushes.Red), PlotStyle.Bar, "PlotC");
    	AddPlot(new Stroke(Brushes.Blue),PlotStyle.Line, "PlotA");
    With the order above, the red line will be plotted over the Bar/Histogram.

    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Thank you, One Follow up question. So in Your example "PlotC" is added first. It would be Value[0] and be on top and "PlotA" would be Value[1] and be on the bottom. Assuming "PlotC" has a public Name "PlotC" and the same for "PlotA" if I Now reverse the order the order of the add statements will "PlotC" now be behind PlotA and be shared out under Value[1] because we haven't changed anything else ?

      Comment


        #4
        Originally posted by NinjaTrader_AlanP View Post
        Hello JerryWar,

        The z-order of the plots will be determined by the order in which the plots are added to the indicator code. The last one added will have the top most z-order.

        For example,

        Code:
            AddPlot(new Stroke(Brushes.Red), PlotStyle.Bar, "PlotC");
            AddPlot(new Stroke(Brushes.Blue),PlotStyle.Line, "PlotA");
        With the order above, the BLUE line will be plotted over the Bar/Histogram.

        Please let us know if you need further assistance.
        Jerry, think of the plots like a pile of cards. The last added will cover all the rest below. This is just the reverse of the way NT7 handles plots.
        eDanny
        NinjaTrader Ecosystem Vendor - Integrity Traders

        Comment


          #5
          eDanny
          I understand how Z order works. My follow up question goes to the relationship between values associated with plots and the names given to plots.

          Comment


            #6
            Hello JerryWar,

            So in Your example "PlotC" is added first. It would be Value[0] and be on top

            It would be the reverse.

            In my example the Blue PlotA would always be over the Red Plot C.

            I have attached a sample you can test by switching the order of the AddPlot calls and removing the indicator and reapplying.

            Please let us know if you need further assistance.
            Attached Files
            Alan P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by andrewtrades, Today, 04:57 PM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by chbruno, Today, 04:10 PM
            0 responses
            3 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Started by josh18955, 03-25-2023, 11:16 AM
            6 responses
            436 views
            0 likes
            Last Post Delerium  
            Started by FAQtrader, Today, 03:35 PM
            0 responses
            7 views
            0 likes
            Last Post FAQtrader  
            Started by rocketman7, Today, 09:41 AM
            5 responses
            19 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X