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 sjsj2732, Yesterday, 04:31 AM
      0 responses
      38 views
      0 likes
      Last Post sjsj2732  
      Started by NullPointStrategies, 03-13-2026, 05:17 AM
      0 responses
      287 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      288 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      134 views
      1 like
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      95 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Working...
      X