Mr D
New member
As of today this is my favorite momentum/retracement column. To take full advantage, I set up several columns for different timeframes: I use 1,3,15,60m and 1D. Bright green and bright red indicate momentum. Cyan and Magenta indicate retracement, pullback, or reversal. I call this retracement column because I wanted to find stocks for optimal trade entry. But for me it's just too much work. All I do is wait for market open and note the general direction of SPY and QQQ. If they are bullish, I look at symbols that are all bright green. If they are bearish, I look for all bright red. If I enter early enough, on the average I'm profitable.

Ruby:
###############################
# Retracement WL Column #
# ATRTrailingStop Retracement #
# Color codes: #
# > 0.79: bright green #
# < -0.79: bright red #
# < 0.38: cyan #
# > -0.38: magenta #
# < 0: dark_red #
# > 0: dark_green #
###############################
input period=5;
input factor=3.5;
def AS = ATRTrailingStop("atr period"=period,"atr factor"=factor)[1];
def ATR = ATR(period)[1];
plot rsi= (close-AS)/(ATR*factor);
def up = rsi>0.79;
def dn = rsi<-0.79;
def ur = close[1]>AS and rsi<0.38;
def dr = close[1]<AS 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 #
#######