Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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
      Chris L.NinjaTrader Customer Service

      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 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
        2 views
        0 likes
        Last Post FrancisMorro  
        Started by Segwin, 05-07-2018, 02:15 PM
        10 responses
        1,771 views
        0 likes
        Last Post Leafcutter  
        Started by Rapine Heihei, 04-23-2024, 07:51 PM
        2 responses
        31 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by Shansen, 08-30-2019, 10:18 PM
        24 responses
        945 views
        0 likes
        Last Post spwizard  
        Working...
        X