TTM Squeeze Oscillator and On price version

TTM Squeeze Oscillator and On price version

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:

  • light blue = trend is up ; dark blue = momentum of bullish trend is decreasing.
  • red = trend is down ; yellow = bearish momentum is decreasing.

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”.



Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. atlante • 05/01/2017 #

    hi nicolas can you put de nr7 thank you you know what is the market other only dream 
    you are genius

  2. Ozons • 05/01/2017 #

    Bonjour Nicolas,
    merci pour la traduction de cet indicateur. Toutefois je pense qu’il y a une erreur sur la ligne à zéro composée de points rouges et verts car les points verts doivent indiquer que l’on peut opérer donc en tendance, les points rouges alertant que nous sommes sans tendance. Sur votre indicateur il faudrait les inverser. Si d’autres membres peuvent confirmer ce point. Merci  
    Sinon un lien vers le TTM Trend

  3. supertiti • 05/01/2017 #

    Bonjour Ozonsen inversant les couleurs on a ce que tu souhaitesbonne journée
    if(sqzOn=1) then
    scolorR =255// 0
    scolorG = 0//255
    scolorR = 0//255
    scolorG = 255//0

  4. srtrading • 05/01/2017 #

    Hi Nicola
    Thank you for your great work. I have this Problems:

    When i use the TTM indicator on a Chart, every time a candle closed the ttm indicator disapears. And i Need to Change the timeframe to see it again. Do you know this Problem? and how can i solve it?
    When i use the TTM indicator on a Chart with the colored candles: The dotted line is much to far away down. how can i bring the dots closer to the actual candles??Many thanks and Kind regards            Simon

    • Nicolas • 05/01/2017 #

      1/ I don’t know why, this should be a platform bug. I’ll send this code for review at PRT to see what could happened there.
      2/ In your price settings window : “Vertical autoscaling : use price only” must be checked (true).

    • srtrading • 05/01/2017 #

      Hi Nicolas
      thank you for the quick response. 

      Ok please let me know what they have for a solution asap you know it.
      i did what you told me but now i can see the colered dots but the candles are far to small and i can not get them bigger. i have 2 options: have big candles with the dots far away not visible or with the dots visible but the candles very small flat like dots.  Please let me know if you have a idea what to do. Thx

    • Nicolas • 05/01/2017 #

      You can’t have dots and candles on the same indicator. If you apply the indicator on price, select ‘CandlesticksSqueeze’. If you want to only display the oscillator, don’t add it on price and deselect this setting, you’ll have the oscillator and its dots.

  5. srtrading • 05/01/2017 #

    the indicator only disapears if i scroll it just one bit to the left side if i leave it on the very right ist not happening
    thank you for your help

  6. kimbungle • 05/01/2017 #

    @nicolas: is it possible to code a screener with the TTM Squeezer? If yes, how? Thank you very much!

  7. Frank Wilson • 05/01/2017 #

    Hi Nicolas,
    any tips on how to learn basic coding for pro real time? tried reading the manual but can’t seem to get my head around it. wanting to code an indicator that shows Pocket pivots and buyable gap ups. basically just want an indicator that will show an arrow under a volume bar when the up volume is higher than the last ten days down volume. any help is appreciated Thanks

    • Nicolas • 05/01/2017 #

      There is no “easy way” but the prorealtime programming language is easy readable and understandable, even if you are starting from zero.
      I encourage you to read some screeners code already made in the library, you’ll find yourself that it is pretty much easy to code your first screener.
      Anayway, if you are still stuck in programming, you can ask any questions you’d like in the appropriate forums section of the website. Good luck 🙂

  8. kimbungle • 05/01/2017 #

    Hi @nicolas:
    How to build a screener with the TTM if the dot turn red and the Momentum >zero for LONG Signals? and the opposite way for short as well? There is no data for a red dot? Can you help me to build a screener around that?Thank you very much!

    • Nicolas • 05/01/2017 #

      This screener should help:

  9. kimbungle • 05/01/2017 #

    Thank´s Nicolas, that screener you mentioned is ok, but not perfect yet.And I have tha same problem as @srtrading, the indicator disapears after the candle close. pretty much annoying in smaller time period. If you have an update, please let us know.Are the red dots correct setted? As @supertiti mentioned in the post above?Thank you

    • Nicolas • 05/01/2017 #

      You can use the code supertiti provided to change the color accordingly to your preference. I still don’t have any news about the disappearing issue, sorry.

  10. klaus • 05/01/2017 #

     if you remove the drawcandle statement nothing disappears.

    • Nicolas • 05/01/2017 #

      That’s right or you can comment it with REM. I still don’t have any news about this issue FYI.

  11. Bard • 05/01/2017 #

    Hi Nicolas, hope you are well, Thanks for putting up a better version of the TTM squeeze than the one I currently have. I was wondering where is the “CandlesticksSqueeze” in the indicator settings, when applying the indicator to the Price chart? I don’t see it on either the TTM “candlestick” setting or in the Price settings? Could you provide a screenshot please?I was building a system yesterday but when I came back to it today the assisted creation conditions are greyed out? If you touch one of the two fields it will go to white writing but there is no drop down functionality anymore to choose another parameter and the “value” field will still be greyed out (also with no drop down functionality). Do you know why it is doing that? Pls see screens… just realised there I cannot add attachment images here, so: John Carter mentions ( that the buy signal is when the squeeze red dots go to green and the momentum is positive (light blue). On the indicator the squeeze momentum is sometimes -0.0 and also 0.0. Using the assisted creation tool (when it’s working again and I already tried duplicating the strategy but still have no assisted creation drop down to change conditions), how can you program it to buy on a green dot (along with the condition that the momentum is positive light blue) because squeeze momentum red dots can be -0.0 or  0.0 as can green dots? I cannot figure out how in the code you could change that value for “squeeze momentum” to say +1 and -1? Thanks,Bard

    • Nicolas • 05/01/2017 #

      Hi Bard, I’m overwhelm as usual! 🙂 If you want to check the squeeze color, you need to return sColorR in the RETURN instruction line and check if it is >0 or not (this is the red color). So if this variable is superior to zero, then the momentum is not squeezed (I know the color are inverted from red to green in my indicator ..).

  12. Bard • 05/01/2017 #

    Do you dream in code? (:Sorry, I’m still not clear how to do get an auto trade instruction to enter (dependent upon momentum plus or minus) when the red squeeze turns to a green breakout? (thanks @supertiti)I am not sure how the colours are relevant? I do see the only mention of “sColorR” in the RETURN part for the sqz colours (last line of indicator code) but everywhere else in the code there isn’t a way to, (whether the values are plus increase and minus increase or a plus decrease and minus decrease) to signify that momentum sqz can be anything other than -0 or 0 which can be red or green (and -0 doesn’t work in the auto trading) when the squeeze momentum value needs to be -1 or 1. (e.g. 1 = red dots and -1 = green dots)?
    Also I added the Bollinger (20 period 2 x std dev) and the Keltner (20 period) indicators to my chart, but when for example the lower Bollinger is greater than the lower Keltner, (i.e. “a squeeze” and potential alert to a break out), there aren’t always red dots, sometimes they still green dots on my Daily Nikkei DFB?

    • Nicolas • 05/01/2017 #

      if sColorR is superior to 0, the dot is red, so you got everything needed 🙂

  13. Bard • 05/01/2017 #

    “If you want to check the squeeze color, you need to return sColorR in the RETURN instruction line and check if it is >0 or not” I don’t understand what I am supposed to do/change/code? i.e. if I want to automate the system to enter when the red dot goes to green, I cannot figure out how do do that using the assisted creation tool? “if sColorR is superior to 0, the dot is red” But sqz momentum = 0, (and the mkt is falling), yet the dot can be either red OR green and if sqz momentum = -0 (and emphasis on minus here because you cannot have a -0.0 in assisted creation), it’s also red OR green (the mkt is rising), meaning I cannot figure out how to set up a conditionality:Enter long if (i) the red dot squeeze turns to a green dot (and a breakout is imminent)AND (ii) the plus increase is > 0 (to signify a long position is to be taken). Exit Long ifPlus decrease bar occurs (as per John Carter’s strategy)CheersBard

    • Nicolas • 05/01/2017 #

      ok, put your question in forum, I’ll do the code there. thanks.

  14. Bard • 05/01/2017 #

    Hi Nicolas, I loaded up my trading template tonight and got an error for the TTM indicator //candlesticks squeeze painting?
    It now “doesn’t like” the brackets before the open,and the comma after the open
    Also a warning for the bracket after the colorB) ?
    //candlesticks squeeze paintingif CandlesticksSqueeze thendrawcandle(open,high,low,close) coloured(colorR,colorG,colorB)endif
    RETURN plusI coloured(colorR,colorG,colorB) etc

  15. Bard • 05/01/2017 #

    p.s. It worked fine yesterday. I’ve just opened up another template that I have, which also loaded fine yesterday? 

    • Nicolas • 05/01/2017 #

      You certainly changed the code of the indicator and made a typo somewhere. Please redownload it and copy/paste the whole code from the library.

    • Bard • 05/01/2017 #

      I haven’t changed the code related to the parts mentioned above. The only modification was made to reversing the Sqz On. All my templates with TTM on Price load fine today… 

  16. dzim0032 • 05/01/2017 #

     Bonjour Nicolas. Je connais aussi le Squezze de John Carter. J’ai tenté de copier-coller ce code dans PRT et il me dit qu’il y a des erreurs de syntaxe : veuillez définir les variables ( 6 au total ) length, mult, lengthkc, multkc, squezzedotsoffset et candlestickssquezze. Comment y remédier. Merci.

    • Nicolas • 05/01/2017 #

      Il faut décommenter ces variables dans le code (supprimer les //) ou télécharger la version ITF directement, ces paramètres sont intégrés dans le fichier?

  17. dzim0032 • 05/01/2017 #

    Ok comment télécharger la version itf justement. Merci.

    • Nicolas • 05/01/2017 #

      216 personnes ont déjà trouvé le lien à la fin du post, je pense que tu le peux aussi 🙂 

  18. dzim0032 • 05/01/2017 #

    J’avais dès le début cliquer sur le lien au-dessus : itf Filename : prc_ttm-squezze 10.3 itf et le résultat est indescriptible ( que des caractères inconnus ). Je suis par ailleurs nul en anglais. Merci

    • Nicolas • 05/01/2017 #

      Clic droit / Enregistrer sous ?

  19. dzim0032 • 05/01/2017 #

    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 

    • Nicolas • 05/01/2017 #

      Il faut importer le fichier .itf téléchargé dans la plateforme en suivant ce tutoriel:

  20. dzim0032 • 05/01/2017 #

    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 ?

    • Nicolas • 05/01/2017 #

      Je suis content que tu y soit arrivé par toi même 🙂
      Si tu souhaites partager un code dans la “library”, il faut utiliser le petit bouton “+” en haut à droite dans la barre de navigation à côté de ton avatar. 

  21. dzim0032 • 05/01/2017 #

    C’est justement le TTM Squezze de John Carter que j’avais trouvé il y a quelques années sur le forum de ProAt je le mettrais prochainement avec les explications. Bonne soirée. Denis.

  22. dzim0032 • 05/01/2017 #

    J’ai commencé à ingurgiter les vidéos explicatives sur la formation de programmation à PRT après ma dernière demande sur le ZigZag et c’est vraiment difficile.

  23. mcha • 05/01/2017 #

    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

    • Nicolas • 05/01/2017 #

      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)
      drawtext(“▬”,barindex,highest[length](high),Dialog,Bold,14) coloured(scolorR,scolorG,0)

    • mcha • 05/01/2017 #

      Bonsoir Nicolas,
      Merci beaucoup pour ce complément de code, qui fait disparaitre l’histogramme du graphe et garde les dot signant une consolidation ou un trend selon la couleur. Merci également pour votre réactivité.

  24. casamania • 05/01/2017 #

    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

    • Nicolas • 05/01/2017 #

      This code is not a screener but an indicator, I’m not sure I understand you correctly, are you referring to another code of the library?

  25. casamania • 05/01/2017 #

    Hi Nicolas I am new to this so sorry, I am talking about the TT SQUEEZE FIRED screener. Thanks Gary

    • Nicolas • 05/01/2017 #

      ok, so your query should be asked there:
      I’ll answer you in this other post instead, thanks.

    • Nicolas • 05/01/2017 #

      answered here:

  26. theproday • 05/01/2017 #

    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:
    Thanks in advance

    • Nicolas • 05/01/2017 #

      Please open a new topic in the ProBuilder forum and ask about it. Please provide as much details as possible and possibly with screenshots. Thank you.

    • Swingforfortune • 05/01/2017 #

  27. SYNDICATE • 05/01/2017 #

    Is thee a ninja 8 vesion available?

  28. Axel98 • 05/01/2017 #

    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 • 05/01/2017 #

      Le canal de Keltner de la plateforme utilise un écart multiplicateur de 1 par défaut et on ne peut pas le changer. Celui du code de l’indicateur permet de modifier cet écart, par défaut à 1.5.

  29. Axel98 • 05/01/2017 #

    Merci pour l’info

  30. Tradingshed • 05/01/2017 #

    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.

    • Nicolas • 05/01/2017 #

      The file to download is located at the bottom of the page, it is the case for any of the codes available in the library.

  31. Bard • 05/01/2017 #

    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: Cheers,

  32. svdhoble • 05/01/2017 #

    Hi how one can download the TTM squeeze indicator?

    • Nicolas • 05/01/2017 #

      Attached files of this post are listed below “ProRealTime ITF files and other attachments :” title.

Register or


avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar

+31 more likes

Related users ' posts
Nicolas Add it on the price chart by using the wrench on the left upper side of your price chart.
Guibourse I'm facing the exact same issue : even if I follow the correct path (import the its file and...
Nicolas Sorry there was a small issue in the code, i have changed the attached itf file and updated ...
Seabiscuit Hi! I like this indicator a lot, been using it on a 30 min timeframe and usually confirms my...
Ramahu Bonjour et merci pour cet indicateur ! je l'observe sur les actions du Nasdaq et la plupart ...
Gianluca Sorry but the stochastic part should be different: sto=Stochastic[14,1] stod=average[3](sto)...
Regisnew Bonjour à la communauté serait il possible d'avoir un scanner qui ramène les actions en jou...
Nicolas Merci d'ouvrir un sujet dans le forum des screeners en respectant les règles de publication ...
Fabian Hi Thomas, thanks for your explanations. Which indicator do you use in the screenshot ...
Thomas Thats On Balance Volume and Bollinger or SMA or what you want. It shows me the volume flow. ...
bertrandpinoy @MAKSIDE I would be grateful if you send me your version. have a nice day
jissey Bjr Nicolas, merci pour cet indicateur interessant, mais en le recopiant pour creer un progr...
Nicolas Il doit s'agir d'un mauvais copier/coller. Je suggère de télécharger le fichier itf contenu ...
Bard Hello @Nicolas, I can get this to display in a separate indicator panel but not on Price as ...
Fabian Hi IV Mcm, have you drawn the rectangles (Dinamic, Range) by yourself in the chart or are...
IV Mcm Myself to illustrate ;)
oraclus Bonjour indicateur très intéressant existe t il un screener qui détecte les actions qui donn...
IV Mcm Ce n'est pas le but de cet indicateur, mais avec un peu d'entraînement vous pourriez le code...
Yantra Thank you for sharing your good work!
Madrosat I Have not see a fully functioning automated strategy on your site?? Really have you???
juanj Hi Madrosat, why would it be on my site? I have developed it for my personal use and also to...
Madrosat ok I understood you are using prorealcode to hack the fish
imonix Have been trying this on demo since Monday before deciding whether to go live with it. Using...
Roberto Blázquez I'm sorry, I've tried it since November 2012 and it's bad results.
jaginho Bonjour Vivien, je n'arrive pas à comprendre ce screener... En tout cas merci pour tes contr...
samsampop Superb, merci!
Dunstan I would like to get guidance_ How do I access and attach this indicator to my MT5 platform...
Nicolas You can't, use prorealtime, it's way better
jc84 Thank you very much for this indicator , not provided by PRT I was actually working at thi...
luxrun // volatilità Schwager calcolo x = TR (close) y = exponentialaver...
luxrun sorry, add prt code add doesn't work
robertogozzi Don't worry about PRT code, I can't make it work either! Great for pointing that out, it's ...
luxrun One question, Roberto: the two AvgT are variable, could you explain to me what they regulate...
robertogozzi AvgT stands for Average Type, it's a parameter for the AVERAGE keyword (https://www.prorealc...