AlfyParticipant
Average
Good morning guys, i wonder if anyone can help me. Im trying to screen for the TTM squeeze simultaneously on the weekly and daily time frames. Is this possible? Ive attached the basic weekly code below if someone can help fix it so that it does the same on the daily time frame.
Best regards
TIMEFRAME (WEEKLY)
basis = average[21](close)
dev = 2 * Std[21](close)
upperBB = basis + dev
lowerBB = basis - dev
//KC
ma = average[21](close)
myrange = averagetruerange[14]
upperKC = ma+myrange * 1.5
lowerKC = ma-myrange * 1.5
signal=(lowerBB>lowerKC) AND (upperBB<upperKC)
SCREENER[SIGNAL]
Hello,
maybe it will help.
TFS shows from which time frame the signal comes. 1 = Day, 2 Week.
Regards
Rainer
Timeframe(Weekly)
basis = average[21](close)
dev = 2 * Std[21](close)
upperBB = basis + dev
lowerBB = basis - dev
//KC
ma = average[21](close)
myrange = averagetruerange[14]
upperKC = ma+myrange * 1.5
lowerKC = ma-myrange * 1.5
signalW=(lowerBB>lowerKC) AND (upperBB<upperKC)
If signalW Then
TFS = 2
EndIf
//******************************************************************************************
TIMEFRAME (1 Day)
basis = average[21](close)
dev = 2 * Std[21](close)
upperBB = basis + dev
lowerBB = basis - dev
//KC
ma = average[21](close)
myrange = averagetruerange[14]
upperKC = ma+myrange * 1.5
lowerKC = ma-myrange * 1.5
signald=(lowerBB>lowerKC) AND (upperBB<upperKC)
If signald Then
TFS = 1
EndIf
//******************************************************************************************
SCREENER[SIGNALW OR SIGNALD](TFS AS "TimeFrame-Signal")
AlfyParticipant
Average
Thanks Rainer, could you tell me how to change the code so that it screens for only when the condition applies on the weekly and the daily rather than either/or??
Thank you for your help
AlfyParticipant
Average
Dont worry Rainer, done it…thanks so much for your help. Working perfectly!
Hello,
I am very happy to have helped, nothing to thank. Good luck.
Best Regards
Rainer