♥ 0 |
Hello, I currently have a pre-market gap scanner I feel that is inefficient; it’s not pulling enough stock that are down about 2.0% or more in pre-market. Is there a way I can refactor this pre-market gap scanner code to make it more efficient and accurate? 1. Stocks from $3 ~ $500 3. In 3 min aggregation Any help will greatly be appreciated.
Marked as spam
|
Private answer
Rather than trying to make this code work, I suggest you take a look at the several other posts on this topic and try them. https://www.hahn-tech.com/ans/after-hours-gap-scanner/ https://www.hahn-tech.com/ans/barchart-style-gap-upgap-down-tos-scan/ https://www.hahn-tech.com/ans/scan-gap-within-last-week/ https://www.hahn-tech.com/ans/gap-to-previous-day-close-scan/ Marked as spam
|
|||||||||||||||||
Private answer
Based on feedback from Lucius on each of the 4 gap scanners I listed in my original answer I have additional details to provide. From your comments it seems the After Hours Gap Scanner fits your needs the best: https://www.hahn-tech.com/ans/after-hours-gap-scanner/ You indicated that you needed help converting that code to search for gaps down instead of gaps up. (I only had to adjust the percent_change and flip the greater than to less than). There is no “recommended aggregation period,” experiment and use whatever works best for you. Here is the code from that post, with my adjustments applied to the author’s original. I have also included the conversion to search for gaps down.
Marked as spam
|
Please log in to post questions.
Lucius submitted his response as a new answer instead of a comment. I am including the contents of his response here. In his original response he included code from each of the four posts I listed in my answer. The code is being omitted here so his response will fit within the limits of the comment field. I have also broken up the response into four sections, one for each of the links he is commenting on.
Thank you so much for your response Pete.
I attempted to reply as a comment but my response was cut off.
I normally trade stocks intraday with 1min and 5min charts and am usually up early hours of pre-market looking for stocks that have gapped down by at least 2% from previous day’s close.
I have looked at those before but were able to produce the desired results.
Please see my comments below.
1 – After Hours Gap Scanner – [https://www.hahn-tech.com/ans/after-hours-gap-scanner/]
This one seems promising.
It appears to only return results for stocks that are gapping up.
How can I include a percentage variable to only show stocks that has gapped down in pre-market by 2%?
What would be the recommended aggregation for this?
2 – Barchart Style Gap Up/Gap Down TOS Scan [https://www.hahn-tech.com/ans/barchart-style-gap-upgap-down-tos-scan/]
The following was stated in that thread:
“This single line of code will compute the difference between today’s close and yesterday’s close, when applied to a daily time frame.”
I an seeking to produce results where the current pre-market price has gapped down by 2% from yesterday’s close.
3 – Scan for gap down within the last week [https://www.hahn-tech.com/ans/scan-gap-within-last-week/]
This is returning undesired results.
It’s returning stocks such as the following near or above yesterday’s close as of 4/10/2018 – 8:50 AM
$YNDX
$MBT
$ACAD
I’ve even went as far as modifying the variable to:
input price2 = close;
Similar undesired results returned.
4 – Gap to Previous day close scan [https://www.hahn-tech.com/ans/gap-to-previous-day-close-scan/]
This may be a bit too much for what I am seeking and am having difficulty understanding what it’s producing:
Any help will greatly be appreciated.
Thank you