TTM Squeeze scan not working

rvaidyamath

New member
Here are the screen shots :
standard Code :

Scan Result

1709041274491.png

1709041316884.png
1709041095211.png
 
Here are the screen shots :
standard Code :

Scan Result

View attachment 21186
View attachment 21187View attachment 21185

saying 'it doesn't work' does not help anyone figure out what the issue is.
edit your post and explain.

you posted an image of a list of stocks... so i would think it's working.
what is it doing?
what do you think it should be doing?

although seeing an image of the code is nice if there are errors, we can't use it. i don't know if that code is a built in one or not, you didn't say. always post a text version of your code, in a code window. click on </> in header.
 
Here are the screen shots :
standard Code :

Scan Result

i don't know why your code doesn't 'work' ?

i made a lower study for testing.
it has 2 bubbles. they confirm that the 2 plots are 1 or 0.

a scan reads data on the last bar. maybe the data on last bar is N/A? nope. i turned on extended hours and looked at the last bubble. the last one has a valid color and values. the bubble color is determined by a formula. if there were N/A values, the color would be black.

so, mine and yours look like they should return valid results...?


Code:
# ttm_trend_01
# TD Ameritrade IP Company, Inc. (c) 2010-2024
# Source code isn't available.

declare lower;

#input compBars = 6;
#input paintBars = Yes;
#plot TrendUp = Double.NaN;
#plot TrendDown = Double.NaN;
#AssignPriceColor(Color.CURRENT);

def tup = TTM_Trend().trendup;
def tdwn = TTM_Trend().trenddown;

input choice = {default "Trending up", "trending down"};
def scan;
switch (choice){
case "Trending up":
    scan = tup;
case "trending down":
    scan = tdwn;
}

def isup = choice == choice."Trending up";

plot z = 0;

input test1 = no;
AddChartBubble(test1 and !IsNaN(close), 0,
 tup + "\n" +
 tdwn
, (if tup then Color.GREEN else if tdwn then Color.RED else Color.GRAY), yes);

input test2 = yes;
AddChartBubble(test2 and !IsNaN(close), 0,
 tup + "\n" +
 tdwn + "\n" +
 scan
, (if (isup and tup) then Color.GREEN else if (!isup and tdwn) then Color.RED else Color.GRAY), yes);
#
 

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
363 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