New Members: Be sure to confirm your email address by clicking on the link that was sent to your email inbox. You will not be able to post messages until you click that link.
Can someone help me with writing code for the Squeeze indicator by John Carter?
The SC website has a prewritten scan but it does not have useable code for long or short.
0
Answers
Is this the code you mean?
At the bottom of the page are two examples, one for long and one for short. Are these the not usable ones?
If so, what don't they do that you need?
AND [TTM Squeeze(20,2.0,20,1.5,20) is true]
AND [yesterday's TTM Squeeze(20,2.0,20,1.5,20) is false]
Below is the entire code.
[type = stock] AND [country = US]
AND [Daily SMA(20,Daily Volume) > 40000]
AND [Daily SMA(60,Daily Close) > 20]
AND [TTM Squeeze(20,2.0,20,1.5,20) is true]
AND [yesterday's TTM Squeeze(20,2.0,20,1.5,20) is false]
AND [TTM Squeeze Hist (20) > 0]
AND [TTM Squeeze Hist (20) > yesterday's TTM Squeeze Hist (20)]
I didn't realize that they had added the Squeeze and the GoNoGo stuff to the Technical Indicators dropdown. Learn something new every day.
It's funny that in that link to ChartSchool they say to use the Donchian Channel mid line in the calculation section. They don't use Donchian Channel's StockCharts' name, which is Price Channel. The momentum indication is to take the 20 SMA and if it's greater than the 20 Middle Price Channel it's positive.
AND [TTM Squeeze(20,2.0,20,1.5,20) is true]
AND [yesterday's TTM Squeeze(20,2.0,20,1.5,20) is false]
The error message is mismatched types, numeric and true/false sand it applies to both lines. In words, what it is trying to say is that yesterday price was within the upper Bollinger and today it broke above the Upper Bollinger.
BTW, thanks for helping.
When I run "the old squeeze code" mentioned in other posts on this forum and then add the momentum indication via the SMA vs the Middle Price Channel to see what comes up I get no results. But, according to the link to the TTM Squeeze indicator, they use the orginal 1960's definition of the Keltner Channel as created by Chester Keltner. For the Keltner Channel that can be used in scans and on charts, they use the "new" version of the calculation created by Linda Bradford Raschke 20 years later. So there's something off in the values when using the Keltner Channel to identify a squeeze condition vs the TTM Squeeze (ACP Only) indicator.
When I run this today I get 3 results HIG, NGG, and PBF. Same results as yesterday.
[type = stock] AND [country = US]
AND [Daily SMA(20,Daily Volume) > 40000]
AND [Daily SMA(60,Daily Close) > 20]
AND [TTM Squeeze(20,2.0,20,1.5,20) is true]
AND [yesterday's TTM Squeeze(20,2.0,20,1.5,20) is false]
AND [TTM Squeeze Hist (20) > 0]
AND [TTM Squeeze Hist (20) > yesterday's TTM Squeeze Hist (20)]
Your scan as it exists on the SC server could be corrupted in some way (transmission error, disk error, etc.)
I would delete your existing scan altogether, log out, log in again and create a completely new scan with a different name and then type in each line by hand instead of copy/pasting. The c/p could be introducing an error we can't see.
P.S. one other thing - clear your browser cache - could be the browser keeps re-loading a version with errors.