# Scan using StochaticsSlow

#### cat4scotty

##### New member
Using the StochasticsSlow Study (with the overbought set at 75 and the oversold set at 25), I would like to write a Scan to search for stocks that have been below the oversold line (25%) for a certain number of bars (e.g. >20) and are currently breaking through above the 25%. Thanks..

Last edited:
Solution
This may sound odd, given that we're on this site, but I don't actually use any indicators, at least not in the traditional sense. I am not sure if you need the K or D plot, or if the parameters in the referenced study are needed. However, something like this should probably suffice?

Ruby:
``````def Slow = reference StochasticSlow().SlowK;
def Count = if Slow < 25 then Count[1] + 1 else 0;
plot Result = if Slow > 25 and Count[1] > 20 then yes else no;``````

In stock hacker, you would want "Result" to be True.
@cat4scotty Where did you run into problems? It sounds like you are on the right path and have all the parts.
Chose your study, select SlowK or whatever plot you want, choose: is less than in middle column, choose value 25 in right column. Down at the bottom of the box choose: within 20 bars
If you run into problems. Make sure that you post a screen image of the error or issue.
Need more help:

This may sound odd, given that we're on this site, but I don't actually use any indicators, at least not in the traditional sense. I am not sure if you need the K or D plot, or if the parameters in the referenced study are needed. However, something like this should probably suffice?

Ruby:
``````def Slow = reference StochasticSlow().SlowK;
def Count = if Slow < 25 then Count[1] + 1 else 0;
plot Result = if Slow > 25 and Count[1] > 20 then yes else no;``````

In stock hacker, you would want "Result" to be True.

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