Custom Watchlist on TTM Squeeze based on color change from Red to Yellow

S

Samrock

New member
I use the TTM Squeeze a lot. Can someone make an custom scan to create a watchlist that tells me which stocks with TTM squeeze just turned Red to Yellow within a day and drop off from the watchlist when TTM squeeze turns from light blue to Dark Blue losing momentum.
 
P

pk1729

Member
VIP
Following code has 4 different scans including 2 you need. Play with all 4 and figure out what you need. Have fun!

Code:
declare lower;

input price = CLOSE;
input length = 20;
input nK = 1.5;
input nBB = 2.0;
input alertLine = 1.0;

plot scan;

def squeezeHistogram = TTM_Squeeze(price, length, nK, nBB, alertLine).Histogram;


def momentumPivotLow = (squeezeHistogram > squeezeHistogram[1] and squeezeHistogram[1] < squeezeHistogram[2]) ;

def momentumPivotHigh = (squeezeHistogram < squeezeHistogram[1] and squeezeHistogram[1] > squeezeHistogram[2]);

#plot barsSincePivot = GetMaxValueOffset(momentumPivot);

def pivotLowFollowThrough = (momentumPivotLow[1] and squeezeHistogram > squeezeHistogram[1]);

def pivotHighFollowThrough = (momentumPivotHigh[1] and squeezeHistogram < squeezeHistogram[1]);

def zeroLinePositiveFollowThrough = ( squeezeHistogram > 0 and squeezeHistogram[1] > 0 and squeezeHistogram[2] < 0 ) ;

def zeroLineNegativeFollowThrough = (squeezeHistogram < 0 and squeezeHistogram[1] < 0 and squeezeHistogram[2] > 0);

# uncomment one to scan for pivot high/low with follow through bar
#scan = pivotHighFollowThrough;
scan = pivotLowFollowThrough;

# uncomment one to scan for zero line positive/negative with follow through bar
#scan = zeroLinePositiveFollowThrough;
#scan = zeroLineNegativeFollowThrough;
 
S

Samrock

New member
@pk1729 I have something like this, I need a query for the scan the exactly when the Red becomes Yellow so that I can have in my watchlist and create alerts when new stocks gets added and removed.
 
P

pk1729

Member
VIP
You can add this as a custom study in the scan and use it. That's how I do it too
 

Similar threads

Top