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 RubenCazorla, 08-30-2022, 06:36 AM
            3 responses
            77 views
            0 likes
            Last Post PaulMohn  
            Started by f.saeidi, Yesterday, 12:14 PM
            9 responses
            23 views
            0 likes
            Last Post f.saeidi  
            Started by Tim-c, Today, 03:54 AM
            0 responses
            3 views
            0 likes
            Last Post Tim-c
            by Tim-c
             
            Started by FrancisMorro, Today, 03:24 AM
            0 responses
            4 views
            0 likes
            Last Post FrancisMorro  
            Started by Segwin, 05-07-2018, 02:15 PM
            10 responses
            1,772 views
            0 likes
            Last Post Leafcutter  
            Working...
            X