Post Market Gappers


Category:
0
0
  • I wanted to know if it is possible to make a custom study filter that measures after hours percent change. Also, need a custom data column that measures after hours percent change. From what I know, the formula is (mark %change) / (%change). However, you cannot use these as variables in the filter or data column. Appreciate your help on this.
Marked as spam
Posted by (Questions: 3, Answers: 5)
Asked on May 7, 2020 2:36 am
242 views
0
I searched the posts before posting. The previous posts that deal with after hours scans provide only chart studies. However, I am looking for a custom study filter for scans as well as a custom data column. Basically need the following after 4pm: (Current price) / (4 pm close price). Thanks!
( at May 8, 2020 5:06 am)
0
I have updated my answer to provide the solutions you requested.
( at May 8, 2020 8:13 am)
0
I tried the code for the watchlist column and it was 1 for every stock. I also tried the code for the scan study filter and it showed no stocks at all. Here is what I noted which may help you solve this. After 4pm, Last is the 4pm close and Mark is the current price. Close is yesterday's close. So the solution to after-hours change is (Mark - Last) / Last. However, Mark and Last cannot be used as variables for the column or scan custom study filter. Is there some way this formula can be calculated to measure after hours change?
( at May 8, 2020 2:19 pm)
0
Watchlist. Ticker symbol AAPL. Today's regular session close is 310.13 and current after market price at the time I am typing this is 310.44. Divide 310.44 by 310.13 and you get 1.001. The column is correctly the computing the value you have requested. You are absolute incorrect regarding the Mark and Last prices. Those are columns you can select from the watchlist but they are NOT values you can use in the code. In the code, the close ALWAYS the most current price. Regardless if the markets are open or during extended hours. Add this to a new custom watchlist column and you will see it shows the current price and not the previous day's close: plot data = close; The column must be set to an intraday time frame. If you miss that, and mistakenly set the column to daily time frame you will get the daily close. But set to intraday time frame with the box checked to include extended hours trade and it ALWAYS displays the close price of the currently active bar. I cannot explain this any further. If you don't get it, then you will need to spend many hours trouble shooting and testing things on your own.
( at May 8, 2020 3:38 pm)
0
I went back and tested the code answers you gave me. The code for the data column works only under Chart Study. But if you put that code as data column or "Custom Quote Formula", it gives you 1 for every stock. Also, the code for the Scanner Custom Filter does give a few stocks but they are incorrect since the after hours change is less than what I searched for. So my question still remains, is it possible to have a data column that measures after hours change and a scan study filter that correctly filters stocks for after hours change? If you get the Scan filter to work, let me know which intraday time setting had to be checked along with Extended Hours. If you test the codes again, you will see what I'm saying.
( at May 9, 2020 8:31 am)
0
I already confirmed that a value of 1 in that column is absolutely accurate. 100% accurate. I even provided an example with the exact mathematical formula to prove it. I am sorry but I have done everything you have requested. If you don't like the result you will need to find a different way of computing that value. Current price divided by previous close is obviously not the math formula that provides the results you seek. So you need to go back to the math change it to compute the value you actually require. I cannot provide any more assistance on this request. I have already spent far more time on this then I permit for free solutions in the Q&A forum.
( at May 9, 2020 10:08 am)
0
You were correct in the data column and scan. Once I changed the time to 1min and checked Ext Hrs, it all worked. Thanks for your help!
( at May 9, 2020 2:19 pm)
0
Private answer

There are several posts in the forum that provide nearly this exact solution you have requested. Please search the forum for solutions before posting a new question.

Here is a directly link to the search results you get when you enter the term "gap" in the search box of the Stock Scanners topic:

https://www.hahn-tech.com/ans/cat/scans/?question_type=all&search=gap

Regarding your claim that you need to use "mark" in your formula, that is not correct at all. You will find many examples of pre and post market scans in this forum and all of them use the close price and none of them use mark or last. For some reason there is a common misconception about this. Folks are lead to believe that the close is not operable for pre and post markets. However it works in every example we have published so far.

Edit: Here are some solutions I pulled from that list of results in the search linked above:

First we'll create the custom watchlist column:

https://www.hahn-tech.com/ans/after-hours-gap-scanner/

In the code from this post, I only had to change the final line to compute the value you requested for your custom watchlist column.

input marketClose = 1600;
def closeCounter = SecondsTillTime(marketClose);
def regSessEnd = closeCounter[-1] == 0;
rec priorDayClose = if regSessEnd then close else priorDayClose[1];
plot data = close / priorDayClose;

Next we'll build the scan. For that we'll grab the code from this post:

https://www.hahn-tech.com/ans/help-making-pre-market-gap-scanner-more-efficient/

def percent_change = -2.00;
input marketClose = 1600;
def closeCounter = SecondsTillTime(marketClose);
def regSessEnd = closeCounter[-1] == 0;
rec priorDayClose = if regSessEnd then close else priorDayClose[1];
# comment out yest_closing_price and replace with priorDayClose
#def yest_closing_price = close[500];
def afterhours_percent_change = 100 * ((close - priorDayClose) / priorDayClose ) ;
# comment out scan for greater than and replace with scan for less than
#plot scan = afterhours_percent_change >= percent_change;
plot scan = afterhours_percent_change <= percent_change;

For this one, we don't have to make any changes at all. The default value for percent_change can be set to zero. Then use whichever of the two scan plots you need. The first one is commented out, but that will scan for current close greater than previous day close. The second one is active, that will be used to scan for current close less than previous day close.

Gap scans are the signal most often requested item in the forum. Sorting all the search results can be a bit overwhelming. Problem is that there is only one way to do it. So every post on a gap scanner can be used in place of any other (with some minor tweaks).

Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on May 7, 2020 7:48 am