This script is a merge of @Nico.Muselle's TTM Squeeze script and @QuantNomad's custom screener script. Thanks to both of them!
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.
Also for the histogram - with 20 tickers in the script, there is one histogram.....is this a combination of all the combined tickers? It doesnt seem to align up with any of them perfectly.
I use Heikin Ashi (HA) candles over OHLC candles. Do you happen to know how to update the code/script so it spits out tickers on the screener for squeezes on the HA candles?
I can't seem to get it to work: https://i.imgur.com/ypqtSAt.png
Thanks for this great info. FYI, I am quite new to trading and currently I am studying Squeeze Momentum Indicator using Squeeze Momentum Indicator (SQZMOM_LB) in my chart. My main issue that I have now is to screen for stocks that are within this SMI setup. Basically i have set my screener criteria as follow :
Upper Bollinger Band lower than Upper Keltner Channel
Lower Bollinger Band above than Lower Keltner Channel
Upper Keltner Channel above than Upper Bollinger Band
Lower Keltner Channel below than Lower Bollinger Band
But it seems that the list of stocks is too little and some them just remains the same for few days.
I am just wondering if there's any way i could optimize my screener using your scripting method?
Looking forward to hear from you.
However I use Heikin Ashi (HA) candles over OHLC ("regular") candles and I notice there is a discrepancy in the screener results.
It seems like the actual TTM Squeeze plot/histogram is fine and seems to properly use the HA candles when my chart has them selected on my chart view, but the screener seems to only post tickers based on the TTM Squeeze results using OHLC candles.
For example, I have NVDA, STMP, HZNP as tickers in the source code.
Inputs have been changed where the Timeframe is "Same as symbol". Using 1D for now.
TTM Squeeze for NVDA, 1D shows NO red dot for the last day using OHLC candles, BUT it does for HA candles.
TTM Squeeze for STMP, 1D shows a red dot for the last day using OHLC candles, AND it also does for HA candles.
TTM Squeeze for HZNP, 1D shows a red dot for the last day using OHLC candles, AND it also does for HA candles.
On my chart view, when I swap between OHLC candles or HA candles with the script, the screener results only show the below. It somehow is missing NVDA from the screener results when I have HA candles selected.
How can I update the script to reflect HA candle results for the TTM Squeeze instead of OHLC candles?
Here's a collage of charts/images I've done in the Imgur link here to show what I'm seeing: https://i.imgur.com/ypqtSAt.png