Announcement

Collapse
No announcement yet.

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 Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            580 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            335 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            102 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            554 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