Scanning (criteria) within (x) days


Category:
0
0

Hello Hahn, I am trying to scan for stocks that had a 5% gain and had 200,000 volume on the same day. However, I need to scan for all the stocks that had a 5% on one day and 200,000 volume on that day for the past 3 days. I am having trouble making the scan for the “within 3 days” part of the scan. Overall, I need to scan for all the stocks that had a 5% on one day and 200,000 volume on that day today, yesterday, and 2 days ago. Thanks so much!

Marked as spam
Posted by (Questions: 34, Answers: 56)
Asked on July 20, 2017 3:58 pm
93 views
0

So you want to scan for stocks that traded 200,000 shares or more for three consecutive days. And from that list you want to find only the stocks that trade 5% higher on the current day. Is that right? And when you say 5% higher, are you comparing prior day close to current day close? Or prior day close to current day high? Or some other method?

( at July 20, 2017 10:32 pm)
0

When I say 5% I mean from today’s close to yesterday’s close. You are misunderstanding what I’m trying to say, I apologize for the confusion. I am trying to scan for stocks that had a 5% gain and had 200,000 volume for one day.

Pretend we ran a scan like this for three days (Monday, Tuesday, and Wednesday:
Minimum gain: 5%
Minimum volume: 200,000

(These are example results)
Monday scan results:
AAPL
MSFT
BAC
Tuesday scan results:
T
MCD
Wednesday scan results:
SBUX
GE

Now what I need is a scan that scans for stocks that had a day where they had a 5% gain and 200,000 within a three day period. I don’t care whether they had a 5% gain with 200,000 volume on Monday, Tuesday or Wednesday. So if we were to run a scan from the test scan results from above it would look like this:
AAPL
MSFT
BAC
T
MCD
SBUX
GE

( at July 21, 2017 6:17 am)
0
Private answer

Ah, ok. I understand now. Thanks for those additional details for clarification. This code should do the trick. I tested it and today it only returns one results for stocks greater than $10 per share. I reduced the percent from 5.0 down to 2.0 and got a handful of results.


def volumeCondition = volume >= 200000;
def closeToCloseGain = ((close - close[1]) / close[1]) * 100;
def signal = volumeCondition and closeToCloseGain >= 5.0;
plot scan = Lowest(signal, 3) > 0;

Marked as spam
Posted by (Questions: 37, Answers: 4086)
Answered on July 21, 2017 8:12 am
0
Pete, I have a question about this scan. Will the results be at least 5% each day for the past 3 days? I think this will work for me. I am looking for this but i just want over the past 3 days, any tickers that are up 100% overall. They could be 5% on day 1, 60% on day 2 and 35% on day 3. Any combination. Just overall up 100% from the past 3 days. Would this scan do the trick?
( at June 24, 2020 5:17 pm)
0
"Will the results be at least 5% each day for the past 3 days?" Yes.
( at June 24, 2020 7:08 pm)
0
Yes a min of 5 can be used. Thank you.
( at June 25, 2020 4:58 am)