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

Unable to get region to fill

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

    Unable to get region to fill

    I've tried to get the region between 0 and the plot to fill in unsuccessfully. Can someone please help me sort this out? The plots are displayed on the chart and I've made numerous attempts based on what's been discussed in the forum here and on the help guides but cannot seem to get it right. Wt1, Wt2, and Diff are oscillator examples I'm trying to shade the region between the plot line and zero.

    Code:
                Wt1[0]     = xx[0];
                if (Wt1[0] > 0)
                    Draw.Region(this, "Wt1UP", CurrentBar, 0, Wt1, zero[0], Plots[3].Brush, Plots[3].Opacity);
                if (Wt1[0] < 0)
                    Draw.Region(this, "Wt1DN", CurrentBar, 0, Wt1, zero[0], Plots[3].Brush, Plots[3].Opacity);
                
                Wt2[0]     = SMA(Wt1, 4)[0];
                if (Wt2[0] > 0)
                    Draw.Region(this, "Wt2UP", CurrentBar, 0, Wt2, 0, Plots[4].Brush, Plots[4].Opacity);
                if (Wt2[0] < 0)
                    Draw.Region(this, "Wt2DN", CurrentBar, 0, Wt2, 0, Plots[4].Brush, Plots[4].Opacity);
                
                Diff[0] = Wt1[0] - Wt2[0];
                if (Diff[0] > 0)
                    Draw.Region(this, "DiffUP", CurrentBar, 1, Diff, 0, Plots[5].Brush,  Plots[5].Opacity);
                if (Diff[0] < 0)
                    Draw.Region(this, "DiffDN"+CurrentBar, 1, 0, Diff, zero[0], Plots[5].Brush,  Plots[5].Opacity);​

    #2
    I found the issue DrawOnPricePanel was set to true.

    Is there an example script that features SetZOrder? I understand it's not an often utilized item, but the documentation for it seems like it could be a bit more verbose and additional examples might be helpful.
    Last edited by Conceptzx; 01-14-2024, 11:35 AM.

    Comment


      #3
      Hello Conceptzx,

      Thanks for your notes.

      I am happy to hear you resolved the issue.

      We do not have a reference sample available demonstrating the use of SetZOrder() specifically.

      See the help guide documentation below for more information.

      SetZOrder(): https://ninjatrader.com/support/help.../setzorder.htm
      ZOrder: https://ninjatrader.com/support/help...art_zorder.htm
      Brandon H.NinjaTrader Customer Service

      Comment


        #4
        I read it but I'm still lost on how to use it in the script.

        Comment


          #5
          Hello Conceptzx,

          Thanks for your notes.

          SetZOrder() should be done once the State has reached State.Historical.

          Attached is a very simple test script demonstrating setting the z order so an indicator plot appears behind the bars on a chart.

          ​SetZOrder(): https://ninjatrader.com/support/help.../setzorder.htm
          ZOrder: https://ninjatrader.com/support/help...art_zorder.htm
          Attached Files
          Brandon H.NinjaTrader Customer Service

          Comment


            #6
            Thank you. I'll check it out and hopefully it'll help me figure out what I had wrong.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by lightsun47, Today, 03:51 PM
            0 responses
            5 views
            0 likes
            Last Post lightsun47  
            Started by 00nevest, Today, 02:27 PM
            1 response
            8 views
            0 likes
            Last Post 00nevest  
            Started by futtrader, 04-21-2024, 01:50 AM
            4 responses
            44 views
            0 likes
            Last Post futtrader  
            Started by Option Whisperer, Today, 09:55 AM
            1 response
            14 views
            0 likes
            Last Post bltdavid  
            Started by port119, Today, 02:43 PM
            0 responses
            9 views
            0 likes
            Last Post port119
            by port119
             
            Working...
            X