Bullish and Bearish Engulfing Candles in ThinkorSwim

BenTen

Administrative
Staff
VIP
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.

Gr202cS.png


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

https://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:

San

Member
2019 Donor
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

Administrative
Staff
VIP
@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:

San

Member
2019 Donor
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

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

 
Last edited:

San

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

 
Last edited:

BenTen

Administrative
Staff
VIP
@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:

San

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

 
Last edited:

San

Member
2019 Donor
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

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

SYKhPxh.png


 
Last edited:

San

Member
2019 Donor
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:

JoshLegend

New member
Hello ThinkScript Community,

I am new here, I recently discovered this community. Awesome to see members sharing their custom scripts with one another. I was wondering if someone could help create this pattern: So what I am looking for is a full candle reversal during an uptrend. The red candle must close equal to or below the previous green candle's open price. In addition, the MACD Histogram must change colors from bright green to dark green. Is it possible to have this done on multiple time frames (ex: 5M, 15M, 30M etc.) I am looking to use this pattern script to create a custom scan alert in TOS. Please let me know if you would like me to provide screenshots (via email) for reference.

Thank you so much!
 

Hguru

Member
Here is a study I have that will show the engulfing candle_Pattern with a label you might be able to use this as a starting point, the rest is up to you but your concept it interesting to get a multi signal approach to your strategy which I really like and look for myself

Hugh_TOS_EngulfingStudy_Pattern https://tos.mx/c1csOJs

add these to it as well and maybe they will help too

LB_MACD_forUpperChart https://tos.mx/TI0JuyS

My_MACD_Crossover_moveable https://tos.mx/JPi9bhX

I use orange arrows with the dots and hide the lines to see the MACD crossover on the chart easier. I also use the 8,16,5 EMA settings for the MACD they are a little faster and I like them for shorter term trades better just my thing
 

bh129022

New member
@BenTen I know it's been a year, but I'm very new to trading and I've been studying patterns. How do I get my chart to this on TOS? I'm just paper trading right now and it'd be nice to see this live, while I'm learning.
 

Similar threads

Top