Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

TTM Squeeze indicator Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
kirbyo
Posted : Sunday, October 5, 2008 9:25:47 PM
Registered User
Joined: 12/17/2004
Posts: 3

Has anyone been able to build the TTM squeeze indicator into blocks ?
thanks

Bruce_L
Posted : Monday, October 6, 2008 10:52:58 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
My understanding (from TTM Squeeze Indicator) of the TTM Squeeze Indicator is the ratio of the width of a 20-Period, 2-SD Bollinger Band to the width of a Keltner Channel that uses 1.5 * the 20-Period Simple Moving Average of True Range for its distance from centerline calculations. If this understanding is correct, you should be able to Plot TTM Squeeze using the following RealCode Indicator:

Static Sum As Single
Static SumSq As Single
Static BB As Single
Static Keltner As Single
If isFirstBar Then
    Sum = 0
    SumSq = 0
    Keltner = 0
Else
    Sum += Price.Last
    SumSq += Price.Last^2
    Keltner += 1.5*(System.Math.Max(Price.High,Price.Last(1)) - _
        System.Math.Min(Price.Low,Price.Last(1)))/20
    If CurrentIndex >= 21 Then
        Sum -= Price.Last(20)
        SumSq -= Price.Last(20)^2
        Keltner -= 1.5*(System.Math.Max(Price.High(20),Price.Last(21)) - _
            System.Math.Min(Price.Low(20),Price.Last(21)))/20
    End If
End If
If CurrentIndex >= 20 Then
    BB = 2*((SumSq - Sum^2/20)/20)^.5
    Plot = BB/Keltner
Else
    Plot = Single.NaN
End If

You may also wish to review the following:

What do you get when you cross a Keltner Channel and Bollinger Bands?

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
maxgoldfinger
Posted : Monday, January 19, 2009 1:56:03 PM
Registered User
Joined: 1/13/2009
Posts: 3
what changes are required to make this work as a stock finder scan?
Bruce_L
Posted : Monday, January 19, 2009 8:16:23 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
maxgoldfinger,
In StockFinder, you can just right-click on the RealCode Indicator and select Create Rule to make a Rule for use as in a Filter, Scan or BackScan.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
musicguy
Posted : Sunday, November 15, 2009 9:03:38 AM
Registered User
Joined: 9/23/2009
Posts: 2
Hi Bruce, i tried to copy and paste your Realcode above and it showed an error in line 26 and 28, which is the last 4 lines. The error is : Name 'Plot' is not declared. 
Any advise? (i do not know anything about realcode, im simply pasting your code.)
Cheers!

    Plot = BB/Keltner
Else
    Plot = Single.NaN
End If
StockGuy
Posted : Sunday, November 15, 2009 7:10:22 PM

Administration

Joined: 9/30/2004
Posts: 9,187

It sounds like you're trying to paste the code into a RealCode Rule.  "Plot" is not recognized in a rule.  Click Add Indicator, Create in RealCode and paste code.

mrcauldwell
Posted : Saturday, December 18, 2010 2:49:00 PM
Registered User
Joined: 12/18/2010
Posts: 5
Hello,

I have also copied and pasted the code to create the ttm squeeze indicator in stockfinder 5. I was wondering if someone could give a brief explanation about the levels we are looking for on the indicator.

For example, less than 1 is when the squeeze is on.

Or, as shown in the ttm video, if we plot the indicator as a bar chart, a possible exit signal is two consecutive declining bars.

Thanks
Bruce_L
Posted : Monday, December 20, 2010 10:37:05 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
QUOTE (mrcauldwell)
I have also copied and pasted the code to create the ttm squeeze indicator in stockfinder 5. I was wondering if someone could give a brief explanation about the levels we are looking for on the indicator.

The trainers can't give setting, interpretation or investment advice.

QUOTE (mrcauldwell)
For example, less than 1 is when the squeeze is on.

Right-click on the TTM Squeeze Indicator and select Create Condition | Less Than: 1.

Creating Conditions

QUOTE (mrcauldwell)
Or, as shown in the ttm video, if we plot the indicator as a bar chart, a possible exit signal is two consecutive declining bars.

