Madrid Trend Squeeze

5129 7 825
This study spots the points that are most profitable in the trend with a code color and shape. This also shows trend divergences and possible reversal or reentry points

Keeping the parameters simple, this study only needs one parameter, the length of the base moving average, which by default is set to 34.

There are seven colors used for the study

Green : Uptrend in general
Lime : Spots the current uptrend leg
Aqua : The maximum profitability of the leg in a long trade
The Squeeze happens when Green+Lime+Aqua are aligned (the larger the values the better)

Maroon : Downtrend in general
Red : Spots the current downtrend leg
Fuchsia: The maximum profitability of the leg in a short trade
The Squeeze happens when Maroon+Red+Fuchsia are aligned (the larger the values the better)

Yellow : The trend has come to a pause and it is either a reversal warning or a continuation. These are the entry, re-entry or closing position points.

When either the fuchsia or the aqua colors disappear or shrinks meaningfully it could mean a possible leg exhaustion that will have to be confirmed with the subsequent bars.
When the squeeze color appears without the intermediate color (fuchsia+yellow, fuchsia+maroon, aqua+yellow, aqua+green) it could mean this is just a shake off move, a pump/dump move, a buy the dip or a sell the peak move or a gap.

In the example there are three divergences spotted, the first one between march 2009 and september 2010 when the peaks in the indicator made a lower low, meanwhile the price made a higher high, this is a negative divergence and a trend reversal. On the second example, between april 2013 and July 2013 the indicator made a higher high meanwhile the price made a double bottom , this is a positive divergence and a reversal to the upside.
Remove from Favorite Scripts Add to Favorite Scripts
// Madrid : Squeeze Trend : 02/Aug/2015 : 11:41 : 2.0
// This Study determines the range where the trend is more profitable.

study("Madrid Trend Squeeze", shorttitle="MTrendSqueeze")
len = input(34, title="Length", minval=14)
src = close
ref = 13
sqzLen = 5

ma = ema(src, len)
closema = close - ma
refma = ema(src, ref)-ma
sqzma = ema(src, sqzLen)-ma

plotcandle(0, closema, 0, closema, color=closema>=0?aqua:fuchsia)
plotcandle(0, sqzma, 0, sqzma, color=sqzma>=0?lime:red)
plotcandle(0, refma, 0, refma, color=(refma>=0 and closema<refma) or (refma<0 and closema>refma ) ? yellow : refma>=0 ? green:maroon)
How can I use this chart on symbols that arent inside tradingview?
+1 Reply
Still checking it out but looks very good so far. Perhaps the best I have seen. Thank you.
Madrid stingray
Thank you.
Thank you very much. This looks fantastic.
Could you help me out with a little further clarification? What do you mean by the "squeeze color?" And what does it mean that, for example, "green, lime, and acqua are aligned?"

Madrid Algyros
Sure, when the trend is at its peak I use two colors, aqua (in the uptrend) and fuchsia (in the downtrend), those are what I refer to as "squeeze colors", when those show up it means the closing prices are at its maximum in the current leg. On the other hand, when that happens you can see there are three stacked bars in green+lime+aqua (uptrend) and maroon+red+fuchsia (downtrend) when the three colors appear it means the trend has formed "normally", if the "Squeeze" colors appear with any two or one of the three colors, then this could mean there is something not normal with the trend and it has to be taken carefully, cause this could be due to an unusual move like a shake off, gaps or bursts.
Thanks. That helps a lot.
your doing great work thanks
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 العربية
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder 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