The TTM Squeeze Oscillator (by John Carter) measure the strength of the market and its momentum. It is built with the Bollinger and the Keltner bands. When the volatility increase, the Bollinger Bands are widening and are enveloping the Keltner channel, while when the market is consolidating the BB are inside the KC and the market is squeezing.
Squeeze on: Red dots appears on the oscillator, prepare for a consolidation breakout to come.
Market is trending, squeeze is off: Green dots
The trend momentum and direction is identifiable with the oscillator color:
In this version, I added the possibility to apply the indicator on the price also to color the candlesticks accordingly to the squeeze oscillator. So this indicator embed 2 indicators at once: the oscillator and the candlesticks painter. To get the coloured candlesticks, apply the indicator on the price and tick the “CandlesticksSqueeze” in the indicator settings.
The “squeezeDotsOffset” setting help you move the oscillator dots above/below the zero level of the oscillator. I found that sometime, the color overlay of the histogram and the dots were disturbing, so this offset can resolve this “problem”.
//PRC_TTM Squeeze for PRT v10.3| indicator
//27.04.2017
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//---Settings
//length=20
//mult=2
//lengthKC=20
//multKC=1.5
//squeezeDotsOffset=0
//candlesticksSqueeze=0 //boolean variable
//---End of settings
//BB
basis = average[length](close)
dev = mult * Std[length](close)
upperBB = basis + dev
lowerBB = basis - dev
//KC
ma = average[lengthKC](close)
myrange = range[lengthKC]
rangema = average[lengthKC](myrange)
upperKC = ma+rangema * multKC
lowerKC = ma-rangema * multKC
value = (Highest[lengthKC](high)+Lowest[lengthKC](low)+average[lengthKC](close))/3
val = linearregression[lengthKC](close-value)
sqzOn = (lowerBB>lowerKC) AND (upperBB<upperKC)
if(sqzOn=1) then
scolorR = 0
scolorG = 255
else
scolorR = 255
scolorG = 0
ENDIF
if val>0 then
sqz=-squeezeDotsOffset*pointsize
else
sqz=squeezeDotsOffset*pointsize
endif
//histogram modifications
if val>0 and val>val[1] then
plusI = val
plusD = 0
minusI = 0
minusD = 0
colorR=0
colorG=245
colorB=255
elsif val>0 and val<val[1] then
plusI = 0
plusD = val
minusI = 0
minusD = 0
colorR=0
colorG=0
colorB=255
elsif val<0 and val<val[1] then
plusI = 0
plusD = 0
minusI = 0
minusD = val
colorR=255
colorG=0
colorB=0
elsif val<0 and val>val[1] then
plusI = 0
plusD = 0
minusI = val
minusD = 0
colorR=255
colorG=255
colorB=0
endif
//candlesticks squeeze painting
if CandlesticksSqueeze then
drawcandle(open,high,low,close) coloured(colorR,colorG,colorB)
endif
RETURN plusI coloured(colorR,colorG,colorB) style(histogram,1) as "plus increase", plusD coloured(colorR,colorG,colorB) style(histogram,1) as "plus decrease", minusI coloured(colorR,colorG,colorB) style(histogram,1) as "minus increase", minusD coloured(colorR,colorG,colorB) style(histogram,1) as "minus decrease", sqz coloured(scolorR,scolorG,0) style(point,5) as "squeeze momentum"
You must be logged in to post a comment.
Bonjour Nicolas, Merci pour cet indicateur! Est-ce possible de configurer une alerte pour un changement de couleur (vert rouge) du squeeze momentum? (Je demande car je ne trouve pas comment faire) Pour pousser encore plus la chose en trading automatique, serait-il possible d'intégrer cet indicateur dans une stratégie? Si oui, je peux faire un post séparé sur le forum. Merci d'avance! Jo
Loaded this great indicator into a chart tonight only to find great big rectangles denoting the squeeze? I don't remember these and have tried to find them in the code above to delete it but can't work out what lines of code are producing them? The line overwhelms the height of the indicator. Pls see image: https://www.dropbox.com/s/31b0sc7hltf6xei/ttm.png Cheers,
HI, this code does not work for me, I have copied it and pasted it into V10.3 but it returns"syntax error". I have tried with and without the "candlestick waiting" part. Does anyone have this as a file to import directly into PRT? Thank you in advance.
Bonjour, y-aurait-t'il une raison pour que le code ne donne pas le bon résultat visuel avec PRT v.11 ? J'ai importé le code du fichier TIF et une affiché l'indicateur sur mon écran, les zones de squeeze ne semblent pas correspondre avec le graphique sur lequel j'ai affiché les BB et les canaux de Keltner... (désolé je ne vois pas comment ajouter une image écran dans mon commentaire :-/ ) Quelqu'un aurait une idée ?
@nicolas: Fantastic post thank you I was hoping you could also create the waves to be used in conjunction with this indicator, there are similar waves created in the past but the ones John Carter uses look much better. Could you create them? Link to the waves: https://www.simplertrading.com/waves/ Thanks in advance
https://www.prorealcode.com/prorealtime-indicators/wave-momentums/
What great work this screener is thanks very much for sharing it. However would it be possible to get the instruments that have fired to remain on the screener in order ? because if you use the higher time frames is is possible to get into a trade on the second or third candle but the fired instruments disappear as soon as they have fired. Also is it possible to put an alert when something fires ? Thanks for your help
bonjour, Je trouve cet indicateur très pertinent. Peut-on lui apporter deux modifications pour faciliter sa lecture sur le graphe? - rendre invisible l'histogramme lorsqu'on choisit de colorer les chandeliers - mettre alors les dot sous la forme de points placés sous chaque chandelier Merci par avance de votre aide
Il faudrait alors changer les lignes 82 à 85 avec ceci: //candlesticks squeeze painting if CandlesticksSqueeze then drawcandle(open,high,low,close) coloured(colorR,colorG,colorB) plusI=0 minusI=0 plusD=0 minusD=0 drawtext("▬",barindex,highest[length](high),Dialog,Bold,14) coloured(scolorR,scolorG,0) endif
Voilà cela vient de fonctionner. L'erreur venait de moi. Lorsque dans la plateforme je voulais ajouter l'indic et cliquait sur " ajouter prorealcode " qui me dirigeait sur le site je cliquais sur le lien et là plus rien, alors le code était enregistré sur un dossier de l'ordi que je n'allais pas chercher au bon endroit. Idem si directement sur le site je faisais clic sur le lien "itf" enregistré et moi je n'allais pas le cherché là où il se trouvait. Toutes mes excuses Nicolas. Par contre j'ai quand même une question : comment faire pour poster un code d'un indic ?
je fais toujours clic droit pour ouvrir le menu contextuel de Windosw mais là : ouvrir le lien ds 1 nouvel onglet, ouvrir le lien ds 1 nouvelle fenêtre, enregistrer le lien sous et copier l'adresse du lien mais enregistrer sous un dossier quelconque dans les 222 downloads j'en sans doute 5 où 6
De lo mejorcito