# scan stocks doubled or tripled in last 3 years

#### gaosng

##### New member
How do i ude this following code to scan the stocks satisfy within 3 years period?
I want stocks double or tripled within 3 months in last 3 year period.
This scan works in monthly timeframe, i don't know how to add the lookback period.

Code:
``````def y = (close - Lowest(low,2)) / Lowest(low,2) > 2;

def z = (close - Lowest(low,3)) / Lowest(low,3) > 3;

plot Tripled= if  y or z then yes else no ;``````

Last edited:
Solution
How do i ude this following code to scan the stocks satisfy within 3 years period?
I want stocks double or tripled within 3 months in last 3 year period.
This scan works in monthly timeframe, i don't know how to add the lookback period.

Code:
``````def y = (close - Lowest(low,2)) / Lowest(low,2) > 2;

def z = (close - Lowest(low,3)) / Lowest(low,3) > 3;

plot Tripled= if  y or z then yes else no ;``````

why y has len of 2? you say 3 months.
just compare to the min #, no need to compare to 3. (300%)
just do percent formule once and compare the smallest desired percent.

Code:
``````# month
def per = (close - Lowest(low,3)) / Lowest(low,3) > 2;
plot last3yrs = sum(per, 36) > 0;``````
How do i ude this following code to scan the stocks satisfy within 3 years period?
I want stocks double or tripled within 3 months in last 3 year period.
This scan works in monthly timeframe, i don't know how to add the lookback period.

Code:
``````def y = (close - Lowest(low,2)) / Lowest(low,2) > 2;

def z = (close - Lowest(low,3)) / Lowest(low,3) > 3;

plot Tripled= if  y or z then yes else no ;``````

why y has len of 2? you say 3 months.
just compare to the min #, no need to compare to 3. (300%)
just do percent formule once and compare the smallest desired percent.

Code:
``````# month
def per = (close - Lowest(low,3)) / Lowest(low,3) > 2;
plot last3yrs = sum(per, 36) > 0;``````

87k+ Posts
307 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?