Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Visualization order for multi line oscillators

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

    Visualization order for multi line oscillators

    Hi,

    I'm trying to plot an EMA on top of a Bar indicator, but I am getting the line plot "covered" by the Bars that are drawn on top of it.

    How can I set the drawing sequence to determine with series is on top and which in the bottom?

    Thanks a lot for any help!

    #2
    Hello,

    Thank you for the question.

    Are these items both being plotted from the same indicator or are they separate indicators? Generally the order of the plots in the script determines the end result. Between multiple indicators you can run into one being plotted over the other and have to manually adjust the zorder.

    I look forward to being of further assistance.

    Comment


      #3
      HI Jesee,

      This is only one indicator, with 2 plots plotted on the same panel, one being the moving average of the other.

      As the "source" plot is a bar plot and the EMA is a line, I would like the EMA to plot on top. If not, when the bars get too close, I cannot see the line anymore.


      Add(new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Bar, "AroonC"));
      Overlay = false;
      Plots[0].Pen.Width = 3;

      Add(new Plot(Color.FromKnownColor(KnownColor.Purple), PlotStyle.Line, "Avg"));
      Overlay = false;
      Plots[1].Pen.Width = 2;

      Comment


        #4
        Hello,

        Thank you for the reply.

        In this case I believe you could just reverse the order you are creating the plots, please try the following to see if the result is what is expected:

        Code:
        protected override void Initialize()
        {
        	Add(new Plot(Color.FromKnownColor(KnownColor.Purple), PlotStyle.Line, "Avg"));
        	Overlay	= false;
        	Plots[0].Pen.Width = 6;
        	
           	Add(new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Bar, "AroonC"));
        	Overlay	= false;
        	Plots[1].Pen.Width = 8;
        }
        
        protected override void OnBarUpdate()
        {
        	Values[0].Set(50);
        	Values[1].Set(100);
        }
        I set default values and increased the pen widths to be able to see that it is on top. In my tests the Purple line is always visible over the Green bars.

        I look forward to being of further assistance.

        Comment


          #5
          Thanks Jesee


          I had tried that, but it did noty work at first because I had the order for Plot 0 and Plot 1 inverted. Did not realize it would actually make a difference.

          It is working properly now!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          620 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          359 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          562 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          566 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X