Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawRegion question

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

    DrawRegion question

    Hi,

    I'm trying to color a region between two MAs, lets say 10-period EMA and 25-period EMA. and I want to color the region between them in such a way that if 10-EMA is above 25-EMA its green and if its below the shaded region is red. is there a way to achieve that using DrawRegion ?

    This is how I'm trying to use it. in this case based on the most recent value the entire region changes color :

    if (ema10[0] >= ema25[0])
    {
    DrawRegion(CurrentBar.ToString()+"Shaded",CurrentB ar,0,ema10,ema25,Color.Empty,upColor,1);
    }
    else
    {
    DrawRegion(CurrentBar.ToString()+"Shaded",CurrentB ar,0,ema10,ema25,Color.Empty,dnColor,1);
    }

    thanks in advance for your help

    #2
    pls ignore this request above. I figured it out - instead of plotting it from the beginning to currentbar, I just need to plot a different region for each bar and name it accordingly, so using instead:

    rawRegion(CurrentBar.ToString()+"Shaded",1,0,ema10,ema25,Color.Empty,upColor,1);

    Comment


      #3
      Hello buylosellhi,

      Great to hear you got it figured out!

      Just let us know if we can assist you with anything else.
      DexterNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      579 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      334 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 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
      551 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X