I think that I have understood what you need, please try the code below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
sto=Stochastic[14,3](close) sig=average[5](sto) irsi = rsi[8](close) if sto crosses over sig and sto<20 and irsi>irsi[1] then start=barindex endif if barindex>start and start>0 and irsi<=80 then backgroundcolor(0,200,0,100) endif if irsi crosses over 80 and start<>0 then start=0 endif return |
The background change color on the signal of the stochastic below the level 20, background go green until the RSI8 reach the 80 level.
1 user thanked author for this post.