Pre-Market Gap Scan w/ custom column


Category:
0
0

I’m looking to create a pre-market gap scan for stocks that have moved +/-4% from the previous day’s closing price.

I would also like to make a custom column that displays the gap value as a percent so I can customize some of the look and feel. I know how to write out the code for the looks and feel but I’m a bit confused on the math for the actual gap%. Any help would be greatly appreciated.

Marked as spam
Posted by (Questions: 4, Answers: 8)
Asked on January 19, 2018 3:11 pm
915 views
0

As of now my work around is running two separate scans using the built in features.
I’d like to get the up and down gappers on one scan to save some screen real estate.

1. AfterHours_Percent_Change the Open has moved greater than 4.0% % in after hours trading. (1m include EXT)
2. AfterHours_Percent_Change the Open has moved less than -4.0% % in after hours trading. (1m include EXT)

( at January 19, 2018 3:28 pm)
0
Private answer

Ok, this post should cover the gap scan: https://www.hahn-tech.com/ans/after-hours-gap-scanner/

In order to make that solution fit your needs you will need to combine the code posted within the question with the code I provided in my answer.

And once you do that, you will realize you have the math already done for your custom watchlist column.

Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on January 20, 2018 9:43 am
0

Thank you for your reply. I understand most of the close except the close[500] line. What does the 500 represent?

( at January 21, 2018 8:35 am)
0

That part gets discarded. You replace “close[500]” in the viewer’s code with “priorDayClose” from my response. So that entire line from the viewer’s code will look like this after you updated it:

def yest_closing_price = priorDayClose;

Or if you wanted to clean this up even further, you would remove that line altogether and modify the next line as follows:

def afterhours_percent_change = 100 * ((close – priorDayClose) / priorDayClose ) ;

( at January 21, 2018 9:17 am)