3 Reversal Candle Patterns Indicators for ThinkorSwim

BenTen

BenTen

Administrative
Staff
VIP
Sharing with you guys some reversal candlestick patterns for ThinkorSwim that will give buy and sell signals on your chart. Two of them were converted from TradingView indicators and the other one were shared on the ThinkorSwim chatroom.

They look something like this.





Here are indicators that will show you reversal candlestick patterns.

Reversal Candle Pattern SetUp

This was taken from TradingView and one of our members converted it to ThinkorSwim.

As you look at a bullish outside reversal pattern, you will notice that the current bar's low is lower than the prior bar's low. Essentially, the market is testing the waters below recently established lows to see if a downside follow-through will occur. When no additional selling pressure enters the market, the result is a flood of buying pressure that causes a springboard effect, thereby shooting price above the prior bar's highs and creating the beginning of a bullish advance."

thinkScript Code

Rich (BB code):
#
# WalkingBallista
# Converted from: https://www.tradingview.com/script/dk2Rl4xb-Reversal-Candle-Pattern-SetUp/
#
def reversal_long = low < low[1] and close > high[1] and open < close[1];
def reversal_short = high > high[1] and close < low[1] and open >open[1];

plot signal_long = if reversal_long then low else double.nan;
plot signal_short = if reversal_short then high else double.nan;

signal_long.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
signal_long.SetLineWeight(3);
signal_long.SetDefaultColor(color.GREEN);
signal_long.HideBubble();
signal_long.HideTitle();

signal_short.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
signal_short.SetLineWeight(3);
signal_short.SetDefaultColor(color.RED);
signal_short.HideBubble();
signal_short.HideTitle();
AddLabel(yes,"Reversal",color.CYAN);

[NM] Reversal Candles

Another indicator that was converted from TradingView platform. This one has some strict conditions.

BUY Signal reversal candle
  • Low of current candle exceeds low of previous candle
  • Low of current candle is lowest for last 7 candles
  • High of current candle exceeds high of previous candle
  • Close of current candle is in the upper 50% of the range of this candle
SELL Signal reversal candle
  • High of current candle exceeds high of previous candle
  • High of current candle is Highest for last 7 candles
  • Low of current candle exceeds low of previous candle
  • Close of current candle is in the lower 50% of the range of this candle

thinkScript Code

Rich (BB code):
#
# WalkingBallista
# Converted from: https://www.tradingview.com/script/sQcoF9i6-NM-Reversal-Candles-v01/
#
def reversal_long = low[0] < low[1] and high[0] > high[1] and close[0] > low[0] + (high[0] - low[0])/2 and low[0] < low[2] and low[0] < low[3] and low[0] < low[4] and low[0] < low[5] and low[0] < low[6] and low[0] < low[7];
def reversal_short = low[0] < low[1] and high[0] > high[1] and close[0] < high[0] - (high[0] - low[0])/2 and high[0] > high[2] and high[0] > high[3] and high[0] > high[4] and high[0] > high[5] and high[0] > high[6] and high[0] > high[7];

plot signal_long = if reversal_long then low else double.nan;
plot signal_short = if reversal_short then high else double.nan;

signal_long.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
signal_long.SetLineWeight(3);
signal_long.SetDefaultColor(color.Cyan);
signal_long.HideBubble();
signal_long.HideTitle();

signal_short.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
signal_short.SetLineWeight(3);
signal_short.SetDefaultColor(color.Magenta);
signal_short.HideBubble();
signal_short.HideTitle();

AddLabel(yes,"Reversal_MN",color.PLUM);

Bulkowski's Three Inside Up

Unlike the other two indicators, this one only identifies bullish reversal candlestick pattern. The Three Inside Up is a "bullish harami with a confirming candle as the third day".

thinkScript Code

Rich (BB code):
# Bulkowski Three Inside Up
# Nube 3.30.19
# The three inside up acts as a bullish reversal 65% of the time and price climbs 2.61% in 10 days, on average - Thomas Bulkowski, TASC 11.2011

input label = yes;

def o = open;
def h = high;
def l = low;
def c = close;

def downTrend = Sum(h < h[1], 3) == 3 and
                Sum(l < l[1], 3) == 3;

def candleOne = downtrend[1] and o > c;
def candleTwo = candleOne[1] and
                c > o        and
                ((o >= c[1] and c <  o[1]) or
                 (o >  c[1] and c <= o[1]));
def candleThree = candleTwo[1] and
                  c > o        and
                  c > c[1];

plot
ThreeInsideUp = candleThree;
ThreeInsideUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
ThreeInsideUp.SetDefaultColor(Color.White);

Addlabel(label and ThreeInsideUp, " Three Inside Up ", Color.White);

# f/ Bulkowski Three Inside Up 
AddLabel(yes,"InsideUp",color.DARK_ORANGE);
Keep in mind that these reversal candlesticks aren't the holy grail. Please use them as additional confirmation or warning for a potential reversal. I recommend pairing it with other indicators to confirm your bias.

Credits:

 
Last edited:
T

Tom4235

New member
hi is this the correct code for bulkowski inside up? thank you very much

Code:
def o = open;

def h = high;

def l = low;

def c = close;

def downTrend = Sum(h < h[1], 3) == 3 and

                Sum(l < l[1], 3) == 3;

def candleOne = downtrend[1] and o > c;

def candleTwo = candleOne[1] and

                c > o        and

                ((o >= c[1] and c <  o[1]) or

                 (o >  c[1] and c <= o[1]));

def candleThree = candleTwo[1] and

                  c > o        and

                  c > c[1];

AddLabel(yes,"InsideUp",color.DARK_ORANGE);
AddLabel(yes,"Three Inside up", Color.White);
 
Last edited by a moderator:
N

Nick

New member
VIP
Hi Ben, TOS has customised ThreeInsideUp candlestick pattern, i am unfamiliar with codes but just comparing to the codes shared above, it doesn't seem to look similar, May i request your comments pls. thanks

Code:
#
# TD Ameritrade IP Company, Inc. (c) 2011-2019
#

#wizard text: Inputs: length:

#wizard input: length

#wizard text: trend setup:

#wizard input: trendSetup

#wizard text: body factor:

#wizard input: bodyFactor

input length = 20;

input trendSetup = 3;

input bodyFactor = 0.3;

assert(bodyFactor >= 0, "'body factor' must not be negative: " + bodyFactor);

plot Bullish = Harami(length, trendSetup, bodyFactor).Bullish[1] and

    open < close and

    close > close[1];

Bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

Bullish.SetDefaultColor(GetColor(5));

Bullish.SetLineWeight(2);
 
BenTen

BenTen

Administrative
Staff
VIP
@Nick They sound similar but the code is different. I tried comparing them on a chart and they identify different candles. The one ToS provided seems to work better. Thanks for letting me know.
 

Top