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 cmoran13, 04-16-2026, 01:02 PM
      0 responses
      43 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      25 views
      0 likes
      Last Post PaulMohn  
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      162 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      98 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      158 views
      2 likes
      Last Post CaptainJack  
      Working...
      X