Plot Vertical Lines On TTM Squeeze


Category:
0
0

I am trying to create a thinkscript that shows vertical lines on the chart when the TTM Squeeze has negative up & positive down bars

And No Vertical Lines When TTM Squeeze Has Positive Up Bars & Negative Down Bars.

I added a picture to help explain.please help! Thank You

Attachments:
Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on September 29, 2022 2:42 pm
104 views
0
Private answer

This is very similar to the last one you requested for the TTM Wave:

https://www.hahn-tech.com/ans/plot-vertical-lines-when-ttm-wave-c-is-contracting/

I will say that I don't see any value in this for the rest of our viewers so this will be the last one of these "vertical line" solutions I provide you. From here on out you will have to learn from these examples and build them yourself.

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 yellowHistogram = histogram < 0 and histogram > histogram[1];
def blueHistogram = histogram > 0 and histogram < histogram[1];
AddVerticalLine(yellowHistogram, "Yellow Squeeze Histogram", Color.YELLOW);
AddVerticalLine(blueHistogram, "Blue Squeeze Histogram", Color.BLUE);

Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on September 29, 2022 3:49 pm
0
okay thank You I appreciate your help! did you try putting these vertical lines on you chart?
( at September 29, 2022 3:56 pm)
0
Yes, I tested this code before I posted the solution.
( at September 29, 2022 3:58 pm)