Exhaustion Signal For ThinkOrSwim

https://www.tradingview.com/script/VFjyDUJx-Exhaustion-Signal/

Would someone mind converting this? I think it would be useful especially after the huge trend we just got
check below

CSS:
# https://www.tradingview.com/v/VFjyDUJx/
#// This source code is subject to the terms of the Mozilla Public License 2.0 at https://moz
# @ChartingCycles
#indicator(title='Exhaustion Signal', shorttitle='Exhaustion', overlay=true, timeframe='')
# Converted by Sam4Cok@Samer800     - 12/2023

input chartTimeframe = yes;
input HigherTimeframe = AggregationPeriod.FIFTEEN_MIN;
input source = FundamentalType.CLOSE;
input lookback = 4;
input signalDisplay = {Default "Fast & Slow Signals", "Fast Signals", "Slow Signals"};
input fastCandleCount = 9;#,"Candle Count")
input slowCandleCount = 12;#,"Candle Count")

#// //  CALCS
def na = Double.NaN;
def fast = signalDisplay==signalDisplay."Fast Signals";
def slow = signalDisplay==signalDisplay."Slow Signals";
def CTF = Fundamental(FundamentalType = source);
def HTF = Fundamental(FundamentalType = source, Period = HigherTimeframe);
def src = if chartTimeframe then CTF else HTF;

def buySignals = if !slow and src < src[lookback] then
                 if buySignals[1] == fastCandleCount then 1 else buySignals[1] + 1 else 0;
def sellSignals = if !slow and src > src[lookback] then
                  if sellSignals[1] == fastCandleCount then 1 else sellSignals[1] + 1 else 0;

def BuyOrSell = Max(buySignals, sellSignals);

def buy =  buySignals and BuyOrSell == fastCandleCount;
def sell =  sellSignals and BuyOrSell == fastCandleCount;

#// //  CALCS

def buySignals2 = if !fast and src < src[lookback] then
                  if buySignals2[1] == slowCandleCount then 1 else buySignals2[1] + 1 else 0;
def sellSignals2 = if !fast and src > src[lookback] then
                   if sellSignals2[1] == slowCandleCount then 1 else sellSignals2[1] + 1 else 0;

def BuyOrSell2 = Max(buySignals2, sellSignals2);
def buy2 =  buySignals2 and BuyOrSell2 == slowCandleCount;
def sell2 =  sellSignals2 and BuyOrSell2 == slowCandleCount;


#//  LABELS
plot buySig = if buy then low else na;
plot sellSig = if sell then high else na;
buySig.SetPaintingStrategy(PaintingStrategy.SQUARES);
sellSig.SetPaintingStrategy(PaintingStrategy.SQUARES);
buySig.SetLineWeight(2);
sellSig.SetLineWeight(2);
buySig.SetDefaultColor(Color.CYAN);
sellSig.SetDefaultColor(Color.MAGENTA);

plot buySig2 = if buy2 then low else na;
plot sellSig2 = if sell2 then high else na;
buySig2.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_DOWN);
sellSig2.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_UP);
buySig2.SetLineWeight(2);
sellSig2.SetLineWeight(2);
buySig2.SetDefaultColor(Color.CYAN);
sellSig2.SetDefaultColor(Color.MAGENTA);


#-- End OF Code
 

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