34-EMA Wave and GRaB Candles Indicator for ThinkorSwim

BenTen

Administrative
Staff member
Staff
VIP
Raghee Horner is the Managing Director at Simpler Trading and one of the things that she's known for is her 34-EMA Wave and GRaB Candles. I got the chance to test out the GRaB candles indicator on ThinkorSwim and it works really well. Raghee was kind enough to make her indicators public so I'm re-posting it here for you guys to check it out.

The EMA GRaB indicator produced a wave consists of:
  • The high of 34 period exponential moving average
  • The low of 34 period exponential moving average
  • The close of 34 period exponential moving average
The 34-EMA GRaB indicator helps to identify the following:
  • Uptrend market (green)
  • Downtrend market (red)
  • Sideways market (blue)

0iUs3uq.png


When using this to trade, you want to avoid trading when there are a lot of blue candles. When the candlesticks are just moving up and down between the wave, that means the stock is moving sideways. You don't want to trade in a choppy market.

thinkScript Code

Rich (BB code):
# 3 color GRaB candles for ThinkorSwim
# Copyright 2014 Simpler Options
# Modified for 6 Color Light/Hollow and Solid/Dark Green, Red and Blue Colored Candles for ThinkorSwim by Robert Kling

declare upper;
declare once_per_bar;

plot ema1 = ExpAverage (high, 34);
plot ema2 = ExpAverage (close, 34);
plot ema3 = ExpAverage (low, 34);
ema1.SetDefaultColor(Color.GREEN);
ema1.SetLineWeight(2);
ema2.SetDefaultColor(Color.BLUE);
ema2.SetLineWeight(2);
ema3.SetDefaultColor(Color.RED);
ema3.SetLineWeight(2);

AssignPriceColor(if close > ema1 and open < close then Color.GREEN
  else if close > ema1 and open >= close then Color.DARK_GREEN
  else if close < ema3 and open < close then Color.RED
  else if close < ema3 and open >= close then Color.DARK_RED
  else if open < close then Color.CYAN
  else if open >= close then Color.BLUE
  else Color.BLUE);

Shareable Link

https://tos.mx/qOne4N

Credit:
 
Last edited:

Volatility Trading Range

VTR is a momentum indicator that shows if a stock is overbought or oversold based on its Weekly and Monthly average volatility trading range.

Download the indicator

BenTen

Administrative
Staff member
Staff
VIP
@RocketShip There is no holy grail. This thing definitely has potential though. I don’t use it as my main trading strategy. However, it helps to determine the intraday trend and support / resistance.

 
Last edited:

BenTen

Administrative
Staff member
Staff
VIP
@Tom4235 I use a variety of different indicators, but the 34 ema is definitely top on my list.

 
Last edited:

Monopod

New member
VIP
Some indicators change color only after the close of the candle. This can be too long to wait if you're using 3000+ tick candles. Other indicators turn sooner and may flash back and forth for a bit within that single candle until the inflection point is truly crossed. What makes the difference?

I tested this indicator in onDemand and the candles did not change colors until well after any decent entry had passed. Is anyone using this with 5-10 minute candles and does it change only after the entire candle has printed?

The HACOLT indicator, for example, is one that does not wait until the candle has completely printed before it kicks out a signal. Of course, this means there will be times when it flashed and then reverses, but those are rare.
 

dolcea23

New member
Some indicators change color only after the close of the candle. This can be too long to wait if you're using 3000+ tick candles. Other indicators turn sooner and may flash back and forth for a bit within that single candle until the inflection point is truly crossed. What makes the difference?

I tested this indicator in onDemand and the candles did not change colors until well after any decent entry had passed. Is anyone using this with 5-10 minute candles and does it change only after the entire candle has printed?

The HACOLT indicator, for example, is one that does not wait until the candle has completely printed before it kicks out a signal. Of course, this means there will be times when it flashed and then reverses, but those are rare.
what's the hacolt indicator script?
 

Monopod

New member
VIP
Code:
TD Ameritrade IP Company, Inc. (c) 2012-2019
#

declare lower;

input temaLength = 55;
input emaLength = 60;
input candleSizeFactor = 1.1;

assert(candleSizeFactor >= 0, "'candle size factor' must not be negative: " + candleSizeFactor);

def haOpen = CompoundValue(1, (haOpen[1] + ohlc4[1]) / 2, ohlc4);
def haClose = (haOpen + Max(high, haOpen) + Min(low, haOpen) + ohlc4) / 4;
def temaHaClose = TEMA(haClose, temaLength);
def zeroLagHaClose = 2 * temaHaClose - TEMA(temaHaClose, temaLength);
def temaTypPrice = TEMA(hl2, temaLength);
def zeroLagTypPrice = 2 * temaTypPrice - TEMA(temaTypPrice, temaLength);
def shortCandle = BodyHeight() < (high - low) * candleSizeFactor;

def keepGreen = haClose >= haOpen or haClose[1] >= haOpen[1] or close >= haClose or high > high[1] or low > low[1] or zeroLagTypPrice >= zeroLagHaClose;
def keepGreenAll = keepGreen or (keepGreen[1] and (close >= open or close >= close[1]));
def holdLong = shortCandle and high >= low[1];
def utr = keepGreenAll or (keepGreenAll[1] and holdLong);

def keepRed = haClose < haOpen or haClose[1] < haOpen[1] or zeroLagTypPrice < zeroLagHaClose;
def keepRedAll = keepRed or (keepRed[1] and (close < open or close < close[1]));
def holdShort = shortCandle and low <= high[1];
def dtr = keepRedAll or (keepRedAll[1] and holdShort);

def upw = !dtr and dtr[1] and utr;
def dnw = !utr and utr[1] and dtr;
def upwSave = if upw or dnw then upw else upwSave[1];
def buy = upw or (!dnw and upwSave);
def longTermSell = close < ExpAverage(close, emaLength);
def neutral = buy or (if longTermSell then no else neutral[1]);

plot HACOLT = if buy then 100 else if neutral then 50 else 0;
HACOLT.DefineColor("Up", Color.UPTICK);
HACOLT.DefineColor("Neutral", Color.GRAY);
HACOLT.DefineColor("Down", Color.DOWNTICK);
HACOLT.AssignValueColor(if HACOLT == 100 then HACOLT.Color("Up") else if HACOLT == 50 then HACOLT.Color("Neutral") else HACOLT.Color("Down"));
 

diazlaz

Well-known member
2019 Donor
VIP
Hi @Monopod, try commenting out #declare once_per_bar; in the script and see if you notice any improvements in the refresh. this script should be pretty close to real time.
 

BenTen

Administrative
Staff member
Staff
VIP
@Monopod Take a look at the 34-ema code above. In that script there is a line: declare once_per_bar; Add # in front of it. :)
 

dolomick

Member
Hello,

I would like this script to use a Hull moving average instead of an EMA, can anyone help with that? It might not be possible for all I know, because of the way the Hull mov avg is calculated.

Thanks in advance!
 
Last edited by a moderator:

tomsk

Well-known member
VIP
Hello,

I would like this script to use a Hull moving average instead of an EMA, can anyone help with that? It might not be possible for all I know, because of the way the Hull mov avg is calculated.

Thanks in advance!

@dolomick Here's your modified study that uses a Hull Moving Average.

Code:
# 3 color GRaB candles for ThinkorSwim
# Copyright 2014 Simpler Options
# Modified for 6 Color Light/Hollow and Solid/Dark Green, Red and Blue Colored Candles for ThinkorSwim by Robert Kling

declare upper;
declare once_per_bar;

plot ema1 = HullMovingAvg (high, 34);
plot ema2 = HullMovingAvg (close, 34);
plot ema3 = HullMovingAvg (low, 34);
ema1.SetDefaultColor(Color.GREEN);
ema1.SetLineWeight(2);
ema2.SetDefaultColor(Color.BLUE);
ema2.SetLineWeight(2);
ema3.SetDefaultColor(Color.RED);
ema3.SetLineWeight(2);

AssignPriceColor(if close > ema1 and open < close then Color.GREEN
else if close > ema1 and open >= close then Color.DARK_GREEN
else if close < ema3 and open < close then Color.RED
else if close < ema3 and open >= close then Color.DARK_RED
else if open < close then Color.CYAN
else if open >= close then Color.BLUE
else Color.BLUE);
 

horserider

Well-known member
VIP
@dolomick Just made the ema into hma to avoid any possible confusion.

Code:
# 3 color GRaB candles for ThinkorSwim
# Copyright 2014 Simpler Options
# Modified for 6 Color Light/Hollow and Solid/Dark Green, Red and Blue Colored Candles for ThinkorSwim by Robert Kling
# Modified to HullMovingAvg by Horsrider 11/20/219

declare upper;
declare once_per_bar;

plot hma1 = hullMovingAvg (high, 34);
plot hma2 = hullMovingAvg (close, 34);
plot hma3 = hullMovingAvg (low, 34);
hma1.SetDefaultColor(Color.GREEN);
hma1.SetLineWeight(2);
hma2.SetDefaultColor(Color.BLUE);
hma2.SetLineWeight(2);
hma3.SetDefaultColor(Color.RED);
hma3.SetLineWeight(2);

AssignPriceColor(if close > hma1 and open < close then Color.GREEN
  else if close > hma1 and open >= close then Color.DARK_GREEN
  else if close < hma3 and open < close then Color.RED
  else if close < hma3 and open >= close then Color.DARK_RED
  else if open < close then Color.CYAN
  else if open >= close then Color.BLUE
  else Color.BLUE);
 

New Indicator: Buy the Dip

Check out our Buy the Dip indicator and see how it can help you find profitable swing trading ideas. Scanner, watchlist columns, and add-ons are included.

Download the indicator

Similar threads

Top