Mr D
New member
Where price is in relation to three candle structure.
Ruby:
##############################
# Retracement WL Column #
# 3 candle directional #
# Color codes: #
# > 0.79: bright green #
# < -0.79: bright red #
# < 0.38: cyan #
# > -0.38: magenta #
# < 0: dark_red #
# > 0: dark_green #
##############################
def H = if high >= high[1] and high >= high[2] then high else if high[1] >= high and high[1] >= high[2] then high[1] else high[2];
def L = if low <= low[1] and low <= low[2] then low else if low[1] <= low and low[1] <= low[2] then low[1] else low[2];
plot rsi= if close>open then (close - L)/(H-L) else (close - H)/(H-L);
def up = rsi>0.79;
def dn = rsi<-0.79;
def ur = rsi>0 and rsi<0.38;
def dr = rsi<0 and rsi>-0.38;
rsi.assignValueColor( if dn or up or ur or dr then color.black else color.white);
assignbackgroundcolor(if up then color.green else if dn then color.red
else if ur then color.cyan else if dr then color.magenta
else if rsi>0 then color.dark_green else color.dark_red);
#######
# END #
#######