Triple Exhaustion Indicator For ThinkOrSwim

These vertical shaded regions are from the Sierra chart version of the study. They are simply the signal at a higher time. They are no different from the TOS version and can be changed to any signal that TOS is capable of displaying.
Is it possible to share sierra chart code?
 
Here's what it looks like with a Heikin Ashi Indicator




Here's the code to get the plot: Chence27's Triple Exhaustion Indicator with My Heiki Ashi
added at the bottom. I have kept them separate so you can see.


*********************************************************
## Triple Exhaustion Indicator
##
##
## CREDITS
## Requested by @Chence27 from criteria listed here https://usethinkscript.com/threads/triple-exhaustion-indicator.9001/
##
##
## Removing the header Credit credits and description is not permitted, any modification needs to be shared.
##
## V 1.0 : @cos251 - Initial release per request from www.usethinkscript.com forum thread:
## : https://usethinkscript.com/threads/triple-exhaustion-indicator.9001/
## V 1.1 : @Chence27 - modifcations to better approximate original study
##
##
##

declare upper;

# --- Inputs
input over_bought = 80;
input over_sold = 20;
input KPeriod = 10;
input DPeriod = 10;
input priceH = high;
input priceL = low;
input priceC = close;
input averageType = AverageType.SIMPLE;
input length = 1000;
input paintBars = yes;
input showLabels = yes;


# --- Indicators - StochasticSlow / MACD / MACD StDev / DMI+/-
def SlowK = reference StochasticFull(over_bought, over_sold, KPeriod, DPeriod, priceH, priceL, priceC, 3, averageType).FullK;
def MACD = reference MACD()."Value";
def priceMean = Average(MACD, length);
def MACD_stdev = (MACD - priceMean) / StDev(MACD, length);
def dPlus = reference DMI()."DI+";
def dMinus = reference DMI()."DI-";
# --- End Indicators

# --- Conditions
def sellerRegular = SlowK < 20 and MACD_stdev < -1 and dPlus < 15;
def sellerExtreme = SlowK < 20 and MACD_stdev < -2 and dPlus < 15;
def buyerRegular = SlowK > 80 and MACD_stdev > 1 and dMinus < 15;
def buyerExtreme = SlowK > 80 and MACD_stdev > 2 and dMinus < 15;
# --- End Conditions

# -- Price Color
AssignPriceColor( if paintBars and sellerExtreme then Color.CYAN else if buyerExtreme and paintBars then Color.MAGENTA else if paintBars and sellerRegular then Color.GREEN else if buyerRegular and paintBars then Color.RED else if paintBars then Color.GRAY else Color.Current);

# --- Arrows/Triggers
plot RegularBuy = if sellerRegular[1] and !sellerRegular then low else Double.NaN;

RegularBuy.SetPaintingStrategy(PaintingSTrategy.ARROW_UP);

RegularBuy.SetDefaultColor(Color.GREEN);


plot RegularSell = if buyerRegular[1] and !buyerRegular then high else Double.NaN;

RegularSell.SetPaintingStrategy(PaintingSTrategy.ARROW_Down);

RegularSell.SetDefaultColor(Color.RED);
RegularSell.SetLineWeight(3);
RegularBuy.SetLineWeight(3);
# --- Labels
AddLabel(showLabels,"SellerRegular",Color.RED);
AddLabel(showLabels,"SellerExtreme",Color.MAGENTA);
AddLabel(showLabels,"BuyerRegular",Color.GREEN);
AddLabel(showLabels,"BuyerExtreme",Color.CYAN);


#-----------------------------------------------------------------------------------------#
#-----------------------------------------------------------------------------------------#
# My Smoothed Heikin_Ashi_Moving_Average_S2
# skaboy 2010-2021
#########declare upper;
input s33_Period = 3;
input s33_Smooth = 3;
def s33_open = ExpAverage(open, s33_Period);
def s33_close = ExpAverage(close, s33_Period);
def s33_high = ExpAverage(high, s33_Period);
def s33_low = ExpAverage(low, s33_Period);

def s33_aclose = (s33_open + s33_high + s33_low + s33_close) * 0.25;
rec s33_aopen = CompoundValue(1, (s33_aopen[1] + s33_aclose[1]) * 0.5, (s33_open[1] + s33_close[1]) * 0.5);
def s33_ahigh = Max(s33_high, Max(s33_aclose, s33_aopen));
def s33_alow = Min(s33_low, Min(s33_aclose, s33_aopen));

def Avg_s33_aopen = Average(s33_aopen, s33_Period);
def Avg_s33_aclose = Average(s33_aclose, s33_Period);
def Avg_s33_ahigh = Average(s33_ahigh, s33_Smooth);
def Avg_s33_alow = Average(s33_alow, s33_Smooth);

