♥ 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
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
|
|||||||||||
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
|
Please log in to post questions.
Pete, thank you so much for providing this. I will test this out and provide feedback.
Awesome. Glad to know you got things working. And thanks so much for the contribution.
As to refining the results further, removing 5-character tickers and hard-to-barrow. The only thing you have to work with are the two filters at the very top of the scan. Next to the word “Scan In:” at the top left.
You can select from a category, a personal watchlist or a public watchlist. In your case, you will need to create a personal watchlist that excludes all the ticker symbols you want to avoid. Then select that as one of the two main filters at the top left.
You never need to include a plus sign for positive numbers. So just a plain 5 will due. If you look carefully at the code, check the last three lines. There is s comment that explains there are two different scan signals. One is commented out, the other is active. Just move the comment mark “#’.
As to the built in version. I was not aware of it. This code is result of of a previous request and most of it was copied from what the viewers posted. As I compare this result to the built in version I find they are very much the same. So the author of that original post must have started out with code from the built in version and tried to modify it.
Are there benefits to using this versus the built in version? Just trying to see what would be most effective. Thanks so much for all of your work. You have a true talent.
Honestly if I had known about the built in version I would have used that one in my response to this post. It is possible it was not there at the time of this post. I usually try to check for built-in solutions before writing code. But I don’t remember this one.
I wonder if they made it off of yours?