Complex TTM_Squeeze Indicator

stcrim

New member
Has anyone written a TTM_Squeeze indicator that does the following?
1. Looks for at least 5 red dots in a row or 5 red dots and at least 1 green dot
2, Only show stocks that that have the histogram in cyan or yellow to cyan in time frames daily, 4 hour, 2 hour, 1 hour and weekly optional
3. They all have EMAs aligned: 8 > 21 and 21 > 34 and 34 > 55 and 55 > 89 in the above time frames including weekly.

Thinking about the regular TTM_Squeeze not the pro.

Seems like there would be a lot of potential with just those three things. In the back of my hear it seems like adding the ADX to get a feel for the trend might be useful but the jury is out on that part.
 
Solution
Has anyone written a TTM_Squeeze indicator that does the following?
1. Looks for at least 5 red dots in a row or 5 red dots and at least 1 green dot
2, Only show stocks that that have the histogram in cyan or yellow to cyan in time frames daily, 4 hour, 2 hour, 1 hour and weekly optional
3. They all have EMAs aligned: 8 > 21 and 21 > 34 and 34 > 55 and 55 > 89 in the above time frames including weekly.

Thinking about the regular TTM_Squeeze not the pro.

Seems like there would be a lot of potential with just those three things. In the back of my hear it seems like adding the ADX to get a feel for the trend might be useful but the jury is out on that part.

this is something to get you started. it does #1 , looks for 5 red...
Has anyone written a TTM_Squeeze indicator that does the following?
1. Looks for at least 5 red dots in a row or 5 red dots and at least 1 green dot
2, Only show stocks that that have the histogram in cyan or yellow to cyan in time frames daily, 4 hour, 2 hour, 1 hour and weekly optional
3. They all have EMAs aligned: 8 > 21 and 21 > 34 and 34 > 55 and 55 > 89 in the above time frames including weekly.

Thinking about the regular TTM_Squeeze not the pro.

Seems like there would be a lot of potential with just those three things. In the back of my hear it seems like adding the ADX to get a feel for the trend might be useful but the jury is out on that part.

this is something to get you started. it does #1 , looks for 5 red dots and plots a magenta square

Code:
# ttm_points_0

# TTM_Squeeze
declare lower;
def na = double.nan;
input price = CLOSE;
input length = 20;
input nK = 1.5;
input nBB = 2.0;
input alertLine = 1.0;

# TTM_Squeeze
#plot Histogram = Double.NaN;
#plot VolComp = Double.NaN;
#plot SqueezeAlert = Double.NaN;

#----------------------------------

def ttm_histo = TTM_Squeeze(price, length, nk, nbb, alertline).histogram;
def ttm_volcomp = TTM_Squeeze(price, length, nk, nbb, alertline).volcomp;
def ttm_sqz = TTM_Squeeze(price, length, nk, nbb, alertline).SqueezeAlert;


input show_histo = yes;
plot zttm_histo = if isnan(close) then na else ttm_histo;
zttm_histo.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
zttm_histo.AssignValueColor(
     if ttm_histo > 0 and ttm_histo > ttm_histo[1] then color.cyan
else if ttm_histo > 0 and ttm_histo < ttm_histo[1] then color.blue
else if ttm_histo < 0 and ttm_histo > ttm_histo[1] then color.yellow
else if ttm_histo < 0 and ttm_histo < ttm_histo[1] then color.red
else color.gray);
zttm_histo.setlineweight(3);
zttm_histo.SetHiding(!show_histo);


def offpt = 5;
input offset_points = yes;
def pt = if !offset_points then 0
else if ttm_histo > 0 then -offpt
else if ttm_histo < 0 then offpt
else 0;

input show_sqz_points = yes;
plot zsqz = if isnan(close) then na else pt;
zsqz.SetPaintingStrategy(PaintingStrategy.POINTS);
zsqz.AssignValueColor(if ttm_sqz then color.green else color.red);
zsqz.setlineweight(3);
zsqz.SetHiding(!show_sqz_points);


#input show_volcomp = no;
#plot zvol = if isnan(close) then na else ttm_volcomp;
#zvol.SetDefaultColor(Color.yellow);
#zvol.SetHiding(!show_volcomp);


