Rather than have multiple versions, my offering is a slight modification of the original, with selectable moving average type and length. http://tos.mx/kCS5Kr2
Code:
# 3 color GRaB candles for ThinkorSwim
# Copyright 2014 Simpler Options
#
# Credit: Raghee Horner
#
# V1.01 Robert Kling Modified for 6 Color Light/Hollow and Solid/Dark Green, Red and Blue Colored Candles for ThinkorSwim
#
# The original 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)
#
# V1.02 [USER=8847]@VernT[/USER] modified to allow any moving average type and length. These are now inputs.
#
#
declare upper;
declare once_per_bar;
input avgType = AverageType.Exponential;
input avgLength = 34;
Plot avg1 = MovingAverage(avgType, high, avgLength);
plot avg2 = MovingAverage(avgType, close, avgLength);
plot avg3 = MovingAverage(avgType, low, avgLength);
avg1.SetDefaultColor(Color.GREEN);
avg1.SetLineWeight(2);
avg2.SetDefaultColor(Color.BLUE);
avg2.SetLineWeight(2);
avg3.SetDefaultColor(Color.RED);
avg3.SetLineWeight(2);
AssignPriceColor(if close > avg1 and open < close then Color.GREEN
else if close > avg1 and open >= close then Color.DARK_GREEN
else if close < avg3 and open < close then Color.RED
else if close < avg3 and open >= close then Color.DARK_RED
else if open < close then Color.CYAN
else if open >= close then Color.BLUE
else Color.BLUE);