Custom Indecision Candles for ThinkorSwim

BenTen

Administrative
Staff member
Staff
VIP
Lifetime
I look for these indecision candles on a daily basis (after market close). All of them have been shared on here before but separately. I thought it would be useful just to combine them into one single indicator. Easier to scan for new pattern.
Warning: The arrows and signals in this indicator does not suggest the direction of the stock's movement. They're there solely to point out the patterns.

EvsJMvN.png


thinkScript Code

Code:
# Ultimate Indecision Candles
# A collection of indecision candlestick patterns to help identify potential trend reversal
# Assembled by BenTen at usethinkscript.com

## Credits
#https://www.tradingview.com/script/V9Mi6eOO-CM-Blast-Off-V1-Alerts-Ready/
#https://www.tradingview.com/script/zZOCuaJN-Custom-Candle-color-Inside-Outside-candles-Highwave-Star-Patt/
#https://www.tradingview.com/script/LyNzdJVX-Spinning-Tops/
## End Credits

# Blast Off Indicator
input Period = aggregationPeriod.DAY;
input BlastOffArrow = no;
def close = close(period = Period);
def high = high(period = Period);
def open = open(period = Period);
def low = low(period = Period);
input trig = 20;
def val = absValue(close - open);
def range = high - low;
def blastOffVal = (val / range) * 100;
def trigger = trig;
def alert1 = blastOffVal < trig;
def col = blastOffVal < trig;
plot Blast_Off = if BlastOffArrow then col else double.nan;
Blast_Off.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
Blast_Off.SetDefaultColor(Color.CYAN);
Blast_Off.SetLineWeight(1);
assignPriceColor(if blastOffVal<trig then Color.MAGENTA else Color.CURRENT);
# End Blast Off

# Spinning top
input stsize = 0.5;
def spinningtop = (open > close) and((high-low)>(3* (open-close))and(((high-open)/(.001+high-low))< stsize)and(((close-low)/(.001+high-low))< stsize)) or(close>open) and((high-low)>(3* (close-open))and(((high-close)/(.001+high-low))< stsize)and(((open-low)/(.001+high-low))< stsize));
plot spinning_top = spinningtop;
spinning_top.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_UP);
spinning_top.SetDefaultColor(GetColor(1));
# End Spinnig Top

# Highwave
def Day = (high - low);
def Day_1 = (high[1] - low[1]);
def Day_2 = (high[2] - low[2]);
def Day_3 = (high[3] - low[3]);
def Day_4 = (high[4] - low[4]);
def Day_5 = (high[5] - low[5]);
def Avg = ((Day_1 + Day_2 + Day_3 + Day_4 + Day_5) / 5);
input Highwave_Wick_Multiplier = 3.0;
input Range_Multiplier = 1.0;
def Highwave = (((high - low) - (AbsValue(open - close))) > ((AbsValue(open - close)) * Highwave_Wick_Multiplier)) and((Day > (Avg* Range_Multiplier)));
plot high_wave = Highwave;
high_wave.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_DOWN);
high_wave.SetDefaultColor(GetColor(4));
# End HighWave

# Doji
input Precision = 0.01;
def doji_data = absValue(open - close) <= (high - low) * Precision;

plot doji = doji_data;
doji.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
doji.SetDefaultColor(GetColor(5));
# End Doji

A quick note about the Blast Off pattern: I added a plot for the blast off candlestick pattern in the code. However, the arrow is turned off by default since the candle is already being highlighted in pink. That being said, when you scan for this pattern, be sure to change the setting from No to Yes otherwise, it will return no result.

od2Oqok.png
 
Last edited:
I'm not able to get this code to work. There are a couple of areas at the top that are shaded in red. I'm not sure what I'm doing wrong. Can anyone help?
 
The following should work better now - there were a couple of lines which ought to have been commented out that were not. Most probably an oversight

Code:
# Ultimate Indecision Candles
# A collection of indecision candlestick patterns to help identify potential trend reversal
# Assembled by BenTen at usethinkscript.com

## Credits
#https://www.tradingview.com/script/V9Mi6eOO-CM-Blast-Off-V1-Alerts-Ready/
#https://www.tradingview.com/script/zZOCuaJN-Custom-Candle-color-Inside-Outside-candles-Highwave-Star-Patt/
#https://www.tradingview.com/script/LyNzdJVX-Spinning-Tops/
## End Credits

# Blast Off Indicator
input Period = aggregationPeriod.DAY;
input BlastOffArrow = no;
def close = close(period = Period);
def high = high(period = Period);
def open = open(period = Period);
def low = low(period = Period);
input trig = 20;
def val = absValue(close - open);
def range = high - low;
def blastOffVal = (val / range) * 100;
def trigger = trig;
def alert1 = blastOffVal < trig;
def col = blastOffVal < trig;
plot Blast_Off = if BlastOffArrow then col else double.nan;
Blast_Off.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
Blast_Off.SetDefaultColor(Color.CYAN);
Blast_Off.SetLineWeight(1);
assignPriceColor(if blastOffVal<trig then Color.MAGENTA else Color.CURRENT);
# End Blast Off

# Spinning top
input stsize = 0.5;
def spinningtop = (open > close) and((high-low)>(3* (open-close))and(((high-open)/(.001+high-low))< stsize)and(((close-low)/(.001+high-low))<

stsize)) or(close>open) and((high-low)>(3* (close-open))and(((high-close)/(.001+high-low))< stsize)and(((open-low)/(.001+high-low))< stsize));
plot spinning_top = spinningtop;
spinning_top.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_UP);
spinning_top.SetDefaultColor(GetColor(1));
# End Spinnig Top

# Highwave
def Day = (high - low);
def Day_1 = (high[1] - low[1]);
def Day_2 = (high[2] - low[2]);
def Day_3 = (high[3] - low[3]);
def Day_4 = (high[4] - low[4]);
def Day_5 = (high[5] - low[5]);
def Avg = ((Day_1 + Day_2 + Day_3 + Day_4 + Day_5) / 5);
input Highwave_Wick_Multiplier = 3.0;
input Range_Multiplier = 1.0;
def Highwave = (((high - low) - (AbsValue(open - close))) > ((AbsValue(open - close)) * Highwave_Wick_Multiplier)) and((Day > (Avg*

Range_Multiplier)));
plot high_wave = Highwave;
high_wave.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_DOWN);
high_wave.SetDefaultColor(GetColor(4));
# End HighWave

# Doji
input Precision = 0.01;
def doji_data = absValue(open - close) <= (high - low) * Precision;

plot doji = doji_data;
doji.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
doji.SetDefaultColor(GetColor(5));
# End Doji
 
Is there anyway I can find stocks that its previous candle bar Range (high-low) is less than .70 cents? I been trying to figure it out but unable to.

Thanks
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
466 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top