Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ZOrder + Addplot = how ?

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

    ZOrder + Addplot = how ?

    hey everyone,

    I am trying to set the order of multiple Addplots in an indicator but I can't figure it out.

    if we use the DrawHorizontalLinesBehindPlotLines.zip (1.6 KB, 5 views) from this post :
    I want to to set a fixed Z-score for the following drawing tools and indicators: Regional Highlight Y: 6 (OR, all the way in the back) Orderflow Volume Profile (Indicator): 5 Horizontal Lines: 3 Swing (Indicator): 2 Candlesticks (or more specifically OHLC Bars): 1 (OR all the way up front) I know a code exists to do

    but instead of playing with an added DrawLine, we try to have MyPlot2 above MyPlot1, what would it look like in the code ?


    #2
    I tried something like below but it resulted with a CS1061 error :

    AddPlot(new Stroke(Brushes.Red, DashStyleHelper.Solid, 2), PlotStyle.Line, "MyPlot1");
    AddPlot(new Stroke(Brushes.Red, DashStyleHelper.Solid, 2), PlotStyle.Line, "MyPlot2");
    MyPlot1.SetZOrder(2);
    MyPlot2.SetZOrder(1);

    Comment


      #3
      Hi Amedeus, thanks for writing in. The SetZOrder method belongs to the indicator/strategy object not the individual Plots. Charts count multi plot indicators as one plot so they all share a common z order. The only workaround is to use separate indicators to separate the plots.

      Kind regards,
      -ChrisL

      Comment


        #4
        Hey Chris, thank you,

        if we try to have MyPlot2 above MyPlot1, there is another workaround that I just found here (thank you Chelsea) :


        this likely would involve some re-ordering in the properties section down the code too.

        thank you everyone, see you next time.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        587 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        341 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        555 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        552 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X