LazyBear

Squeeze Momentum Indicator [LazyBear]



Fixed a typo in the code where BB multiplier was stuck at 1.5. Thanks @ucsgears for bringing it to my notice.

Updated source: http://pastebin.com/UCpcX8d7

Use the updated source instead of the what TV shows below.



This is a derivative of John Carter's "TTM Squeeze" volatility indicator, as discussed in his book "Mastering the Trade" (chapter 11).

Black crosses on the midline show that the market just entered a squeeze ( Bollinger Bands are with in Keltner Channel). This signifies low volatility, market preparing itself for an explosive move (up or down). Gray crosses signify "Squeeze release".

Mr.Carter suggests waiting till the first gray after a black cross, and taking a position in the direction of the momentum (for ex., if momentum value is above zero, go long). Exit the position when the momentum changes (increase or decrease --- signified by a color change). My (limited) experience with this shows, an additional indicator like ADX / WaveTrend, is needed to not miss good entry points. Also, Mr.Carter uses simple momentum indicator, while I have used a different method (linreg based) to plot the histogram.

More info:
- Book: Mastering The Trade by John F Carter
- Using Squeeze with ADX: http://www.tradethemarkets.com/public/mastering-the-trade-chapter-11-squeeze.cfm

List of all my indicators:
Master Index: List of all my indicators

Remove from Favorite Scripts Add to Favorite Scripts
//
// @author LazyBear 
// List of all my indicators: https://www.tradingview.com/v/4IneGo8h/
//
study(shorttitle = "SQZMOM_LB", title="Squeeze Momentum Indicator [LazyBear]", overlay=false)

length = input(20, title="BB Length")
mult = input(2.0,title="BB MultFactor")
lengthKC=input(20, title="KC Length")
multKC = input(1.5, title="KC MultFactor")

useTrueRange = input(true, title="Use TrueRange (KC)", type=bool)

// Calculate BB
source = close
basis = sma(source, length)
dev = multKC * stdev(source, length)
upperBB = basis + dev
lowerBB = basis - dev

// Calculate KC
ma = sma(source, lengthKC)
range = useTrueRange ? tr : (high - low)
rangema = sma(range, lengthKC)
upperKC = ma + rangema * multKC
lowerKC = ma - rangema * multKC

sqzOn  = (lowerBB > lowerKC) and (upperBB < upperKC)
sqzOff = (lowerBB < lowerKC) and (upperBB > upperKC)
noSqz  = (sqzOn == false) and (sqzOff == false)

val = linreg(source  -  avg(avg(highest(high, lengthKC), lowest(low, lengthKC)),sma(close,lengthKC)), 
            lengthKC,0)

bcolor = iff( val > 0, 
            iff( val > nz(val[1]), lime, green),
            iff( val < nz(val[1]), red, maroon))
scolor = noSqz ? blue : sqzOn ? black : gray 
plot(val, color=bcolor, style=histogram, linewidth=4)
plot(0, color=scolor, style=cross, linewidth=2)
List of my free indicators: http://bit.ly/1LQaPK8
List of my indicators at Appstore: http://blog.tradingview.com/?p=970

SunnyBTC PRO
2 years ago
My word, this looks like gold, once again cheers LB :)
+3 Reply
LazyBear PRO SunnyBTC
2 years ago
Thanks Sunny.
+5 Reply
accidentje
2 years ago
Lazybear... one of your best, sir! Thanks
+2 Reply
LazyBear PRO accidentje
2 years ago
yw :)
+3 Reply
2use
2 years ago
Thanx, Is this indicator working best on shorter time frames? how is it performing on 1/5minute charts and 1day/1week charts?
+10 Reply
LazyBear PRO 2use
2 years ago
Carter suggests 5mins....but my quick test showed some good results in 4hrs timeframe.

Since this is not his exact formula, you may want to do some backtesting before settling on one.
+4 Reply
2use LazyBear
2 years ago
Well, i got the answer and will do some backtesting - thanx!
Reply
ChrisMoody PRO 2use
2 years ago
2use...In no way trying to disagree with LazyBear...b/c he knows I have all the respect in the world for him...But I paid John C for education for around 10 years and I know the squeeze inside and out. As with 99% of Indicators the Larger the Timeframe the more reliable and Larger the move.

