StockFetcher Forums · General Discussion · John Carter - Squeeze<< 1 2 3 >>Post Follow-up
saico
59 posts
msg #154034
Ignore saico
modified
9/15/2020 2:52:24 PM

Hi everyone,

is there a way to change the code below, so that it will show stocks with a count of at least 4 days being in a squeeze?

Thanks for your help!

/* Keltner Bollinger Squeeze Filter Modified*/

set{xUp, days(upper bollinger(20,2.0) above the Upper Keltner Band(20,1.5) , 100 )}
set{xDn, days(lower bollinger(20,2.0) below the Lower Keltner Band(20,1.5) , 100 )}

set{xUBB, days(high >= upper bollinger(20,2.0) , 100 )}
set{xLBB, days(low <= lower bollinger(20,2.0) , 100 )}

set{xRange, high - low }
set{xRPCT, xRange / atr(20) }

set{xMomStudy, cema(momentum(12), 5) }
set{xReturn1, xMomStudy + MACD Fast Line(12,26) }
set{xReturn, xReturn1 / 2 }

/* plots */

draw xUp
draw xDn on plot xUp

draw xRange
draw atr(20) on plot xRange

draw momentum(12)
draw macd(12,26,9)
draw xReturn

draw xMomStudy
draw line 0 on plot xMomStudy
PlotType{xMomStudy,zerobar}

set{TTMSqueezeTop, count(Upper Bollinger Band(20,2) < Upper Keltner Band(20,1.5),1)}
set{TTMSqueezeBotA, count(Lower Bollinger Band(20,2) > Lower Keltner Band(20,1.5),1)}
set{TTMSqueezeBot, TTMSqueezeBotA * -1}

draw TTMSqueezeTop on plot xMomStudy
PlotType{TTMSqueezeTop,dot}

draw TTMSqueezeBot on plot xMomStudy
PlotType{TTMSqueezeBot,dot}

set{Kwidth, Upper Keltner Band(20,1.5) - Lower Keltner Band(20,1.5)}
set{Bwidth, Upper Bollinger Band(20,2) - Lower Bollinger Band(20,2)}
set{KBRatio, Bwidth / Kwidth}
add column KBRatio



/* column displays */

add column xUp
add column xDn

add column xUBB
add column xLBB

add column xRange
add column atr(20)
add column xRPCT
add column xReturn


/* squeeze selection */

upper bollinger(20,2.0) below the Upper Keltner Band(20,1.5)

lower bollinger(20,2.0) above the Lower Keltner Band(20,1.5)
xMomStudy above 0
price near upper bollinger(20,2)
/* price, volume selection */

close above 1
volume above 300000

nibor100
1,042 posts
msg #154040
Ignore nibor100
9/16/2020 1:23:46 PM

Sure there is, per pages 8 and 9 of the SF manual, add the phrase

"for the last 4 days"

to both of these lines:

upper bollinger(20,2.0) below the Upper Keltner Band(20,1.5)

lower bollinger(20,2.0) above the Lower Keltner Band(20,1.5)

Ed S.

saico
59 posts
msg #154064
Ignore saico
9/19/2020 8:57:46 AM

Thanks Ed, really appreciate your help!

saico
59 posts
msg #156764
Ignore saico
modified
5/8/2021 7:35:48 PM

Hi everyone, I use the original TTM Sqeeze with TOS and noticed often, that our one here plots the first dot 1 day late, probably due to both Kel and BB's here at SF are not the standard ones other platform use. Does anyone has a fix to that? Thanks in advance! Saico

StockFetcher Forums · General Discussion · John Carter - Squeeze<< 1 2 3 >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.