Right-click on the TTM Squeeze Indicator and select Create Condition | Net Change | Less Than: 0 | Passing 2 of the last 2 Bars.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
tommystam
Posted : Monday, April 2, 2012 9:11:28 AM
Registered User
Joined: 1/19/2012
Posts: 13

Hello, I am clicking on Add Indicator on a chart, than I click on Write Indicator Formula, than I copy paste your code and it says Formula Error in red?? Why isnt this working?

 

This is the formula I am copying/pasting:

Static Sum As Single
Static SumSq As Single
Static BB As Single
Static Keltner As Single
If isFirstBar Then
    Sum = 0
    SumSq = 0
    Keltner = 0
Else
    Sum += Price.Last
    SumSq += Price.Last^2
    Keltner += 1.5*(System.Math.Max(Price.High,Price.Last(1)) - _
        System.Math.Min(Price.Low,Price.Last(1)))/20
    If CurrentIndex >= 21 Then
        Sum -= Price.Last(20)
        SumSq -= Price.Last(20)^2
        Keltner -= 1.5*(System.Math.Max(Price.High(20),Price.Last(21)) - _
            System.Math.Min(Price.Low(20),Price.Last(21)))/20
    End If
End If
If CurrentIndex >= 20 Then
    BB = 2*((SumSq - Sum^2/20)/20)^.5
    Plot = BB/Keltner
Else
    Plot = Single.NaN
End If

Bruce_L
Posted : Monday, April 2, 2012 10:52:40 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

It is not working in TC2000 version 12 because it is not an Indicator Formula for TC2000 version 12. It is a RealCode Indicator for StockFinder.

You could use the following Indicator Formula as a Custom PCF Indicator in TC2000 version 12 to duplicate this RealCode Indicator:

2 * SQR(ABS(C ^ 2 + C1 ^ 2 + C2 ^ 2 + C3 ^ 2 + C4 ^ 2 + C5 ^ 2 + C6 ^ 2 + C7 ^ 2 + C8 ^ 2 + C9 ^ 2 + C10 ^ 2 + C11 ^ 2 + C12 ^ 2 + C13 ^ 2 + C14 ^ 2 + C15 ^ 2 + C16 ^ 2 + C17 ^ 2 + C18 ^ 2 + C19 ^ 2 - 20 * AVGC20 ^ 2) / 20) / (1.5 * (AVGH20 - AVGL20) / 2 + (ABS(H - C1) + ABS(C1 - L) + ABS(H1 - C2) + ABS(C2 - L1) + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H3 - C4) + ABS(C4 - L3) + ABS(H4 - C5) + ABS(C5 - L4) + ABS(H5 - C6) + ABS(C6 - L5) + ABS(H6 - C7) + ABS(C7 - L6) + ABS(H7 - C8) + ABS(C8 - L7) + ABS(H8 - C9) + ABS(C9 - L8) + ABS(H9 - C10) + ABS(C10 - L9) + ABS(H10 - C11) + ABS(C11 - L10) + ABS(H11 - C12) + ABS(C12 - L11) + ABS(H12 - C13) + ABS(C13 - L12) + ABS(H13 - C14) + ABS(C14 - L13) + ABS(H14 - C15) + ABS(C15 - L14) + ABS(H15 - C16) + ABS(C16 - L15) + ABS(H16 - C17) + ABS(C17 - L16) + ABS(H17 - C18) + ABS(C18 - L17) + ABS(H18 - C19) + ABS(C19 - L18) + ABS(H19 - C20) + ABS(C20 - L19)) / 40)

 



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jantoreg
Posted : Wednesday, September 21, 2016 4:15:55 AM
Registered User
Joined: 2/21/2016
Posts: 2

Hi! I try to copy this code into Custom PCF Indicator:

