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

Draw Region

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

    Draw Region

    Hello,
    I would like to draw region for target area between 2 different keltner channel upper bands when a fast MA is above a slow MA. When i use the following it draws region without reference to my condition.
    Draw.Region(this, "Upper Band", CurrentBar, 0, Upper1, Upper2, null, RegionBrush, Opacity, 0);

    How is the best way to draw region when condition is met?

    Thank you in advance.

    #2
    Hello rcmcd,

    Thank you for your note.

    The sample at the following link demonstrates on line 586 how you could set up a if condition for drawing a region depending on whether the fast SMA is above the slow SMA.


    You could then use the 2nd syntax at the following link, which would take your Keltner upper and lower channels,


    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the examples.

      I looked... but success eludes me!!

      I have-

      if(EMA(9)[0] > EMA(33)[0])
      Draw.Region(this, "Upper Band", CurrentBar, 0, Upper1, Upper2, null, RegionBrush, Opacity, 0);

      It draws the region for Upper when when (EMA(9) [0] < EMA(33)[0].

      What should i change?

      Thanks in advance.

      Comment


        #4
        Hello rcmcd,

        So I may best answer your question would you please provide more information on what you're question is? Could you include a screen shot of what its doing vs whats expected?

        I look forward to your reply.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          Having trouble getting it to paste. Any ideas?

          Comment


            #6
            Hello rcmcd,

            Could you please send an email to platformsupport[at]ninjatrader[dot]com with Attn: Alan P in the Subject line. Also within the email please include a link to this thread, and the screen shot file.

            I look forward to your email.
            Alan P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by f.saeidi, Today, 11:02 AM
            0 responses
            0 views
            0 likes
            Last Post f.saeidi  
            Started by geotrades1, Today, 10:02 AM
            3 responses
            10 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by rajendrasubedi2023, Today, 09:50 AM
            3 responses
            15 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by lorem, Today, 09:18 AM
            2 responses
            11 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by geddyisodin, Today, 05:20 AM
            4 responses
            30 views
            0 likes
            Last Post geddyisodin  
            Working...
            X