input min_red_dots = 5;
def redx = (sum(ttm_sqz, min_red_dots) == 0 );

#def v2 = 0.2;
#plot zsqz2 = if redx and  ttm_histo > 0 then ttm_histo*(1+v2)
#else if redx and ttm_histo < 0 then ttm_histo*(1+v2)
# else na;
#def v2 = 12;
#plot zsqz2 = if redx and  ttm_histo > 0 then -v2
#else if redx and ttm_histo < 0 then v2
#else na;
def v2 = 32;
plot zsqz2 = if redx and  ttm_histo > 0 then ttm_histo+(1+v2)
else if redx and ttm_histo < 0 then ttm_histo-(1+v2)
 else na;

zsqz2.SetPaintingStrategy(PaintingStrategy.SQUARES);
zsqz2.SetDefaultColor(Color.magenta);
zsqz2.setlineweight(4);

addchartbubble(0, low,
ttm_sqz
, color.yellow, no);
#
 
Solution
this is something to get you started. it does #1 , looks for 5 red dots and plots a magenta square

Code:
# ttm_points_0

# TTM_Squeeze
declare lower;
def na = double.nan;
input price = CLOSE;
input length = 20;
input nK = 1.5;
input nBB = 2.0;
input alertLine = 1.0;

# TTM_Squeeze
#plot Histogram = Double.NaN;
#plot VolComp = Double.NaN;
#plot SqueezeAlert = Double.NaN;

#----------------------------------

def ttm_histo = TTM_Squeeze(price, length, nk, nbb, alertline).histogram;
def ttm_volcomp = TTM_Squeeze(price, length, nk, nbb, alertline).volcomp;
def ttm_sqz = TTM_Squeeze(price, length, nk, nbb, alertline).SqueezeAlert;


input show_histo = yes;
plot zttm_histo = if isnan(close) then na else ttm_histo;
zttm_histo.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
zttm_histo.AssignValueColor(
     if ttm_histo > 0 and ttm_histo > ttm_histo[1] then color.cyan
else if ttm_histo > 0 and ttm_histo < ttm_histo[1] then color.blue
else if ttm_histo < 0 and ttm_histo > ttm_histo[1] then color.yellow
else if ttm_histo < 0 and ttm_histo < ttm_histo[1] then color.red
else color.gray);
zttm_histo.setlineweight(3);
zttm_histo.SetHiding(!show_histo);


def offpt = 5;
input offset_points = yes;
def pt = if !offset_points then 0
else if ttm_histo > 0 then -offpt
else if ttm_histo < 0 then offpt
else 0;

input show_sqz_points = yes;
plot zsqz = if isnan(close) then na else pt;
zsqz.SetPaintingStrategy(PaintingStrategy.POINTS);
zsqz.AssignValueColor(if ttm_sqz then color.green else color.red);
zsqz.setlineweight(3);
zsqz.SetHiding(!show_sqz_points);


#input show_volcomp = no;
#plot zvol = if isnan(close) then na else ttm_volcomp;
#zvol.SetDefaultColor(Color.yellow);
#zvol.SetHiding(!show_volcomp);


input min_red_dots = 5;
def redx = (sum(ttm_sqz, min_red_dots) == 0 );

#def v2 = 0.2;
#plot zsqz2 = if redx and  ttm_histo > 0 then ttm_histo*(1+v2)
#else if redx and ttm_histo < 0 then ttm_histo*(1+v2)
# else na;
#def v2 = 12;
#plot zsqz2 = if redx and  ttm_histo > 0 then -v2
#else if redx and ttm_histo < 0 then v2
#else na;
def v2 = 32;
plot zsqz2 = if redx and  ttm_histo > 0 then ttm_histo+(1+v2)
else if redx and ttm_histo < 0 then ttm_histo-(1+v2)
 else na;

zsqz2.SetPaintingStrategy(PaintingStrategy.SQUARES);
zsqz2.SetDefaultColor(Color.magenta);
zsqz2.setlineweight(4);

addchartbubble(0, low,
ttm_sqz
, color.yellow, no);
#
Thank you! Thank you! I will look forward to installing it and taking a look. -- Steve
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
278 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top