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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        58 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        80 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        43 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        101 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        61 views
        0 likes
        Last Post PaulMohn  
        Working...
        X