#### zeek

##### Active member
2019 Donor
I am interested to build a scan to find stocks with the biggest intraday price range over x amount of days lookback, for example last 30days.

Is this possible to code as a scan condition somehow?

Solution
this is a label I made and use. 14 day average true range and how much it's moved for the day. When under 60% the label is green, above 90 it's grey, else orange.
Code:
``````declare upper;

defineGlobalColor("ATR Low", color.green);
defineGlobalColor("ATR Mid", color.orange);
defineGlobalColor("ATR High", color.gray);

input ATRLength = 14;
input DRLow = 60;
input DRMid = 90;
def averagetype = AverageType.WILDERS;
def BasePeriod = AggregationPeriod.DAY;

def ATR = MovingAverage (averagetype, TrueRange(high(period = BasePeriod)[1], close(period = BasePeriod)[1], low(period = BasePeriod)[1]), ATRLength);

def Today_High = Highest(high(period = baseperiod)[0], 1);
def Today_Low = Lowest(low(period =baseperiod)[0], 1);

def DR = Today_High -...``````
are you just wanting the average true ranges? Like AMZN moves 95.3 pts a day on average over the last 14 days, GOOGL is 66.04, TSLA 73.13. That type of info?

I am looking for stocks that typically move more than 5% per day based on a 30day average and the daily average volume should be at least 1million shares traded.

So a combination of average day range & average daily volume based on last 30days.

are you just wanting the average true ranges? Like AMZN moves 95.3 pts a day on average over the last 14 days, GOOGL is 66.04, TSLA 73.13. That type of info?
RyteSyde - I am looking for the exact info you describe. Any suggestions?

this is a label I made and use. 14 day average true range and how much it's moved for the day. When under 60% the label is green, above 90 it's grey, else orange.
Code:
``````declare upper;

defineGlobalColor("ATR Low", color.green);
defineGlobalColor("ATR Mid", color.orange);
defineGlobalColor("ATR High", color.gray);

input ATRLength = 14;
input DRLow = 60;
input DRMid = 90;
def averagetype = AverageType.WILDERS;
def BasePeriod = AggregationPeriod.DAY;

def ATR = MovingAverage (averagetype, TrueRange(high(period = BasePeriod)[1], close(period = BasePeriod)[1], low(period = BasePeriod)[1]), ATRLength);

def Today_High = Highest(high(period = baseperiod)[0], 1);
def Today_Low = Lowest(low(period =baseperiod)[0], 1);

def DR = Today_High - Today_Low;
def DRP = Round((DR/ATR)*100,2);

AddLabel(yes, "ATR: \$" + round(ATR,2) + " • T: \$" + Round(DR , 2) + " (" + DRP +"%)",  if DRP < DRLow then GlobalColor("ATR Low") else if DRP > DRMid then GlobalColor("ATR High") else GlobalColor("ATR Mid"));``````

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