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?

New! PRC is also now 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 • 234 days ago #

    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 • 234 days ago #

      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 • 141 days ago #

  27. SYNDICATE • 80 days ago #

    Is thee a ninja 8 vesion available?

Register or


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

+22 more likes

Related users ' posts
Matriciel Well done Vonasi ! You have a lot of ideas. Personally, I work with Moving Averages only. ...
Bard Hi Nicolas, thanks a lot for coding this interesting looking indicator. I read: https://...
Bard I've also just noticed that changing the "Bands Deviation" setting from 1.25 to eg 3 doesn't...
Marie-Eve Vergoz lorsque je copie les codes, le système me signale des erreurs à la ligne 12 et suivantes
Marie-Eve Vergoz sorry - tout est ok -
jobswaps Sube como trazar lineas de tendencias a tantas barras
4 months ago
Juanjo Hola, Buscando un sistema valido para operar el squeeze, he reprogramado el indicador para ...
mauro1966 BRAVO....
Nicolas En effet merci, erreur corrigée, la variable Risk affecte désormais comme il se doit les cal...
nader003 How can we get this indicator on MT4
Nicolas You can ask for private custom coding to our programming services: https://www.prorealcode.c...
7 months ago
robertogozzi Sorry for my late reply. I’ll make it and open a new topic quite soon.
swapping ah ah ! je n'avais pas vue celui-ci, excellent robert ;)
robertogozzi Thank you swapping.
8 months ago
juanj I have actually completely redesigned this indicator with loads of improvements, so will res...
Didouqc Bonjour Nicolas, Merci pour cet indicateur, encore génial! Je souhaite faire une suggest...
Tony87 on 200k test in the red untill 2017 then strong green
LancerX Please indicate the trade stat to show ave gain against average lost..
Jan Wind Thanks for sharing the strategy !. Did you do an Out of Sample run when testing on the 100k...
Juanjo Me alegro que haya sido de utilidad.
kelso11 How can i change the colour of the channel ? Many Thanks
Nicolas In the indicator's settings window.
juanj Haven't been on this forum for ages! Just logged in to see what is happening and since this ...
robertogozzi Welcome back Juanji, why don’t you post your strategy in the ProOrder support, it’s a better...
Bard Thanks for this great addition. How would you "finish the syntax" if you were to use an ALMA...
Bard Problems with Safari latest s/ware and this site and links and adding code. Let me add the...
jissey Bonjour Bolsatrilera,j'essaie de vous contacter pour le cm rsi ;je le trouve interessant, m...
jissey J'essaie de vous contacter pour l'indicateur"cm rsi"....
lokbuscas is it possible to make a screener with this conditions??? thank you
achel I believe so but I leave it to Nicolas to decide if it is possible
Nicolas Please open a new topic in the screeners forum