Think about it. If a squeeze fires off on a 5 min chart you expect the squeeze to last 7 to 12 bars....call it 30 to 45 minutes. Daily chart 7 to 12 bars = 7 to 12 days...Weekly and Monthly chart hold the same...

One of JC's favorite setups is when bothe Weekly and Daily are ein a Squeeze...and the Daily Squeeze fires off...it gives you oppty to get in a move where the weekly might fire off by the time the Daily move ends...so your getting in to a move that will last for weeks to months at the earliest possible time. Same holds through for Daily and 60 min chart both being in a squeeze. or Daily 4 hour etc.

In summary look for two major timeframes to be in squeeze...this shows price congestion and you get higher probability of larger move. If your looking at a 5 minute chart...your going to get a lot of signals...

Slightly more to it than that....but that will get you started...TIP*** haven't looked in a while but for some reason Forex/Currencies never worked as good on larger time frames like Daily weekly...they worked on 4 hour or less. Haven't looked in a while so do your own analysis...
+24 Reply
LazyBear PRO ChrisMoody
2 years ago
Thanks Chris for the info...my "very limited" testing showed more effectiveness on longer time frame too (starting from 4hrs).

IIRC, that "5mins tf" is from an article I read somewhere (or in a book? Will try to find the reference).
+3 Reply
dravya LazyBear
12 days ago
@LazyBear, http://www.tradethemarkets.com/products/item5.cfm he talks about it here.
Reply
QuantitativeExhaustion PRO ChrisMoody
2 years ago
Great comment
+2 Reply
littleriver ChrisMoody
2 years ago
Hi Chris , Thanks for sharing! I liked your idea so much , I went out and found one . Is this a good example of what your talking about?
snapshot
snapshot
Reply
ChrisMoody PRO littleriver
2 years ago
Yes...Change the Squeeze dots to red...and the Non Squeeze dots to Gray...and make the dots Much bigger so it's easier to see.

I can see your monthly is in a Squeeze...I assume your weekly is.

Monthly...and Weekly squeeze could create a big move...once Weekly fires...especially if Monthly fires before Weekly momentum turns to downside.

I typically use on Weekly And Daily Squeezes...The daily squeeze firing should last several days to 2 weeks. Then if the Weekly squeeze fires your looking at a continued move for several weeks.

A good Squeeze when it breaks out can go for 10-12 bars with Momentum increasing the entire time (Long Setup). So if you catch the Daily squeeze and then the Weekly squeeze fires off you could be looking at a 2-3 month move.

Another thing to note is you want momentum to be going in same direction on both timeframes when the lower time frame fires. So in a move to the upside you would want your Daily Momentum increasing...and your weekly Momentum increasing. Doesn't matter if the Weekly Mom is below zero...you just want it heading higher.
+6 Reply
QuantitativeExhaustion PRO ChrisMoody
2 years ago
I've been scanning for preciously what your describing in the comments.
Reply
ChrisMoody PRO ChrisMoody
2 years ago
Here is an example of a Downside move where the Daily fired...and the Daily and Weekly Mom are both going in the same direction.

snapshot
+6 Reply
QuantitativeExhaustion PRO ChrisMoody
2 years ago
Not bad. I need to start using my daily/weekly charts together to find these momentum convergences.
Reply
ChrisMoody PRO QuantitativeExhaustion
2 years ago
9-16-2014 Current Weekly-Daily Squeezes on High Volume Stocks.
ACN, AGN, BAX, BMY, DAL, EA, MA, MMM, MYGN, P, SWY, T, V, XLP,
+1 Reply
Hatmans ChrisMoody
2 years ago
If only we had a screener that could be customized for pine script and built in indicator/overlays.
+3 Reply
esaadeh ChrisMoody
2 years ago
Hi Mr. ChrisMoody. Could you guide me on how to have an updated daily and weekly squeezes list. I mean here a scanner which can give me such a list.
+3 Reply
barrazao777 ChrisMoody
2 months ago
@ChrisMoody, Hey Chris, how do you change the color of the dots?
+1 Reply
littleriver ChrisMoody
2 years ago
Thanks Chris , I appreciate your sharing the insights . Promise to do my best and go out and make good use of the information and indicators you have shared so freely. Your good Karma chest is running over. May your trading account do the same. Thank You!!
+2 Reply
QuantitativeExhaustion PRO littleriver
2 years ago
snapshot


