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
 
G

GetRichOrDieTrying

Member
@pk1729 Does anyone know how to create custom thinkscript when the TTM Squeeze dots turn from Red to Green?

I've tried to do this with the Conditional Wizard, but I can't figure it out and TOS Support said it's not possible through the condition wizard.

Please help! I've been trying to figure this out for 6 months!
 
Z

Zep

New member
VIP
@pk1729 do you know what the code would be to create a scan to show when there are the first 3 consecutive red bars? Looking a little earlier. Any help is greatly appreciated!
 
rad14733

rad14733

Well-known member
VIP
@pk1729 do you know what the code would be to create a scan to show when there are the first 3 consecutive red bars? Looking a little earlier. Any help is greatly appreciated!
In reality you don't look for red bars, you look for bars that close lower than previous bars... Color is moot... Something like the following is the logic to check for three lower closing bars...

Ruby:
def threeDown = close < close[1] and close[1] < close[2] and close[2] < close[3];
 

Similar threads

Top