Greeny

TTM Squeeze

10260 views
3988
10260 12
John Carter's TTM             Squeeze indicator
Remove from Favorite Scripts Add to Favorite Scripts
// create base on http://www.dailyfx.com/forex_forum/coding-strategy-advisors-indicators-functions/237563-ttm-squeeze-indicator.html
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)
fairly new. Can the time frame be adjusted to fit mon/wkly/dly frames? ie 20/10/5? thanks
Reply
This indicator fires when there is no squeeze, don't rely on it!
Reply
I think this is the best indicator of all time. Please, do you know how to set alarm based on colours change? Thank.
+4 Reply
jmorelli inox40etoutlookit
@inox40etoutlookit, any word on this?
Reply
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
Reply
jmorelli SNOW_CITY
@SNOW_CITY, any word on this?
Reply
SNOW_CITY jmorelli
@jmorelli, yes it's fairly easy to implement
Reply
@SNOW_CITY, able to share the steps for alerts?
Reply
@SNOW_CITY, how?
Reply
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 My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out