StockFetcher Forums · General Discussion · TTM Count<< >>Post Follow-up
dashover
226 posts
msg #155632
Ignore dashover
2/8/2021 12:07:37 PM


Could someone create a sortable column to count how many days the Bollinger bands have been "inside"
the Keltners...

Thanks!

Dash

Cheese
1,374 posts
msg #155635
Ignore Cheese
modified
2/8/2021 1:00:55 PM

dash,

Something to get you started until better coding comes along
I have a basic sub, so this is about as far as I could go

Fetcher[
/*
https://www.stockfetcher.com/forums/Filter-Exchange/TTM-squeezed-fired-day-ago/152542
xarlor 6/8/2020 10:03:10 PM
*/

market is not OTCBB


close is > 1
AVERAGE VOLUME(30) < 1000000

set{momo,cema(momentum(16),5)}

draw momo
plottype{momo,zerobar}



draw Bollinger Band(20,2)
draw Keltner Band(20,2)

set{sqz1,count(momo > .01,1)}
set{sqz2,count(momo < 0,1)}
set{sqz3,count(Upper Bollinger Band(20,2) < Upper Keltner Band(20,2),1)}
set{sqz4,count(Lower Bollinger Band(20,2) > Lower Keltner Band(20,2),1)}
set{sqz5,sqz3 * sqz4}
set{sqz6,sqz1 + sqz2}
set{TTM_Squeeze,sqz5 * sqz6}

draw TTM_Squeeze

/*
I added this
https://www.stockfetcher.com/forums/General-Discussion/TTM-Count/155632
*/

set{TTM_howmany_past5days,count( TTM_Squeeze > 0,5)}
add column TTM_howmany_past5days

sort column 5 descending


]



graftonian
1,089 posts
msg #155644
Ignore graftonian
2/8/2021 6:41:09 PM

Fetcher[
set{daysback, days(Upper Bollinger Band(20,2) < Upper Keltner Band(10,1.0), 21)}
add column daysback
draw Upper Bollinger Band(20,2) draw Upper Keltner Band(10,1.0)
]



and the same for lower band, pick the MIN() and viola'

StockFetcher Forums · General Discussion · TTM Count<< >>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.