TTM_Squeeze first Yellow bar after three Red bars


Category:
0
0

Hi Pete,

You helped me find the first Cyan bar after three bars of any color with the script below. How can it be amended to find the first yellow bar after a minimum of three red bars?

Thank you again!

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: 8, Answers: 18)
Asked on July 28, 2020 11:06 am
413 views
0
Private answer

Update: There is a newer version of this type of scan which enables you to select any number of consecutive bars and any combination of colors. You will find that solution posted here:

https://www.hahn-tech.com/ans/ttm-squeeze-histogram-any-color-change-any-bar-count/

def redBar = histogram < histogram[1] and histogram < 0;
def yellowBar = histogram > histogram[1] and histogram < 0;
plot signal = yellowBar and Lowest(redBar[1], 3) > 0;

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on July 28, 2020 2:39 pm
0
The scan brought up ACB, MAC, KIM, O, CIM, XP. None of these brought up the first yellow bar after three minimum red bars.
( at July 28, 2020 5:40 pm)
0
I have corrected the error in my answer. I was away from my computer most of the day and was just trying to solve this without actually testing it.
( at July 28, 2020 6:37 pm)
0
Thank you so much again Pete!
( at July 28, 2020 10:02 pm)