Mr D
New member
3 Candle Swing Retracement Watchlist Column For ThinkOrSwim
This study tells you the strength of movement on a given timeframe. Set up 3-4 WL columns for your timeframes of interest, say 1m 5m 15m 60m. When they are all bright green or bright red, that's strong momentum.
This study tells you the strength of movement on a given timeframe. Set up 3-4 WL columns for your timeframes of interest, say 1m 5m 15m 60m. When they are all bright green or bright red, that's strong momentum.
Ruby:
##############################
# Retracement WL Column #
# 3 candle swing retracement #
# 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];
def HP = if high >= high[1] and high >= high[2] then 0 else if high[1] >= high and high[1] >= high[2] then 1 else 2;
def LP = if low <= low[1] and low <= low[2] then 0 else if low[1] <= low and low[1] <= low[2] then 1 else 2;
plot rsi= if lp>hp then (close - L)/(H-L) else if hp>lp then (close - H)/(H-L)
else if close>open[2] 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 #
#######
Last edited by a moderator: