• Get $30 off VIP with code SUMMER30. Ends July 27. Happy trading!

Trend Exhaustion Indicator for ThinkorSwim

BenTen

Administrative
Staff
VIP
This indicator uses pure price action and volume to identify when a trend is near exhaustion. It can be used as a warning sign for a potential reversal.
  • When Bulls are Exhausted: Volume is decreasing while the price continues to increase. We suspect that the move up is being driven by retail traders.
  • When Bears are Exhausted: Price is going down while volume is also decreasing. Could be a sign of trend exhaustion.
You can use this for intraday trading or on the higher timeframe to spot an exhausted trading trend. You can also use the ThinkorSwim's StockHacker to scan for bearish and bullish signals.

GbjbHo8.png

sS66kQN.png

Rlwbvmo.png


thinkScript Code

Code:
# Trend Exhaustion Indicator for ThinkorSwim
# Assembled by BenTen at useThinkScript.com

# Bearish
def bearish = (CLOSE > CLOSE[1] AND CLOSE [1] > CLOSE [2] AND CLOSE [2] > CLOSE [3] AND CLOSE [3] > CLOSE [4] AND VOLUMEAVG(LENGTH = 20) < VOLUMEAVG(LENGTH = 20)[1] AND VOLUMEAVG(LENGTH = 20)[1] < VOLUMEAVG(LENGTH = 20)[2] AND VOLUMEAVG(LENGTH = 20)[2] < VOLUMEAVG(LENGTH = 20)[3] and VOLUMEAVG(LENGTH = 20)[3] < VOLUMEAVG(LENGTH = 20)[4]);
plot bear = bearish;
bear.AssignValueColor(Color.CYAN);
bear.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

# Bullish
def bullish = (CLOSE < CLOSE[1] AND CLOSE [1] < CLOSE [2] AND CLOSE [2] < CLOSE [3] AND CLOSE [3] < CLOSE [4] AND VOLUMEAVG(LENGTH = 20) < VOLUMEAVG(LENGTH = 20)[1] AND VOLUMEAVG(LENGTH = 20)[1] < VOLUMEAVG(LENGTH = 20)[2] AND VOLUMEAVG(LENGTH = 20)[2] < VOLUMEAVG(LENGTH = 20)[3] and VOLUMEAVG(LENGTH = 20)[3] < VOLUMEAVG(LENGTH = 20)[4]);
plot bull = bullish;
bull.AssignValueColor(Color.WHITE);
bull.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

AddLabel(yes,"Bears Are Exhausted",color.WHITE);
AddLabel(yes,"Bulls Are Exhausted",color.CYAN);

# Alerts
Alert(bullish, " ", Alert.Bar, Sound.Chimes);
Alert(bearish, " ", Alert.Bar, Sound.Bell);

Shareable Link

https://tos.mx/RBR6Kp
 
Last edited:

tenacity11

Active member
2019 Donor
Ben I just created the indicator but nothing shows up on the chart arrow wise, I also tried to create a scan but got an error message Add Label not allowed in this context. Thanks
 

BenTen

Administrative
Staff
VIP
Ben I just created the indicator but nothing shows up on the chart arrow wise, I also tried to create a scan but got an error message Add Label not allowed in this context. Thanks

Were you able to see the labels on the chart? If so, then there is nothing wrong with the indicator. Try switching timeframes and checking multiple timeframes. You can remove the last 2 lines from the code and it should fix the scanner issue.
 

tenacity11

Active member
2019 Donor
Were you able to see the labels on the chart? If so, then there is nothing wrong with the indicator. Try switching timeframes and checking multiple timeframes. You can remove the last 2 lines from the code and it should fix the scanner issue.
The labels are on the chart and I did try different time frames. When I take out the add label I get exactly one plot expected
 

BenTen

Administrative
Staff
VIP
@tenacity11 You are not supposed to paste the entire indicator into the scanner. Add a new Study filter > select the indicator’s name > choose which type of signal you’re looking to scan.
 

BenTen

Administrative
Staff
VIP
@thinky There is no yellow (it was in the first screenshot because I originally included yellow as the primary color instead of CYAN). Refer to the definitions in the original post above.
 

thinky

Member
Ok, if bearish the arrow is cyan (Bulls Are Exhausted label) and points down, when bullish it is white (Bears Are Exhausted) and points up. Or you can comment out the labels and look at the direction of the arrow.

# Bearish
bear.AssignValueColor(Color.CYAN);
bear.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

# Bullish
bull.AssignValueColor(Color.WHITE);
bull.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
 

BenTen

Administrative
Staff
VIP
@thinky That's up to you. Added the labels for myself because I also have other indicators with arrows too (and I assume I'm not the only one). The labels help to identify which signals are which.
 

MBF

Active member
2019 Donor
@thinky There is no yellow (it was in the first screenshot because I originally included yellow as the primary color instead of CYAN). Refer to the definitions in the original post above.
This is a hilarious thread. Sorry new here and snooping around. lol! 🤣
 

MBF

Active member
2019 Donor
@MBF Keep snooping, your time will come. :eek: Actually, no problem, we all need to keep a sense of humor.
No doubt, at least seven times a day. I chuckle because I am like this at times and it was funny to see I'm not the only one. Especially at the beginning. Yes I do have quite a sense of humor. Learning TOS is a feat in itself. cheers.:)🧠⚡My brain is fried! What a room this is!
 

Similar threads

Top