Mobius Squeeze and Custom Labels For ThinkOrSwim

@Mattyb740 I am just starting to dable in swingtrading on a daily or weekly level. Mostly, until now, I do long term value trading. I have made some updates, which I can share, but still tinkering. Did find some things that were not bugs, but not working as we would like.
 
Does anyone know if this can be used on any timeframe? The time frames I usually watch are qtrly, monthly, weekly, and daily on separate charts. Thanks!
 
Modified the Squeeze Index bar by adding the description of the data points, and separating each data point into its own label. This made it a little less confusing/cluttered for me, and it also made it so that when using a narrower window the whole bar fits on the screen. I was loosing part of the bar to it going off screen when the window was narrow.

Before, bar would get lost off screen with a narrow window.
rjglXas.png


After, labels are able to shift to accommodate window size.
d4B4ffS.png


Full Size
uVLd2Eh.png


What you need to do:
Replace this line of code at the end:
Code:
AddLabel(yes, " SQUEEZE INDEX: " + squeezeIndex + " [" + squeezeIndex[1] + "] " + "[" + AsText(squeezeIndexDifference, NumberFormat.TWO_DECIMAL_PLACES) + "%] " + "[" + (counter[1]) + "] | " + "[" + accumCounter + "] " + "[" + AsText(historicalDifference[1], NumberFormat.TWO_DECIMAL_PLACES) + "%] ", if squeezeIndex > squeezeIndex[1] and squeezeIndex > 50 and squeezeIndexDifference > 0 then CreateColor(16, 198, 226) else color.LIGHT_ORANGE);

With this:
Code:
AddLabel(yes, " SqzIndex: [" + squeezeIndex + "]", if squeezeIndex > squeezeIndex[1] and squeezeIndex > 50 and squeezeIndexDifference > 0 then CreateColor(16, 198, 226) else color.LIGHT_ORANGE);

AddLabel(yes, " PrevSqz Index: [" + squeezeIndex[1] + "] ", if squeezeIndex > squeezeIndex[1] and squeezeIndex > 50 and squeezeIndexDifference > 0 then CreateColor(16, 198, 226) else color.LIGHT_ORANGE);

AddLabel(yes, " %Change: [" + AsText(squeezeIndexDifference, NumberFormat.TWO_DECIMAL_PLACES) + "%] ", if squeezeIndex > squeezeIndex[1] and squeezeIndex > 50 and squeezeIndexDifference > 0 then CreateColor(16, 198, 226) else color.LIGHT_ORANGE);

AddLabel(yes," CurrentSqz: [" + (counter[1]) + "] ", if squeezeIndex > squeezeIndex[1] and squeezeIndex > 50 and squeezeIndexDifference > 0 then CreateColor(16, 198, 226) else color.LIGHT_ORANGE);

AddLabel(yes," LastSqz: [" + accumCounter + "] ", if squeezeIndex > squeezeIndex[1] and squeezeIndex > 50 and squeezeIndexDifference > 0 then CreateColor(16, 198, 226) else color.LIGHT_ORANGE);

AddLabel(yes," SqzDepth: [" + AsText(historicalDifference[1], NumberFormat.TWO_DECIMAL_PLACES) + "%] ", if squeezeIndex > squeezeIndex[1] and squeezeIndex > 50 and squeezeIndexDifference > 0 then CreateColor(16, 198, 226) else color.LIGHT_ORANGE);

Feel free to use your own label names. Just change the part after AddLabel(yes, " on each line.

For example:

AddLabel(yes, " YourLabelHere: [" + squeezeIndex + "]", if squeezeIndex > squeezeIndex[1] and squeezeIndex > 50 and squeezeIndexDifference > 0 then CreateColor(16, 198, 226) else color.LIGHT_ORANGE);

cRNj7VC.png
 
Last edited by a moderator:
Truth be told I love your set up and if you were able to put the columns in a file instead of one by one that would be much appreciated, and your price action study, you really have a great set up it looks like and would love to test it and use it.
Where my labtop is insanely slow I can’t copy code and upload it, lol I can’t even get on the internet and get on here without it taking 10 years. It’s what I have now, but hopefully I can upgrade soon.
Let me know what your testing shows. Not sure if what I gave you is what you were asking for.
 
Mobius Squeeze and Custom Labels For ThinkOrSwim
A little gift for the group. This is my first indicator. I took Mobius' Squeeze and added a few things. There's about 30 line of code and 150 line of comments explaining what everything does. My background is data science as it pertains to advertising and a copywriter. I did some coding 2 centuries ago.

With the indicator, I can predict when a Squeeze will happen, as well as how likely a Squeeze is to happen. Bunch of other stuff, too. Provides about 6 items of direct metrics and another 6 of indirect metrics/indications. It is a pretty good tool for anticipating trends (if I say so myself) :)
Hi David! Thank you so much for the squeeze indicator! I've found it incredibly helpful but have some questions calculating an oncoming squeeze. More specifically, how do you discern the direction when the SI and previous SI are both negative? Also, how does volume impact when the next squeeze is coming.