not bad
+1 Reply
QuantitativeExhaustion PRO littleriver
2 years ago
momentum stuck on weekly, however daily and 2x weekly moving down at ease
snapshot
Reply
MONEYMENOW PRO ChrisMoody
10 months ago
Had I known ur advice much earlier. I would have saved my USD 56000.00... I feel like an idiot now... its ok... Time to recover n regenerate...
+1 Reply
KimChan ChrisMoody
11 days ago
@ChrisMoody, this comment is Gold, thanks a lot Chris
Reply
ChrisMoody PRO KimChan
8 days ago
@KimChan,

Anytime...Thanks
Reply
DerekBerger
2 years ago
dont know a heck of a lot about technical analysis but this is amazing. Very useful.
Reply
DerekBerger DerekBerger
2 years ago
Thanks for the video link as well. When your viewing this chart did you add the adx and wave c as well?
Reply
LazyBear PRO DerekBerger
2 years ago
Thanks Derek.

I dont know much about his WaveC indicator. I did try ADX, didnt spend time backtesting though.
+2 Reply
QuantitativeExhaustion PRO LazyBear
2 years ago
snapshot


Anyway to build a Squeeze headfake indicator ? I see this all the time. We start a fast move down x3 only to see a fast rip up x5
+1 Reply
QuantitativeExhaustion PRO QuantitativeExhaustion
2 years ago
or sometime, but more rare, we see a fast rip up x2 only to see a fast move down x4
Reply
QuantitativeExhaustion PRO QuantitativeExhaustion
2 years ago
As you can see, momentum on smaller time frames has us moving from negative (red) to positive (green). 18 hour has us moving down to 0 neutral or near there.
Reply
I'd really like to see which works better, COG or TTM
Reply
LazyBear PRO QuantitativeExhaustion
2 years ago
You mean build a similar histo sqz indic for COG channel? hmm...interesting idea..will check it out sometime this week.
+1 Reply
LazyBear PRO QuantitativeExhaustion
2 years ago
heres a quick version..I added the squeeze indication to my CogChannel price osc.

snapshot
+2 Reply
QuantitativeExhaustion PRO LazyBear
2 years ago
Can you also add COG overlay ?
Reply
LazyBear PRO QuantitativeExhaustion
2 years ago
overlay on ccpo? chk the image of my latest version below.
+1 Reply
QuantitativeExhaustion PRO LazyBear
2 years ago
chart overlay of old (chart overlay {displayed with price action}) COG channel + MA Cross with (indicators {boxes below}) CCPO and SQZ Momo
Reply
LazyBear PRO QuantitativeExhaustion
2 years ago
Here you go.

snapshot
+1 Reply
QuantitativeExhaustion PRO LazyBear
2 years ago
That works!
Reply
QuantitativeExhaustion PRO QuantitativeExhaustion
2 years ago
Looks like Mr. Softy MSFT is ready to react and go down.
Reply
eagontv LazyBear
2 years ago
snapshot
Reply
LazyBear PRO LazyBear
2 years ago
This is a version with dynamic pullback zones for CCPO. I actually like this a lot :)

snapshot
+1 Reply
QuantitativeExhaustion PRO LazyBear
2 years ago
Sure, your indicator is not only momentum/trend, but also includes price squeezes
Reply
SQZMOMO works very well with divergence
Reply
ucsgears PRO
2 years ago
Thanks to Chris, Something I was looking for. And great job LZ.
+1 Reply
BuboWaveTrader
2 years ago
Hello LazyBear Thanks for a grat work!!!
Is it possible that you could give me the code to momentum squeeze indicator so it will fit to Prorealtime ? https://www.prorealtime.com // Regards Robert
Reply
MITrade
2 years ago
Amazed this existed in tradingview, very useful indicator, well done!
Reply
snapshot


Both the Squeeze Momentum Indicator and the COG Channel are showing up on AMD weekly chart. I find 1 week, 2 week and 1 month Squeeze/COG indicators are very reliable.

AMD has also developed an ascending triangle pattern. Not sure if it breaks before or after upcoming earnings Oct. 16.

