TTM_Squeeze first cyan bar after three bars of any other color


Category:
0
0

Hi Pete,

Please direct me to the post but I didn’t see this request in the forum on this. I’m looking for a scan and a customized watch list column on stocks that show a Cyan bar after a minimum of three non-such bars in the TTM Squeeze.

Thank you again!

Marked as spam
Posted by (Questions: 20, Answers: 27)
Asked on May 28, 2020 10:48 am
332 views
1
Private answer

Same code can be used for scan and watchlist. The watchlist will display 1 when condition is true and zero when false.

input price = CLOSE;
input length = 20;
input nK = 1.5;
input nBB = 2.0;
input alertLine = 1.0;
def histogram = TTM_Squeeze(price, length, nK, nBB, alertLine).Histogram;
def cyanBar = histogram > histogram[1] and histogram > 0;
plot signal = cyanBar and Highest(cyanBar[1], 3) < 1;

Marked as spam
Posted by (Questions: 39, Answers: 3752)
Answered on May 28, 2020 1:24 pm
Thank you so much again Pete! You're the best!
( at May 29, 2020 6:57 am)
Hello Pete, Piggy backing off this---is there a way to use this code (or something similar) to scan ONLY those that are in the CYAN zone? My goal is to scan stocks in the 4H and 1H time frame that are currently BOTH in CYAN. I feel like this alternative method would be beneficial on the days where the market is ultra bullish (like today) Thanks!
( at August 24, 2020 6:22 am)
Take some time to use the search box and you will find many examples. We have published an entire video on the topic here: https://www.hahn-tech.com/thinkorswim-scan-ttm-squeeze-histogram/ and I found the following post in the Q&A forum here: https://www.hahn-tech.com/ans/ttm_squeeze-first-cyan-bar-after-three-bars-of-any-other-color/
( at August 24, 2020 8:59 am)
Hello Pete, Is there a way to scan the SECOND cyan bar after three bars of any other color?
( at October 6, 2020 11:20 am)
Yes. You will modify only the last line of code as follows: plot signal = cyanBar and cyanBar[1] and Highest(cyanBar[2], 3) < 1;
( at October 6, 2020 11:34 am)
Hello Pete, apologies for piggy backing but I have tried to edit this above code but no luck. I'm trying to scan for the first cyan blue bar after a yellow bar. how can I accomplish this? thank you in advance.
( at October 19, 2021 9:05 pm)
You will find that solution here: https://www.hahn-tech.com/ans/scan-base-off-of-ttm-squeeze-color-of-histogram/
( at October 19, 2021 9:45 pm)
Thank you Pete, I watched the video in the link provided, I tried to glue all the pieces together and I'm not getting the results I would like. My ask is for a scan to provide stocks that have the first light blue cyan bar right after a yellow bar. I think the answer is within this script that was posted in this thread. I just don't know how to play with the numbers to obtain the first cyan light blue bar after a yellow bar? input price = CLOSE; input length = 20; input nK = 1.5; input nBB = 2.0; input alertLine = 1.0; def histogram = TTM_Squeeze(price, length, nK, nBB, alertLine).Histogram; def cyanBar = histogram > histogram[1] and histogram > 0; plot signal = cyanBar and Highest(cyanBar[1], 3) < 1;
( at October 20, 2021 9:32 pm)
This statement is for the cyan bar without any other conditions: def cyanBar = histogram > histogram[1] and histogram > 0; So use that as your scan signal and remove the last line from the code in my solution above.
( at October 21, 2021 7:36 am)
I removed the last line as you suggested and it is throwing a message "at least one plot should be defined". sorry for the basic questions, I am a newbie to this.
( at October 28, 2021 3:41 pm)
There were two steps in my instructions. The first one is what you missed: "def cyanBar = histogram > histogram[1] and histogram > 0; use that as your scan signal" This means that you add a new line: "plot scan = cyanBar;"
( at October 28, 2021 4:26 pm)
I have added the ”plot scan = cyanBar,” (with and without the comma) and I get invalid statement. it recognizes the word plot, but not scan or signal. but when adding the entire line plot signal = cyanBar and Highest(cyanBar[1], 3) < 1; it lights up and accepts it.
( at October 29, 2021 6:01 am)
Ok, After using a semi-colon after ”plot scan = cyanBar”, line was accepted. However, I do see it provides a list of tickers with a cyanBar, but I was looking for the first cyanBar right after a yellow bar. how can I accomplish that? I owe you coffee by the way. working on that as well.
( at October 29, 2021 6:43 am)
Sorry but I cannot provide a custom solution to every possible combination of colors for TTM_Squeeze histogram. I have already provided over a dozen solutions for various color combinations. At some point we need to draw the line and this is it. The following post shows a solution for first cyan after three bars of any color: https://www.hahn-tech.com/ans/ttm_squeeze-first-cyan-bar-after-three-bars-of-any-other-color/ That's the best we can provide at this point because it's impossible to provide an individual solution for every possible combinations of colors. I suggest you learn from the examples already provided or learn to use the Condition Wizard to build this using nothing more than a few clicks of the mouse.
( at October 29, 2021 8:07 am)
no worries Pete, you have guided me to the right direction. Thank you sir! Once I figure it out, I will post my solution for others to use.
( at October 29, 2021 8:19 am)