TTM Squeeze

13084 14
John Carter's TTM Squeeze indicator
Remove from Favorite Scripts Add to Favorite Scripts
// create base on
study("TTM Squeeze") 
length = input(title="Length", type=integer, defval=20, minval=0) 
bband(length, mult) =>
	sma(close, length) + mult * stdev(close, length)
keltner(length, mult) =>
	ema(close, length) + mult * ema(tr, length)

e1 = (highest(high, length) + lowest(low, length)) / 2 + sma(close, length)
osc = linreg(close - e1 / 2, length, 0)
diff = bband(length, 2) - keltner(length, 1)
osc_color = osc[1] < osc[0] ? osc[0] >= 0 ? #00ffff : #cc00cc : osc[0] >= 0 ? #009b9b : #ff9bff
mid_color = diff >= 0 ? green : red

plot(osc, color=osc_color, style=histogram, linewidth=2)
plot(0, color=mid_color, style=circles, linewidth=3)

for those who wants alerts and MTF with no repaint
fairly new. Can the time frame be adjusted to fit mon/wkly/dly frames? ie 20/10/5? thanks
dilace vacalo69
This indicator fires when there is no squeeze, don't rely on it!
+2 Reply
I think this is the best indicator of all time. Please, do you know how to set alarm based on colours change? Thank.
+5 Reply
jmorelli inox40etoutlookit
@inox40etoutlookit, any word on this?
I love this indicator! Is there a way to make an alert based on the dots turning red? I have tried several alerts but cannot get the "Squeeze RED" dots to trigger an alert. Thanks
jmorelli SNOW_CITY
@SNOW_CITY, any word on this?
SNOW_CITY jmorelli
@jmorelli, yes it's fairly easy to implement
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
SV Svenska
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
HE עברית
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing Send feedback Ideas Published Followers Following Private Messages Chat Sign Out