LazyBear if you find anymore squeeze indicators please post them.
+1 Reply
QuantitativeExhaustion PRO QuantitativeExhaustion
2 years ago
snapshot


Two week Chart. Really like using two week charts. Between Long term trends and intermediate trends
Reply
QuantitativeExhaustion PRO QuantitativeExhaustion
2 years ago
Showing up here-and-there on 3 day chart. No COG Channel + Momo Squeeze combo on 1D or 2D yet.
Reply
2use QuantitativeExhaustion
2 years ago
I actually follow AMD and this comment is precious. Is the squeeze momentum indicator you are using the default one provided initially here? And where can i get this chart/COG indicator to study it?
Reply
It's in the Library. You can add it to your chart
Reply
Drop came in when I was shifting money around and missed a decent drop.
Reply
snapshot


working on another here
Reply
snapshot


Here is the day chart
Reply
ucsgears PRO
2 years ago
17: dev = multKC * stdev(source, length)

is this suppose to be? dev = mult * stdev(source, length)
+1 Reply
LazyBear PRO ucsgears
2 years ago
good catch, it shd be "mult". Will update the desc with the update. Thanks for bringing it to my notice.
+1 Reply
ucsgears PRO LazyBear
2 years ago
Thanks.
Reply
xb_tradingview
2 years ago
Hey just a question, I noticed now that there are blue crosses too? I might have missed your explanation of those, but I don't see it. Can you comment? Thanks!
Reply
LazyBear PRO xb_tradingview
2 years ago
The crosses at the mid line (0-line) are the sqz indicators. Black is SQZ_ON, Gray is SQZ_RELEASED. Check out my original chart above the description area for those.
+1 Reply
learntotrade30
2 years ago
thanks sir i have been looking to get this for a long time. have a question just learning programming languages. this looks like java is it?
Reply
LazyBear PRO learntotrade30
2 years ago
Thanks. Pine is more of a functional language, with simple syntax. Do check out the reference, only a couple of constructs to learn.
+1 Reply
learntotrade30 LazyBear
2 years ago
thanks
Reply
MakisMooz LazyBear
a year ago
I love functional programming. Simple, fast, reusable, clean.
Reply
cliffyg
2 years ago
This is just what I've been looking for but have never copied code into MT4 before. Having checked out You Tube I managed to copy the indicator in but got the following (3) error message after I compiled the code
'study' - declaration without type TTM Squeeze.mq4 Line 5 Column 1
')' - unexpected end of program TTM Squeeze.mq4 Line 40 Column 47
event handling function not found Line 1 Column 1

Is this an error in the code or have i done something wrong? Thanks for your help
+1 Reply
LazyBear PRO cliffyg
2 years ago
This indicator is written in TradingView's scripting language (Pinescript) -- not compatible with MT4.
+1 Reply
cliffyg LazyBear
2 years ago
No problem, I stumbled onto this site looking for the Squeeze indicator but now realise what the community is all about. The site looks ideal for me and plan to be a convert. Thanks for your speedy reply.
Reply
mpspeer
2 years ago
What would the A/B/C Wave Indicators be called in TV? Or are they not built in indicators?
+1 Reply
ucsgears PRO mpspeer
2 years ago
I have the A/B/C waves code for the indicators as Momentogram. I cant post the settings public.
+1 Reply
ucsgears PRO mpspeer
2 years ago
Here is the link -
Momentogram - Wave
Reply
This indicator is fantastic - I am having a hard time setting up an alert though. I think it would be very helpful, if I could be alerted each time the bar color changed, for example, from RED to light red, which for me, is where I use this indicator to go long, and from GREEN to light green, which is where I use this indicator to go short. I have been testing this script on AAPL, and I am finding I am paying less attention to the color of the crosses, and more to the bar color and shapes. Any help would be wicked awesome!!! LOVE THIS!
+1 Reply
LazyBear PRO ChandlerQuintin
2 years ago
I have never tried setting up an alert based on colors, so not sure. Will check and let you know.
+1 Reply
I just finished the chapter from Carter's book. Im curios how this indicator compares to his. You said it is derived. What differs? Thank you LB
Reply
LazyBear PRO vlad.adrian
2 years ago
YW.

