Hi guys, please find here the TTM squeeze pro. This updated version of the TTM squeeze now includes 3 levels of squeeze, low, mid and high compression rather than the previous mid squeeze only. It also includes the momentum histogram. Thanks to JS who helped with parts of the code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
length=20 lengthkc=20 mult=2.0 DonchianMidline = (Highest[20](high)+Lowest[20](low)+Average[20](close) )/3 sma=close-(DonchianMidline) Delta = linearregression[20](sma) basis = exponentialaverage[length](close) dev = mult * Std[length](close) BBup = basis + dev BBdn = basis - dev //KC ma = exponentialaverage[lengthkc](close) myrange = averagetruerange[14] KC2up = ma+myrange * 2 KC2dn = ma-myrange * 2 KC15up = ma+myrange * 1.5 KC15dn = ma-myrange * 1.5 KC1up = ma+myrange * 1 KC1dn = ma-myrange * 1 sqzOnlow = (bbup<kc2up) and (bbup>kc15up) and (bbdn>kc2dn) and (bbdn<kc15dn) sqzOnmid = (bbup<kc15up) and (bbup>kc1up) and (bbdn>kc15dn) and (bbdn<kc1dn) sqzOnhigh = (bbup<kc1up) and (bbdn>kc1dn) if sqzOnlow then DrawPoint(BarIndex,0,3)Coloured(255,255,255) //AcolorR = 255 //AcolorG = 255 //AcolorB= 255 else //DrawPoint(BarIndex,0,3)Coloured(255,0,0) //colorR = 255 //colorG = 0 //COLORB=0 endif if sqzOnmid then DrawPoint(BarIndex,0,3)Coloured(0,255,0) //BcolorR = 0 //BcolorG = 255 //BcolorB= 0 else //DrawPoint(BarIndex,0,3)Coloured(255,0,0) //colorR = 255 //colorG = 0 //COLORB=0 ENDIF if sqzOnhigh then DrawPoint(BarIndex,0,3)Coloured(0,0,255) //CcolorR = 0 //CcolorG = 0 //CcolorB= 255 else //DrawPoint(BarIndex,0,3)Coloured(255,0,0) //colorR = 255 //colorG = 0 //COLORB=0 ENDIF If BBUP > KC2UP AND BBDN<KC2DN then DrawPoint(BarIndex,0,3)Coloured("Red") EndIf //histogram modifications if delta>0 and delta>delta[1] then plusI = delta plusD = 0 minusI = 0 minusD = 0 colorR=0 colorG=245 colorB=255 elsif delta>0 and delta<delta[1] then plusI = 0 plusD = delta minusI = 0 minusD = 0 colorR=0 colorG=0 colorB=255 elsif delta<0 and delta<delta[1] then plusI = 0 plusD = 0 minusI = 0 minusD = delta colorR=255 colorG=0 colorB=0 elsif delta<0 and delta>delta[1] then plusI = 0 plusD = 0 minusI = delta minusD = 0 colorR=255 colorG=255 colorB=0 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" |
Enjoy!
Share this
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 :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Bonjour , est-il possible d’avoir un peu plus de commentaire sur les points au milieu de l’histogramme et sur l’unité de temps préférentielle , pour l’utilisation et l’efficacité de c’est indicateur SVP ? Merci . Salutations .
I dont speak French but i think i understand the question. The indicator is used for volatility breakouts, the dots show when a stock/market is in a “squeeze” which means that volatility has reduced. The low squeeze is when the Bollinger bands are inside the 2 ATR Keltner channels, the mid squeeze is when the Bands are within the 1.5 ATR Keltners and the high squeeze is when the Bollingers are inside the 1 ATR Keltners. The indicator can be used in any time frame.
2
Merci pour votre réponse .