# Help create a daily range indicator?

#### cnotink

##### New member
Hello, I am a nubee and wanting to learn more about scripting in TOS. Just for a starter I am looking for a daily range indicator like the subject above.

Also, are there any classes out there for scripting in TOS?

absolute daily range % is a min of "x" over period of "y" or date range of "dateA - dateB"

Thank you,
Scott

Last edited by a moderator:

#### inthefutures

##### Active member
I will help you out a little, will teach you to fish, not give you a fish.
so you are looking at a atr, or a % of the average range of the last x days

#### cnotink

##### New member
Thank you for the reply. I don't think I am looking at average, but more first finding the daily range (absolute so it could be up or down). Then I would like to find stocks, say over the past 20 trading days, that have a minimum of of say 5% absolute daily range. This give me an indication of volatility opportunity.

so high - low?

#### cnotink

##### New member
If I were to look at the average, it would account for the recent volatility which I would be concerned that it would skew the results.

#### cnotink

##### New member
yes |high - low| for the day > 5%
and must occur in the last 20 day periods

5% of what?

#### cnotink

##### New member
I mean must occur in all the past 20 days

#### inthefutures

##### Active member
so an average of range of last 20 day and current candle is under or over 5% of that range?

#### cnotink

##### New member
abs value of (High - low)/low > 5%

#### inthefutures

##### Active member
input back = 20;
def bottom = Lowest(low[1], length);
def top = Highest(high[1], length);
plot value = AbsValue(top - bottom)/bottom > .05;

#### cnotink

##### New member
Thank you very much inthefutures. I appreciate your help!!

## 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?