The momentum component (histogram) is different from Carter's simple calculation. Squeeze is the same.
+1 Reply
vlad.adrian PRO LazyBear
2 years ago
Oh I see, what indicator is the histogram based on? Why did u change it? is it more reliable?
Reply
LazyBear PRO vlad.adrian
2 years ago
OTOH, Carter uses EMA of simple momentum (close - close 'n' bars back). SQZ_MOM uses a linear regression of anchored momentum. Check "val" calculation (line 32) for more details.
+4 Reply
marcus.isacsson
2 years ago
Sweet!
Reply
KalyanStock
2 years ago
LazyBear....I use John's squeeze. It is very powerful. Are you using divergence of momentum in conjuction with squeeze to predict direction? It seems very interesting. Can let me know if I am thinking in the right way?
Reply
LazyBear PRO KalyanStock
2 years ago
Using divergences + direction of momentum when a sqz releases is definitely a good way to predict release direction.

BTW, this chart shows the difference between what SQZ_MOM renders and one of the common TTM_SQZ implementations (there are so many variations out there).

snapshot
+1 Reply
KalyanStock LazyBear
2 years ago
Thanks for reply. It reinforces my understanding.

One question I had was that my charts and your chart look different with indicators...Can you please why charts are different from yours and what settings I should use?

AAPL Chart
+2 Reply
rianobs LazyBear
10 months ago
LazyBear, would you please share the script for the TTM Squeeze you use?
Thank you.

-rianobs
Reply
Hey LazyBear, is it me just noticing this now, an error, or something else... is there a bar now showing on the next advanced bar that hasn't happened yet? For example, I have an 15 and a 60 min chart on $AAPL right now, and my 9:30-9:45 bar on price chart corresponds with a falling green bar on your indicator, and on my 9:45 to 10:00 bar on price chart, I already see a green falling bar. Same thing on the 60 minute, I have a bar on your indicator that is corresponding with a time that is in... the... future...
+1 Reply
LazyBear PRO ChandlerQuintin
2 years ago
Looks ok to me..can u paste a chart with that anomaly?

snapshot
+2 Reply
ChandlerQuintin PRO LazyBear
2 years ago
snapshot


Here ya go, tried a few other symbols too.
+1 Reply
ChandlerQuintin PRO LazyBear
2 years ago
Let me make it more zoomed...
snapshot
+1 Reply
LazyBear PRO ChandlerQuintin
2 years ago
Thanks. I am not able to reproduce it. Guess, a TradingView rendering issue.

snapshot
+1 Reply
B120626
2 years ago
anyone know how to use a variable for the value of transp ? plot pukes when i try a variable, as is shown here in color=scolor. AFAIK there is no INT func :( thanks
Reply
LazyBear PRO B120626
2 years ago
When you create a variable in Pine, it becomes a series (unless it is a constant). "transp" cannot take a series. So, you cannot do something like:

tp=close>close ? 50: 90
bgcolor(blue, transp=tp)

because "tp" is a series. But, the following is allowed, because now "tp" is a constant.

tp=50
bgcolor(blue, transp=tp)

Hope that helps. BTW, you can also post any query at Pinescript room (link: https://www.tradingview.com/chat/#BfmVowG1TZkKO235). Many knowledgeable coders are regulars there.
+1 Reply
B120626 LazyBear
2 years ago
thanks. i tried everything to set the plot point to transparent, then decided to think outside the box, and realized I could just use the value of na in my series, and no data point would be plotted at that spot, which was my true intention all along. i assumed i could hide the data point by adjusting it's transparency. the ps room is neat, but seems not easily searchable, more like a live chat stream. anyhow, this is amazing!
+1 Reply
Shorty815
2 years ago
The crosses doesnt change color (show squeezes) on my chart. Bug?
+1 Reply
LazyBear PRO Shorty815
2 years ago
Have a chart showing the issue?
Reply
NomadUNC
2 years ago
Encountered errors in TradeStation and have zero idea how to fix. Appreciate any advice.
Reply
LazyBear PRO NomadUNC
2 years ago
This script is written using Pinescript, supported only here at TV. This is not supported by TS.
Reply
sedabulik1112
2 years ago
Thank u for the upload! Ever tried it on forex pairs?

Regards
Reply
LazyBear PRO sedabulik1112
2 years ago
I dont trade Fx. But have seen many using this there in the Fx room.
Reply
Everyone likes the LB SQZ MOMO indicator
Reply
LazyBear PRO QuantitativeExhaustion
2 years ago
thx :)
Reply
anthonydelille
2 years ago
How to install script? please :)
Reply
LazyBear PRO anthonydelille
2 years ago
1) In a new chart, click on "Pine editor".
2) Click on New->BlankScript. Delete the standard template TV populates for you.
3) Copy the script from http://pastebin.com/UCpcX8d7. Preferrably from the RAW section (scroll down in that page).
4) Paste it in the PineEditor window.
5) Press SAVE. Once successfully saved (no red colored messages in the bottom pane of the Pineeditor dialog), click "Add to chart".
+1 Reply
esaadeh1 LazyBear
2 years ago
Thanks a lot for your work. I have two questions:
1. (Screener): Let me talk about stock here. Your method supposed that we watched a specific stock and wait for squeeze. Is there a possibility to scan by using a free screener for stock which is in the day/week frame squeeze. I meen here your method. Could you for example adjust your script/code to work in stockfetcher.com editable screener.