def s33_Color = Avg_s33_aclose >= Avg_s33_aopen;
def s33_Sell = s33_Color[1] > s33_Color[0];
def s33_Buy = s33_Color[1] < s33_Color[0];

#-------------------display enhancement--------------------#
AddCloud(Avg_s33_aopen, Avg_s33_aclose, CreateColor(255, 0, 0), CreateColor(255, 255, 0));
AddCloud(Avg_s33_aopen, Avg_s33_aclose, CreateColor(255, 0, 0), CreateColor(255, 255, 0));
AddCloud(Avg_s33_aopen, Avg_s33_aclose, CreateColor(255, 0, 0), CreateColor(255, 255, 0));
#-----------------------------------------------------------------------------------------#
plot top_Signal = s33_Sell;
top_Signal.SetDefaultColor(CreateColor(255, 178, 0));
top_Signal.SetLineWeight(2);
top_Signal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

plot bot_Signal = s33_Buy;
bot_Signal.SetDefaultColor(CreateColor(255, 255, 0));
bot_Signal.SetLineWeight(2);
bot_Signal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
#-------------------end display enhancement ----------------------------#
@skaboy Do you have the Heikin Ashi Indicator by itself?
 
HELP,...what I don't understand is this count???? What are correct settings?

W5tWoKc.png
 
Last edited by a moderator:
This signal on a daily chart of BA, was perfect, an attention, signal, follow through entry.....no other candles have signaled one BIG short. Then it's up to you to understand how to read price adding to short at resistance
9iKaa5K.png
 
Last edited by a moderator:
HELP,...what I don't understand is this count???? What are correct settings?
You'll want to lower this to near 400 if you are using Daily chart or increase the amount of time you have loaded on the chart. Just needs enough data to do the calculation.
 
Last edited by a moderator:
You'll want to lower this to near 400 if you are using Daily chart or increase the amount of time you have loaded on the chart. Just needs enough data to do the calculation.
OK, I dropped it to 126, I assume these are lookback bars,.....I honestly don't trade the signals, price only, but interesting to have this pop up at same instant....there are far more signals on daily chart than previously....very good, clear signals.....
 
Last edited by a moderator:
Thanks! I will have to zoom out a bit and try.. typically I use it on the 5 minute chart and I get a ton of signals.. I will try it on 15M/1H. Thank you!
I think that is more or less a given.... shorter time frame -> more signals/shorter term reliability .... Longer time frame -> fewer signals/comparatively longer term reliability....
 
Check to see if all criteria was coded as you indicated. Hopefully this is what you were looking for.

Triple Exhaustion Indicator

4TxCJVA.jpg


Ruby:
## Triple Exhaustion Indicator
##
##
## CREDITS
## Requested by @Chence27 from criteria listed here https://usethinkscript.com/threads/triple-exhaustion-indicator.9001/
##
##
## Removing the header Credit credits and description is not permitted, any modification needs to be shared.
##
## V 1.0 :    @cos251 - Initial release per request from www.usethinkscript.com forum thread:
##       :    https://usethinkscript.com/threads/triple-exhaustion-indicator.9001/
##
##
##

declare upper;

# --- Inputs
input over_bought = 80;
input over_sold = 20;
input KPeriod = 10;
input DPeriod = 10;
input priceH = high;
input priceL = low;
input priceC = close;
input averageType = AverageType.SIMPLE;
input length = 1000;
input paintBars = yes;
input showLabels = yes;


# --- Indicators - StochasticSlow / MACD / MACD StDev / DMI+/-
def SlowK = reference StochasticFull(over_bought, over_sold, KPeriod, DPeriod, priceH, priceL, priceC, 3, averageType).FullK;
def MACD = reference MACD()."Value";
def priceMean = Average(MACD, length);
def MACD_stdev =  (MACD - priceMean) / StDev(MACD, length);
def dPlus = reference DMI()."DI+";
def dMinus = reference DMI()."DI-";
# --- End Indicators

# --- Conditions
def sellerRegular = SlowK < 20 and MACD_stdev < -1 and dPlus < 15;
def sellerExtreme = SlowK < 20 and MACD_stdev < -2 and dPlus < 15;
def buyerRegular = SlowK > 80 and MACD_stdev > 1 and dMinus < 15;
def buyerExtreme = SlowK > 80 and MACD_stdev > 2 and dMinus < 15;
# --- End Conditions

# -- Price Color
AssignPriceColor( if paintBars and sellerExtreme then Color.CYAN else if buyerExtreme and paintBars then Color.GREEN else if paintBars and sellerRegular then Color.YELLOW else if buyerRegular and paintBars then Color.DARK_GREEN else if paintBars then Color.GRAY else Color.Current);

# --- Arrows/Triggers
plot RegularBuy = if sellerRegular[1] and !sellerRegular then low else Double.NaN;
plot ExtremeBuy = if sellerExtreme[1] and !sellerExtreme then low else Double.NaN;
RegularBuy.SetPaintingStrategy(PaintingSTrategy.ARROW_UP);
ExtremeBuy.SetPaintingSTrategy(paintingSTrategy.Arrow_UP);
RegularBuy.SetDefaultColor(Color.LIME);
ExtremeBuy.SetDefaultColor(Color.GREEN);

plot RegularSell = if buyerRegular[1] and !buyerRegular then high else Double.NaN;
plot ExtremeSell = if buyerExtreme[1] and !buyerExtreme then high else Double.NaN;
RegularSell.SetPaintingStrategy(PaintingSTrategy.ARROW_Down);
ExtremeSell.SetPaintingSTrategy(paintingSTrategy.Arrow_DOWN);
RegularSell.SetDefaultColor(Color.Light_RED);
ExtremeSell.SetDefaultColor(Color.RED);

# --- Labels
AddLabel(showLabels,"SellerRegular",Color.YELLOW);
AddLabel(showLabels,"SellerExtreme",Color.CYAN);
AddLabel(showLabels,"BuyerRegular",Color.DARK_GREEN);
AddLabel(showLabels,"BuyerExtreme",Color.GREEN);


Triple Exhaustion Indicator SCAN (Scanner)
Ruby:
## Triple Exhaustion Indicator SCAN
##
##
## CREDITS
## Requested by @Chence27 from criteria listed here https://usethinkscript.com/threads/triple-exhaustion-indicator.9001/
## SCAN requested by @Trader_Andrew
##
## Removing the header Credit credits and description is not permitted, any modification needs to be shared.
##
## V 1.0 :    @cos251 - Initial release per request from www.usethinkscript.com forum thread:
##       :    https://usethinkscript.com/threads/triple-exhaustion-indicator.9001/
##       :    SCAN version requested by @Trader_Andrew
##
##
##


# --- Inputs
input over_bought = 80;
input over_sold = 20;
input KPeriod = 10;
input DPeriod = 10;
input priceH = high;
input priceL = low;
input priceC = close;
input averageType = AverageType.SIMPLE;
input length = 1000;
input paintBars = yes;
input showLabels = yes;


# --- Indicators - StochasticSlow / MACD / MACD StDev / DMI+/-
def SlowK = reference StochasticFull(over_bought, over_sold, KPeriod, DPeriod, priceH, priceL, priceC, 3, averageType).FullK;
def MACD = reference MACD()."Value";
def priceMean = Average(MACD, length);
def MACD_stdev =  (MACD - priceMean) / StDev(MACD, length);
def dPlus = reference DMI()."DI+";
def dMinus = reference DMI()."DI-";
# --- End Indicators

# --- Conditions
def sellerRegular = SlowK < 20 and MACD_stdev < -1 and dPlus < 15;
def buyerRegular = SlowK > 80 and MACD_stdev > 1 and dMinus < 15;
# --- End Conditions

# --- Arrows/Triggers
plot RegularBuyArrow = if sellerRegular[1] and !sellerRegular then 1 else Double.NaN;
plot RegularSellArrow = if buyerRegular[1] and !buyerRegular then 1 else Double.NaN;
plot RegularBuyTrendExists = if sellerRegular then 1 else Double.NaN;
plot RegularSellTrendExists = if buyerRegular then 1 else Double.NaN;
How do I get this scan to include the last 5 bars?
 
Check to see if all criteria was coded as you indicated. Hopefully this is what you were looking for.

Triple Exhaustion Indicator

4TxCJVA.jpg


Ruby:
## Triple Exhaustion Indicator
##
##
## CREDITS
## Requested by @Chence27 from criteria listed here https://usethinkscript.com/threads/triple-exhaustion-indicator.9001/
##
##
## Removing the header Credit credits and description is not permitted, any modification needs to be shared.
##
## V 1.0 :    @cos251 - Initial release per request from www.usethinkscript.com forum thread:
##       :    https://usethinkscript.com/threads/triple-exhaustion-indicator.9001/
##
##
##

declare upper;

# --- Inputs
input over_bought = 80;
input over_sold = 20;
input KPeriod = 10;
input DPeriod = 10;
input priceH = high;
input priceL = low;
input priceC = close;
input averageType = AverageType.SIMPLE;
input length = 1000;
input paintBars = yes;
input showLabels = yes;


