Squeeze Play Strategy For ThinkOrSwim
Hi All -
My first attempt at Thinkscript - feedback very much welcomed. This very basic indicator is based on four criteria laid out by Tylor Horton of Focused Trades (now with Simpler Trading folks) that he uses for his method of trading squeeze setups. This provides a bright green label that will show up on the top of the chart when the ticker has met the following conditions:
1) is momentum > 0 and on an upward trend on the TTM_Squeeze() histogram?
2) Has the price closed over the 21 EMA?
3) Are EMAs (8,21,34,55 and 89) stacked in acsending order ("The Royal Setup")?
4) Is this ticker in a TTM_squeeze (true if squeezealert has not fired)?
TS can be access here: http://tos.mx/0fhkJir
Also available as a Github Gist
Hi All -
My first attempt at Thinkscript - feedback very much welcomed. This very basic indicator is based on four criteria laid out by Tylor Horton of Focused Trades (now with Simpler Trading folks) that he uses for his method of trading squeeze setups. This provides a bright green label that will show up on the top of the chart when the ticker has met the following conditions:
1) is momentum > 0 and on an upward trend on the TTM_Squeeze() histogram?
2) Has the price closed over the 21 EMA?
3) Are EMAs (8,21,34,55 and 89) stacked in acsending order ("The Royal Setup")?
4) Is this ticker in a TTM_squeeze (true if squeezealert has not fired)?
Code:
#Squeeze Play Strategy For ThinkOrSwim
#@Gavstah 10/2021
#Hint: SqueezePlay - stacked EMAs (8,21,34,55,89), Upward momentum on TTM_Squeeze, in a squeeze, and price over the 21 EMA
input price = close;
# define the EMAs
def ema8 = ExpAverage(price, 8);
def ema21 = ExpAverage(price, 21);
def ema34 = ExpAverage(price, 34);
def ema55 = ExpAverage(price, 55);
def ema89 = ExpAverage(price, 89);
# plot the EMAs
plot EMA8_ = ExpAverage(price, 8);
plot EMA21_ = ExpAverage(price, 21);
plot EMA34_ = ExpAverage (price, 34);
plot EMA55_ = ExpAverage (price, 55);
plot EMA89_ = ExpAverage (price, 89);
# is the price in the buy zone?
def buyZone = price < EMA8 AND price > EMA21;
# now, let's see what we have
# 1) is momentum > 0 and on an upward trend on then TTM_Squeeze() histogram?
def bullMomentum = TTM_Squeeze().Histogram > 0 && TTM_Squeeze().Histogram > TTM_Squeeze().Histogram[1];
# 2) Has the price closed over the 21 EMA?
def closeOver21 = price > EMA21_;
# 3) Are EMAs stacked in acsending order ("The Royal Setup")?
def stackedEMAS = EMA8_ > EMA21_ AND EMA21_ > EMA34_ AND EMA34 > EMA55_ AND EMA55_ > EMA89;
# 4) are we in a TTM_squeeze (true if squeezealert has not fired)?
def squeeze = !TTM_Squeeze().SqueezeAlert;
# do we have a squeeze play?
def squeezePlay = squeeze && stackedEMAS && bullMomentum && closeOver21;
# set the stacked label
AddLabel(price, ”Stacked EMAs” , (if stackedEMAS then Color.GREEN else Color.RED));
# set Squeeze Play label if we're in a squeeze play.
AddLabel(if squeezePlay then yes else no, " Squeeze Play ", Color.GREEN);
# Add buy zone label if we're in the buy zone
AddLabel(if buyZone then yes else no, "BUY ZONE", Color.GREEN);
TS can be access here: http://tos.mx/0fhkJir
Also available as a Github Gist
Last edited by a moderator: