# Scan For Top Stocks Over The Last 22 Days

#### scottsamesame

##### New member
Does anyone know how to set up a scan that will help me find the stocks which are up the most over the last 22 days.

More specifically, I am trying to find stocks that are up the most over the last 22 days from their lowest point during those 22 days.

Then, if we can scan for the above, can we only show the top 10% of the results?

TY

Solution
Does anyone know how to set up a scan that will help me find the stocks which are up the most over the last 22 days.

More specifically, I am trying to find stocks that are up the most over the last 22 days from their lowest point during those 22 days.

Then, if we can scan for the above, can we only show the top 10% of the results?

TY

'are up the most'
this implies having a collection of numbers ,
comparing all of of them to each other,
and coming up with a smaller set.

can't do that.
a scan looks at 1 stock at a time. it doesn't know about others.

you would have to pick a dollar amount or a percentage, and check if the price change is more than that.

----

set scan to day
if the difference is more than \$3, then true.
Code:
``...``
the scanner returns all of the relevant results that match the criteria.

Any thoughts on how to build the scan?

I am trying to find stocks that are up the most over the last 22 days from their lowest point during those 22 days.

TY

Does anyone know how to set up a scan that will help me find the stocks which are up the most over the last 22 days.

More specifically, I am trying to find stocks that are up the most over the last 22 days from their lowest point during those 22 days.

Then, if we can scan for the above, can we only show the top 10% of the results?

TY

'are up the most'
this implies having a collection of numbers ,
comparing all of of them to each other,
and coming up with a smaller set.

can't do that.
a scan looks at 1 stock at a time. it doesn't know about others.

you would have to pick a dollar amount or a percentage, and check if the price change is more than that.

----

set scan to day
if the difference is more than \$3, then true.
Code:
``````input dollars = 3.0;
def len = 22;
def lo = lowest(low, len);
def diff = close - lo;
plot z = if diff > dollars then 1 else 0;
#``````

Last edited:

87k+ Posts
340 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

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?