Scan for stocks making new 52 low within last month


Category:
0
0

Hello Peter,

Thanks for all your help. I want to make 2 scans that give me:

1. 52 weeks lowest price of a stock price in the last month.

2. 252 days lowest price od a stock in the last month.

I hope I am clear. Thanks

Marked as spam
Posted by (Questions: 13, Answers: 10)
Asked on May 6, 2020 8:12 am
99 views
What you have requested is not a scan. A scan produces a list of stocks that meet the filter criteria you apply. A scan can never return a list of values. You are requesting a list of values, 52 week low. But perhaps I did not understand you clearly. Perhaps you are actually asking for a list of stocks that have made 52 week lows within the past month?
( at May 6, 2020 11:09 am)
Exact, i am looking for stocks on a daily and weekly that hit their 52 week or 252 days lowest value. Thanks
( at May 6, 2020 1:28 pm)
0
Private answer

After getting some clarification on this request in the comment section above I have updated the title of the question to reflect the context of the request. Which is to find all stocks that have made their 52 week low within the past month.

There is no need to create two scans to accomplish this. The most accurate method is to use the daily time frame. There are an average of 251 trading days in any given year. So we run the scan on the daily time frame and for the 52 week low we look back 251 bars. There are 21 trading days in the average month so we look back 21 bars to determine if the 52 week low occurred in the last month.

Here is the code to run this scan:

input longTermBars = 251;
input shortTermBars = 21;
def lowestInLongTermBars = Lowest(low[shortTermBars], longTermBars);
def targetLow = LowestAll(lowestInLongTermBars);
plot scan = Lowest(low, shortTermBars) == targetLow;

 

Marked as spam
Posted by (Questions: 37, Answers: 3223)
Answered on May 6, 2020 4:11 pm
Hello Peter, The script above is about 52low what about scrit for 52week high in a month?
( at May 26, 2020 1:15 am)
Every place in the code you find the word "low", change that to "high". Lowest becomes Highest and low becomes high.
( at May 26, 2020 8:03 am)
hello Peter, this is what I did but it is getting me to stocks for 52week high in a month. input longTermBars = 251; input shortTermBars = 5; def highestInLongTermBars = highest(high[shortTermBars], longTermBars); def targetLow = highestAll(highestInLongTermBars); plot scan = highest(high, shortTermBars) == targetLow;
( at June 2, 2020 7:11 pm)
Quote: "...this is what I did but it is getting me to stocks for 52week high in a month..." So you are telling me it is producing the results you requested? You asked for the 52 week high in a month and this is exactly what you are getting?
( at June 2, 2020 9:41 pm)