# --- Indicators - StochasticSlow / MACD / MACD StDev / DMI+/-
def SlowK = reference StochasticFull(over_bought, over_sold, KPeriod, DPeriod, priceH, priceL, priceC, 3, averageType).FullK;
def MACD = reference MACD()."Value";
def priceMean = Average(MACD, length);
def MACD_stdev =  (MACD - priceMean) / StDev(MACD, length);
def dPlus = reference DMI()."DI+";
def dMinus = reference DMI()."DI-";
# --- End Indicators

# --- Conditions
def sellerRegular = SlowK < 20 and MACD_stdev < -1 and dPlus < 15;
def sellerExtreme = SlowK < 20 and MACD_stdev < -2 and dPlus < 15;
def buyerRegular = SlowK > 80 and MACD_stdev > 1 and dMinus < 15;
def buyerExtreme = SlowK > 80 and MACD_stdev > 2 and dMinus < 15;
# --- End Conditions

# -- Price Color
AssignPriceColor( if paintBars and sellerExtreme then Color.CYAN else if buyerExtreme and paintBars then Color.GREEN else if paintBars and sellerRegular then Color.YELLOW else if buyerRegular and paintBars then Color.DARK_GREEN else if paintBars then Color.GRAY else Color.Current);

# --- Arrows/Triggers
plot RegularBuy = if sellerRegular[1] and !sellerRegular then low else Double.NaN;
plot ExtremeBuy = if sellerExtreme[1] and !sellerExtreme then low else Double.NaN;
RegularBuy.SetPaintingStrategy(PaintingSTrategy.ARROW_UP);
ExtremeBuy.SetPaintingSTrategy(paintingSTrategy.Arrow_UP);
RegularBuy.SetDefaultColor(Color.LIME);
ExtremeBuy.SetDefaultColor(Color.GREEN);

plot RegularSell = if buyerRegular[1] and !buyerRegular then high else Double.NaN;
plot ExtremeSell = if buyerExtreme[1] and !buyerExtreme then high else Double.NaN;
RegularSell.SetPaintingStrategy(PaintingSTrategy.ARROW_Down);
ExtremeSell.SetPaintingSTrategy(paintingSTrategy.Arrow_DOWN);
RegularSell.SetDefaultColor(Color.Light_RED);
ExtremeSell.SetDefaultColor(Color.RED);

# --- Labels
AddLabel(showLabels,"SellerRegular",Color.YELLOW);
AddLabel(showLabels,"SellerExtreme",Color.CYAN);
AddLabel(showLabels,"BuyerRegular",Color.DARK_GREEN);
AddLabel(showLabels,"BuyerExtreme",Color.GREEN);


Triple Exhaustion Indicator SCAN (Scanner)
Ruby:
## Triple Exhaustion Indicator SCAN
##
##
## CREDITS
## Requested by @Chence27 from criteria listed here https://usethinkscript.com/threads/triple-exhaustion-indicator.9001/
## SCAN requested by @Trader_Andrew
##
## Removing the header Credit credits and description is not permitted, any modification needs to be shared.
##
## V 1.0 :    @cos251 - Initial release per request from www.usethinkscript.com forum thread:
##       :    https://usethinkscript.com/threads/triple-exhaustion-indicator.9001/
##       :    SCAN version requested by @Trader_Andrew
##
##
##


# --- Inputs
input over_bought = 80;
input over_sold = 20;
input KPeriod = 10;
input DPeriod = 10;
input priceH = high;
input priceL = low;
input priceC = close;
input averageType = AverageType.SIMPLE;
input length = 1000;
input paintBars = yes;
input showLabels = yes;


# --- Indicators - StochasticSlow / MACD / MACD StDev / DMI+/-
def SlowK = reference StochasticFull(over_bought, over_sold, KPeriod, DPeriod, priceH, priceL, priceC, 3, averageType).FullK;
def MACD = reference MACD()."Value";
def priceMean = Average(MACD, length);
def MACD_stdev =  (MACD - priceMean) / StDev(MACD, length);
def dPlus = reference DMI()."DI+";
def dMinus = reference DMI()."DI-";
# --- End Indicators

# --- Conditions
def sellerRegular = SlowK < 20 and MACD_stdev < -1 and dPlus < 15;
def buyerRegular = SlowK > 80 and MACD_stdev > 1 and dMinus < 15;
# --- End Conditions

# --- Arrows/Triggers
plot RegularBuyArrow = if sellerRegular[1] and !sellerRegular then 1 else Double.NaN;
plot RegularSellArrow = if buyerRegular[1] and !buyerRegular then 1 else Double.NaN;
plot RegularBuyTrendExists = if sellerRegular then 1 else Double.NaN;
plot RegularSellTrendExists = if buyerRegular then 1 else Double.NaN;
Your scanner says error in TOS. Can you instead share study layout...Thank you
 

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
568 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