Three days tight based on average range

esti0000

New member
In a recent interview with Richard Molgen Pradeep Bonde talked about how he likes to scan for three consecutive consolidation days. I was wondering if anyone has build a custom scan to be able to do this?


I was thinking one way to do this might be to ask TOS to look for three consecutive days with the high/low range was a percentage of the stocks Average Daily Range (ADR).

For example: scan for stocks with three consecutive days where the range was less then 70% of the ADR on all three days. I have some script for how to calculate the ADR which is below but I am not sure how to write the rest of the script.

I would appreciate any assistance

Code:
#Calculate ADR Perc for last 20 days

input len = 20;

def ADR_perc = 100 * (Average(high, len) / Average(low, len) -1);
 
Hello,

I am trying to create a scan to look for a stock that has three consecutive days where the Daily True Range (DTR) is less then the Average True Range (ATR) for the last 20 days. I know how to define the ATR and the DTR for a day, but not sure how to convert this into a scan and to have it look at the last three days.

Code:
input AtrAvgLength = 20;

def ATR = WildersAverage(TrueRange(high(period = aggregationPeriod.DAY), close(period = aggregationPeriod.DAY), low(period = aggregationPeriod.DAY)), AtrAvgLength);

def TodayHigh = Highest(high(period = aggregationPeriod.DAY), 1);
def TodayLow = Lowest(low(period = aggregationPeriod.DAY), 1);

def DTR = TodayHigh - TodayLow;
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

@esti0000 Something like the following perhaps...

Ruby:
def sqz3 = DTR < ATR and DTR[1] < ATR[1] and DTR[2] < ATR[2];
Thanks when I put all this code together it wont let me hit ok is there something I am missing to complete the code? Sorry if this is really basic.

Code:
input AtrAvgLength = 20;

def ATR = WildersAverage(TrueRange(high(period = aggregationPeriod.DAY), close(period = aggregationPeriod.DAY), low(period = aggregationPeriod.DAY)), AtrAvgLength);

def TodayHigh = Highest(high(period = aggregationPeriod.DAY), 1);
def TodayLow = Lowest(low(period = aggregationPeriod.DAY), 1);

def DTR = TodayHigh - TodayLow;

def sqz3 = DTR < ATR and DTR[1] < ATR[1] and DTR[2] < ATR[2];
 
In a recent interview with Richard Molgen Pradeep Bonde talked about how he likes to scan for three consecutive consolidation days. I was wondering if anyone has build a custom scan to be able to do this?


I was thinking one way to do this might be to ask TOS to look for three consecutive days with the high/low range was a percentage of the stocks Average Daily Range (ADR).

For example: scan for stocks with three consecutive days where the range was less then 70% of the ADR on all three days. I have some script for how to calculate the ADR which is below but I am not sure how to write the rest of the script.

I would appreciate any assistance

Code:
#Calculate ADR Perc for last 20 days

input len = 20;

def ADR_perc = 100 * (Average(high, len) / Average(low, len) -1);
I as well as others have been and had been in stockbee community for long time. Study intense learn to trade the right way community,.....there are many scans and ideas shared, join.
 
You could also use the TTM_Squeeze study and set it for 3d.

In a recent interview with Richard Molgen Pradeep Bonde talked about how he likes to scan for three consecutive consolidation days. I was wondering if anyone has build a custom scan to be able to do this?


I was thinking one way to do this might be to ask TOS to look for three consecutive days with the high/low range was a percentage of the stocks Average Daily Range (ADR).

For example: scan for stocks with three consecutive days where the range was less then 70% of the ADR on all three days. I have some script for how to calculate the ADR which is below but I am not sure how to write the rest of the script.

I would appreciate any assistance

Code:
#Calculate ADR Perc for last 20 days

input len = 20;

def ADR_perc = 100 * (Average(high, len) / Average(low, len) -1);
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
183 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

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?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top