Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Shade zones in RSI

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

    Shade zones in RSI

    Hello,

    I've seen examples of shading using draw.region for EMAs on the chart, how can i shade a region for my RSI? For example, i want to shade everything in between 70 and 30 a gray color and when the value of RSI goes above 70 i want that to be colored red until i comes down below 70 and vice versa, if it goes below 30, to shade the color green until it crosses back up above 30. ?


    Please let me know if there is good example of this anywhere that i can refer to.

    Thanks,

    #2
    Hello priceisking,

    Thanks for your post.

    I would suggest a couple of approaches.

    For the region between 30 and 70 to be a gray I would suggest using Draw.RegionHighLightY(): https://ninjatrader.com/support/help...highlighty.htm
    You could draw this once, like when CurrentBar == 0) and then not have to worry about it.

    For the other parts you will need to use Draw.Region() and specify the RSI as the series and then the value of 70 or 30 to draw the color between. Your code will need to detect when it cross above and below those values in order to draw the region. The logic for such a thing would be to save the bar number where the RSI crosses above the 70 and use the bar number as part of the name of the region (tag name). As the indicator progresses you update the region to the current bar and redraw from the crossover point (bar number that you saved) So for each excursion above 70 and below 30, you will be creating separately (tag) named regions. By saving the cross bar number as part of the name of the region, you can redraw the region on the next bar and this will prevent the mistake of creating a new region on each bar. You can see an example of this logic in https://ninjatraderecosystem.com/use...acrossbuilder/

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    576 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
    553 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