TTM squeeze before breakout scan


Category:
0
0

HI! today i realized a TTM squeeze scan i was using was alerting me when the move had already occurred, especially when TOS seems to have about a 3 min delay. Because of this, i’m trying to make a scanner that would let me know the squeeze is starting, before the move occurs. to increase the chances on predicting in which direction price will go when it comes out the squeeze, i would like for the C wave to be above the zero line (added the code for that) and to be cyan in color(don’t know how to do this) when it is picked up on scanners rather than blue.

extra: can I also add a line or 2 of code for bullish A and B waves when i want more specific results in scan? i dont know if its necessary. i plan on using this scan for 5 min charts.

here’s what i have so far:

def MidLine = -50;
def BolKet = BollingerBands().”Upperband” < keltnerChannels().”Upperband”;
#def Will50 = WilliamsPercentR() >-50;
#input fastLength = 12;
#input slowLength = 26;
#input MACDLength = 9;
#input averageType = AverageType.EXPONENTIAL;

#def Value = MovingAverage(averageType, close, fastLength) – MovingAverage(averageType, close, slowLength);
#def Avg = MovingAverage(averageType, Value, MACDLength);

#def Diff = Value – Avg;
#def ZeroLine = 0;

#def d = (BolKet && Will50) && (Value >= 0);

#plot out = d && d[1]
#or d[1] && d[2]

#—————-
input price = CLOSE;
input length = 20;
input nK = 1.5;
input nBB = 2.0;
input alertLine = 1.0;
def squeezeDots = TTM_Squeeze(price, length, nK, nBB, alertLine).SqueezeAlert;

def alertCount = if squeezeDots[1] == 1 and squeezeDots == 0 then 1 else if squeezeDots == 0 then alertCount[1] + 1 else 0;

def redrange = alertCount > 0 and alertCount < 4;
#—————-

def cWaveUpper = TTM_Wave().Wave2High;
def cWaveLower = TTM_Wave().Wave2Low;
def awaveupper = TTM_Wave().Wave1>2;

def upperWaveGreaterThan = cWaveUpper > 2;

def lowerWaveLessThan = cWaveLower < 2;

plot scan= bolket and upperWaveGreaterThan and redrange ;

Marked as spam
Posted by (Questions: 6, Answers: 8)
Asked on January 24, 2017 12:32 am
2938 views
0
Private answer

Oh, i probably should ask before i forget, is making a squeeze scan that picks up change from red dots to green dots possible?

Marked as spam
Posted by (Questions: 6, Answers: 8)
Answered on January 24, 2017 12:44 am
0

Yes, we have covered this in a previous post. Be sure to make use of the search box. As this forum content expands that search box will become an evermore valuable tool for your research.

( at January 24, 2017 8:42 am)
0
Private answer

It’s great that you posted your code. Thank you. It really helps me understand what our viewers are trying to put together. It also helps me understand what to focus on during my instruction.

Ok, we need to clarify some things.

After this calcification you are going to want to go back to the charts and re-evaluate how you are trying to combine these indicators for your signals. We have covered these topics in previous posts. I suggest you use the search box and read up on these topics before putting any more time into this.

C Wave:

The C Wave is made up of two separate lines. The position of the C Wave above or below zero lines has absolutely nothing to do with the direction of the stock. (I know, shocking but true). The C Wave can be BOTH above and below zero line at the same time. The C Wave merely measure expansion and contraction. In this way the C Wave behaves very much like the ADX line (strength of trend but not direction).

Your method for defining the squeeze dots:

More specifically, the way you define the variable “bolket”, is not the squeeze dots. It’s close, but not exact. But perhaps you had another purpose for this “bolket” variable because this code already has a variable with accurate squeeze dots.

C Wave change to Cyan:

You mention this and state you don’t know how to do this. Please use the search box and read up on this topic. It has already been covered in detail.

B Wave:

The B Wave is not available in Thinkorswim. We only have access to the A and the C wave.

Hope it helps.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on January 24, 2017 8:40 am