By direction, I mean moving towards to, or away from, a squeeze. For instance, in his commentary he cites an example of SI = 200; G2 = 1-- == moving fast towards (down) a squeeze. Is this to mean that if it were SI = -200; G2 = -100 the direction would be up towards a squeeze? In what context are the terms up and down being used?

With respect to volume, I was hoping to get a little clarity on his comment, "a consistent drop of 20% will mean the SI could reach zero in 5 bars, depending on volume." In such case, how does volume affect the move towards (or away from) a squeeze?

Thanks in advance for all the guidance!
 
Last edited by a moderator:
Hi David! Thank you so much for the squeeze indicator! I've found it incredibly helpful but have some questions calculating an oncoming squeeze. More specifically, how do you discern the direction when the SI and previous SI are both negative? Also, how does volume impact when the next squeeze is coming.

By direction, I mean moving towards to, or away from, a squeeze. For instance, in his commentary he cites an example of SI = 200; G2 = 1-- == moving fast towards (down) a squeeze. Is this to mean that if it were SI = -200; G2 = -100 the direction would be up towards a squeeze? In what context are the terms up and down being used?

With respect to volume, I was hoping to get a little clarity on his comment, "a consistent drop of 20% will mean the SI could reach zero in 5 bars, depending on volume." In such case, how does volume affect the move towards (or away from) a squeeze?

Thanks in advance for all the guidance!
No up and down are not used in that context. This indicator was created just to indicate toward and away from squeeze.
Read more here: https://usethinkscript.com/threads/mobius-squeeze-and-custom-labels-for-thinkorswim.8414/#post-79120

The OP also 'attempts' to predict if a squeeze was eminent. His reference to volume was to explain that 'eminent' is relative. Without any volume to move an equity forward, eminence can take a while.
 
@Kitchasap
  1. Add the below script to Studies
  2. In scan hacker set up the condition:


Ruby:
##  Scanner Only  ##
# @Some Random Alien 10/2121
input length = 21; #hint length: Length for average calculation.
input price = close;
input SDmult = 2.0;
input ATRmult = 1.5;
def K = (Highest(high, length) + Lowest(low, length)) /
2 + ExpAverage(close, length);
def Momo = Inertia(price - K / 2, length);
#--------------- [ Metrics From Mobius ] ---------------

def SD = StDev(close, length);
def Avg = Average(close, length);
def ATR = Average(TrueRange(high, close, low), length);
def SDup = Avg + (SDmult * SD);
def ATRup = Avg + (ATRmult * ATR);
def Squeeze = if SDup < ATRUp then 0 else Double.NaN;


#------------------------------------------------------------------------------------------
#  David M.(Some Random Alien) 10-6-2021
#  Don't blame Mobius... I made this mess :)
#  Code displays Squeeze Watch Prediction Index.
#  Depending on volume, a score of less then 25 could signal an impeding Squeeze.

def squeezePrediction = ((SDup - ATRup) / (SDup + ATRup) / 2) * 100;
def squeezeIndex = Round(squeezePrediction * 10000, 0);
def squeezeIndexDifference = (squeezeIndex - squeezeIndex[1]) / (squeezeIndex + squeezeIndex[1]) / 2 * 100;
def squeezeProgress = Round((squeezePrediction - squeezePrediction[1]) * 10000, 2);
def squeezeIndexOn = squeezeIndex <= 0;
rec counter = if squeezeIndexOn then counter[1] + 1 else 0;
def deepSqueeze = squeezeIndex <= -20;
plot scan_DeepSqueeze = !deepSqueeze[1] and deepSqueeze ;
does the entire code go into the scan? or is it just the top portion and the bottom portion is a separate scan?
 
does the entire code go into the scan? or is it just the top portion and the bottom portion is a separate scan?
Sorry, I don't know the definition of top portion and bottom portion.
To use the scan, you can follow the instructions found here:
https://usethinkscript.com/threads/mobius-squeeze-and-custom-labels-for-thinkorswim.8414/#post-79403

or
You can stuff the whole script found in the above link into the Scan Hacker using the ThinkScript editor, click save, click run
 
In this example, the Monthly Sqz watchlist does not match the chart, but everything else does, still can not figure out a way around this bug, which seems to show up sporadically.
Hello EvilSurgeon, diggin through old material and noticed the screen shot of a TOS watchlist that you shared. I am looking at the last column that you titled "IBD_RSI_Wt", could you share the thinkscript for how you derived this?
 

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