Auto Display Bullish and Bearish Engulfing Candles on ThinkorSwim

BenTen

BenTen

Administrative
Staff
VIP
Warehouse
Engulfing pattern on your candlestick chart can be useful for identifying trend changes, potential reversal play, etc. Here is an indicator for ThinkorSwim that will automatically find and highlight Engulfing candle on your chart. Both bullish and bearish engulfing patterns.

I also included labels and a unique color for each type of pattern. By default, a bullish engulfing candle will be yellow and a bearish engulfing candle will be purple. You can change this via the source code. This works for any timeframes.



thinkScript Code
Rich (BB code):
#
# TD Ameritrade IP Company, Inc. (c) 2011-2018
# Modified by BenTen @ usethinkscript.com
#
#wizard plots
#wizard text: Inputs: length:
#wizard input: length
#wizard text: trend setup:
#wizard input: trendSetup

input length = 20;
input trendSetup = 3;

def BodyMax = Max(open, close);
def BodyMin = Min(open, close);
def IsEngulfing = BodyMax > BodyMax[1] and
    BodyMin < BodyMin[1];
def IsWhite = open < close;
def IsBlack = open > close;
def IsPrevDoji = IsDoji(length)[1];

plot Bearish = IsAscending(close, trendSetup)[1] and
    (IsWhite[1] or IsPrevDoji) and
    IsBlack and
    IsEngulfing;

plot Bullish = IsDescending(close, trendSetup)[1] and
    (IsBlack[1] or IsPrevDoji) and
    IsWhite and
    IsEngulfing;

assignpriceColor(if Bearish then Color.VIOLET else if Bullish then Color.Yellow else Color.Current);
AddLabel(yes,"Bu_Engulf",color.Yellow);
AddLabel(yes,"Be_Engulf",color.VIOLET);
Shareable Link
http://tos.mx/nirPCb

P.S: To fix the shrinking issue, be sure to untick "Show Plot" for Bullish and Bearish options in the indicator's setting.

 
Last edited:
C

Chenthy73

New member
Thanks a lot for sharing this.

 
Last edited:
S

San

Member
VIP
Hi Ben, Please let us know which are the study script you used in this chart, because after i upload Englulfing pattern i could not see the chart what you posted.



I added my chart only nly Engulfing script and set for1 year 1 day chart but i don't see correct format and i tried 20 days with 1mts, 5mts,15mts 1hour but don't see correct format.

 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@San For this particular indicator, it will only make changes to the candles on your chart. If either a bullish or bearish engulfing candle is detected, it will highlight the candle for you. As for other indicators in that picture, you can find them directly in ThinkorSwim. Look up Bollinger Band, Exponential Moving Average and add them.

 
Last edited:
S

San

Member
VIP
Never Mind, This will support 1mts chart?

because i tried 1mt/5mts and 15mts all shows shrink. Even 1year 1 day chart shows very small candle.

 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@San This indicator should not shrink anything. Can you put it on a naked chart with no other indicators?

 
Last edited:
S

San

Member
VIP
Yep i tried naked chart. Please confirm which time frame this will support.. might be i am doing something wrong.

 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@San It will support any timeframes so long as there are bullish and/or bearish candlesticks presented. My apology about the shrinking issue. Untick "Show Plot" for Bullish and Bearish settings :)

 
Last edited:
S

San

Member
VIP
I don't know what to say your support..... I really appreciate your support.... Now its working.. Thanks lot.... :)

 
Last edited:
S

San

Member
VIP
Ben, Is it possible to include same script , Candle stick pattern like Hammer/Inverted Hammer/Hanging man/Spinning candle/Doji/shooting star. Thanks in advance..

 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@San That is already built-in with ToS as well. Click on the Patterns section and choose which candlesticks you want to add in.



 
Last edited:
S

San

Member
VIP
Yes u r correct, But its possible to customize all in one script and i tried to combine and i used existing script but its not shows correctly.. or I am wrong..

 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@San Just posted the script. Check it out.

 
Last edited:
S

San

Member
VIP
Thanks.. I will try and keep you posted my feedback..

 
Last edited:

Top