2. What is the difference between your work and John Caroll work (TTM squeezer)

Reply
LazyBear PRO esaadeh1
2 years ago
I replied to your ping in PM.

1) Screening feature is going to be released soon by TV.
2) It is the same, except for a slight modification to momentum calculation.
+1 Reply
jlasenby
2 years ago
Thanks for the indicator.
Reply
LazyBear PRO jlasenby
2 years ago
yw
Reply
Hovhannes
2 years ago
how does it works?
Reply
LazyBear PRO Hovhannes
2 years ago
Description below the chart has more info on the usage.
Reply
Bastioun
2 years ago
What do you think about the TD Sequential Indicators from Tom DeMark ? Do you think that you could create it on tradingview ? It could be great to have this indicators on tradingview :)
+1 Reply
LazyBear PRO Bastioun
2 years ago
I haven't personally used TDSeq, but have tried recreating it here (need to go find it in my archive)...

User @glaz was also working on creating it (he usually frequents PineRoom), also IIRC someone else posted this (or a modified form) already too.
Reply
Bastioun LazyBear
2 years ago
Thank you for your reply :)

I know that you have already tried recreating it but unfortunately that is not what I am looking for. I try to find this TD sequential indicator (with TD Setup and TD Countdown) like on these links :
- https://www.mql5.com/en/market/product/7589
- http://forex-strategies-revealed.com
I think TD Sequential indicator gives great signals to trade, of course it is not perfect as all indicators but it is one of the best (integrating Stop Loss).

Unfortunately, I did not find the other developper. I am a new member so I do not know everything on Tradingview yet (PineRoom and other).

Thank you very much for your time :)
Reply
yandy.chang
2 years ago
Nice!!! I have a quick question, though. I seems that you are using the multiplication factor of keltner channel(1.5) in the equation of the standard deviation.... I was wondering if you meant it like that....
Reply
LazyBear PRO yandy.chang
2 years ago
Yes, that is an issue. But it is already fixed :) Updated source is here => http://pastebin.com/UCpcX8d7 (plz see desc for the details on the changes).
Reply
yandy.chang LazyBear
2 years ago
Thank you...
Reply
Hi...This is kiran,
Actually i am impressed about your chart which is in "https://www.tradingview.com/chart/".I want similar like that in asp.net website.It should be more responsive like when we put cursor on candle it diaplays the value like that.Can you send the code for that related to asp.net and javascript .
Reply
kkiran.netdeveloper kkiran.netdeveloper
2 years ago
Can anyone help me related this.?The chart should be impressive and more responsive.
Reply
LazyBear PRO kkiran.netdeveloper
2 years ago
Try embedding TradingView (this site!) charting library. Check out the front page for developer links and how to get access to the library.
Reply
GMarketchoice
2 years ago
Thank you very much! This is a wonderful indicator. I do use it in my trading. Is there a way to set up the alerts when a market is in squeeze or changes from squeeze to non squeeze.
Reply
LazyBear PRO GMarketchoice
2 years ago