2 * SQR(ABS(C ^ 2 + C1 ^ 2 + C2 ^ 2 + C3 ^ 2 + C4 ^ 2 + C5 ^ 2 + C6 ^ 2 + C7 ^ 2 + C8 ^ 2 + C9 ^ 2 + C10 ^ 2 + C11 ^ 2 + C12 ^ 2 + C13 ^ 2 + C14 ^ 2 + C15 ^ 2 + C16 ^ 2 + C17 ^ 2 + C18 ^ 2 + C19 ^ 2 - 20 * AVGC20 ^ 2) / 20) / (1.5 * (AVGH20 - AVGL20) / 2 + (ABS(H - C1) + ABS(C1 - L) + ABS(H1 - C2) + ABS(C2 - L1) + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H3 - C4) + ABS(C4 - L3) + ABS(H4 - C5) + ABS(C5 - L4) + ABS(H5 - C6) + ABS(C6 - L5) + ABS(H6 - C7) + ABS(C7 - L6) + ABS(H7 - C8) + ABS(C8 - L7) + ABS(H8 - C9) + ABS(C9 - L8) + ABS(H9 - C10) + ABS(C10 - L9) + ABS(H10 - C11) + ABS(C11 - L10) + ABS(H11 - C12) + ABS(C12 - L11) + ABS(H12 - C13) + ABS(C13 - L12) + ABS(H13 - C14) + ABS(C14 - L13) + ABS(H14 - C15) + ABS(C15 - L14) + ABS(H15 - C16) + ABS(C16 - L15) + ABS(H16 - C17) + ABS(C17 - L16) + ABS(H17 - C18) + ABS(C18 - L17) + ABS(H18 - C19) + ABS(C19 - L18) + ABS(H19 - C20) + ABS(C20 - L19)) / 40)

 

...but i get this error: Argument missing near *

What do i do wrong?

Bruce_L
Posted : Wednesday, September 21, 2016 11:15:59 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Does your computer use the , as as the decimal marker instead of a . as would be more common in the United States? If so, please try the following instead.

2 * SQR(ABS(C ^ 2 + C1 ^ 2 + C2 ^ 2 + C3 ^ 2 + C4 ^ 2 + C5 ^ 2 + C6 ^ 2 + C7 ^ 2 + C8 ^ 2 + C9 ^ 2 + C10 ^ 2 + C11 ^ 2 + C12 ^ 2 + C13 ^ 2 + C14 ^ 2 + C15 ^ 2 + C16 ^ 2 + C17 ^ 2 + C18 ^ 2 + C19 ^ 2 - 20 * AVGC20 ^ 2) / 20) / (3 * (AVGH20 - AVGL20) / 4 + (ABS(H - C1) + ABS(C1 - L) + ABS(H1 - C2) + ABS(C2 - L1) + ABS(H2 - C3) + ABS(C3 - L2) + ABS(H3 - C4) + ABS(C4 - L3) + ABS(H4 - C5) + ABS(C5 - L4) + ABS(H5 - C6) + ABS(C6 - L5) + ABS(H6 - C7) + ABS(C7 - L6) + ABS(H7 - C8) + ABS(C8 - L7) + ABS(H8 - C9) + ABS(C9 - L8) + ABS(H9 - C10) + ABS(C10 - L9) + ABS(H10 - C11) + ABS(C11 - L10) + ABS(H11 - C12) + ABS(C12 - L11) + ABS(H12 - C13) + ABS(C13 - L12) + ABS(H13 - C14) + ABS(C14 - L13) + ABS(H14 - C15) + ABS(C15 - L14) + ABS(H15 - C16) + ABS(C16 - L15) + ABS(H16 - C17) + ABS(C17 - L16) + ABS(H17 - C18) + ABS(C18 - L17) + ABS(H18 - C19) + ABS(C19 - L18) + ABS(H19 - C20) + ABS(C20 - L19)) / 40)



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
limitless4646
Posted : Friday, September 23, 2016 1:36:08 AM
Registered User
Joined: 4/3/2014
Posts: 22

Can we get a final version of the ttm squeeze? I looked through all the posts and couldn't find the final one because there were soo many. thanks in advance

androoku
Posted : Monday, April 9, 2018 3:09:39 AM
Registered User
Joined: 5/25/2017
Posts: 1

Hello Bruce can you please send me the TTM Squeeze indicator? I am trying to get it on my TC 2000. 

 

Thanks in advance!

 

- Andrew

yyzTrader
Posted : Wednesday, June 27, 2018 12:18:05 PM
Registered User
Joined: 6/6/2017
Posts: 1

Hi Bruce, can you please send me the TTM Squeeze indicator as well.

 

Thanks,,

Rob

 

Bruce_L
Posted : Wednesday, June 27, 2018 12:35:51 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

I have sent you a TCMail with a chart containing the TTM Squeeze indicator.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.