Scan for After Market Movers in ThinkorSwim

lowtrade

Member
VIP
Hi, I'm looking for a scanner to show me all the stocks that are moving up after the market close. I couldn't find any and I have a scan for Pre-market and works fine. Any help would be appreciated.
 

BenTen

Administrative
Staff
VIP
Try using the same condition that you use to find movers from pre-market and apply that to after-hours.
 

cherif

Member
Hi, I'm looking for a scanner to show me all the stocks that are moving up after the market close. I couldn't find any and I have a scan for Pre-market and works fine. Any help would be appreciated.
would you mind sharing before market scan? at least how do you determine that a stock is going to be moving throughout the day?
 

lowtrade

Member
VIP
I'm using the below one for premarket scan with 5% or more but not sure how can I use the same one for After hours. I want to stocks that are 5% or up after hours since the market close. I'm not sure how can I add a watchlist column to show the price change since the market close. All the columns are showing price change from the previous day close. @cherif
 

Len20

Member
It's actually already a built in study. In Study, under "Price Performance" choose "After hours percent change"

For a watchlist column, I recently made this. It shows the percent change from from the most recent market close. It works during after hours, premarket (gap), and continues during market hours.

edit 6/21/20: 1hr aggregation seems to load the fastest while still being accurate, though 1 min works too.

Code:
# Gap From Market Close watchlist by Len20
# Set to 1hr or lower aggregation
# Works afterhours, premarket, and regular hours

def marketClose = 1559;
def c =  close;
def today  = GetDay() == GetLastDay();
def dayHours = SecondsTillTime(marketClose) >= 0 ;

def PrevClose = if (dayHours[1] and !dayHours) or (dayHours[1] and !today[1] and today)
                #in case there was no afterhours trading
                then c[1]
                else PrevClose[1];

def gapChange = round((c - PrevClose) / PrevClose * 100, 1);

plot GapPlot = if today then gapChange else double.NaN;
GapPlot.assignValueColor( if gapChange < 0 then color.RED else color.GREEN);
 
Last edited:

lowtrade

Member
VIP
Thanks @Len20 . I just added this watchlist column. It is showing the % change from the previous close not the % change after the market close.

Please check the ticker EVOK and it showing 2.6% and it is same as default % change column.

The formula would be Market % Change - % Change will be the correct value to identify the AH price change.

Here is another set of code found from Hahn site. I hope this okay to be shared here.

Code:
input marketClose = 1555;
def closeCounter = SecondsTillTime(marketClose);
def regSessEnd = closeCounter == 0;
rec priorDayClose = if regSessEnd then close else priorDayClose[1];
def change = ((close-priorDayClose) / priorDayClose) * 100;
def con1 = change >= 3 or change <= -3;
plot scan = con1;
 
Last edited:

Len20

Member
@lowtrade It sounds like you have the aggregation period set to daily. It needs to be set lower. 1 min aggregation should be accurate and shows EVOK at 74.5%. I use 1 hr aggregation because it seems to load slightly faster and I believe it is just as accurate.

The only difference from code that uses daily aggregation is the final closing price for the day might actually be slightly different than the close of the final bar for that day.
 
Last edited:

geebeeaye

New member
@lowtrade is correct your scan and the default TOS study for After hours percent change are incorrect they are showing the change from previous day close. How to scan for the difference between Last and Mark? The formula should be (Mark-Last)/Last. For CRIS today the % it gained in the after hours only should be (6.86-6.55)/6.55 = .047%


 

Neoknight

New member
Has anyone finally solved this? Is their a functional code that incorporates the latest comments?

Would be most obliged if someone can post😇🙇‍♀️❤️🙏
 

XeoNoX

Active member
VIP
the built in scanner for TOS for afterhours works fine that Len20 posted in post # 5....... Remember you should set it to 1 minute and also remember it only scans for afterhours of the SAME DAY... meaning that the time of day you are scanning has to be in afterhours. if you wake up next morning at market open and scan that means that since afterhours hasnt hit yet it will scan the previous day results.
 

Neoknight

New member
I did as you suggested and here is what I get when scanning at 7 pm ET (after hours):

As you can see for the first Ticker CELZ Last: 0.0302 (which is close as of today) --- the Market Change % is 674.36% even though the current Bid / Ask is 0.0301 and 0.0310. So, clearly, the 674.36 refers to the increase since Open this morning.

My goal is to have a column that shows the AfterHoursPercent increase / decrease -- between close of today and current after hours Ask price. So, the AfterHoursPercent for CELZ should be (ASK price - Today's Close) / Today's Close X 100 which is ....

(0.0310 - 0.0302) / 0.0302 * 100 = 2.65% -- NOT 674.36%.



Can someone kindly suggest how one can accomplish this?

Thanks!
 

XeoNoX

Active member
VIP
Here you go, it only works as a COLUMN.

It's a little off since it uses the current middle price, but its better than nothing, I'm sure there's a way to grab the price using secondsfromtime to grab the close/last afterhours.. I already had this one that I used... here is the code.

remember to hit the like button if you found my post usefull

PERCENT FROM MARKET CLOSE for use with AFTERHOURS



Code:
# in place.
#PERCENT FROM MARKET CLOSE for use with AFTERHOURS
#BY XeoNoX via usethinkscript.com
def middleprice = (ask-bid) / 2 + bid;
plot x = round(100*((middleprice/close)-1),1);
AddLabel(yes,aspercent(x/100),if x > 0 then color.UPTICK else if x == 0.0 then color.white else color.red);
 
Last edited:

Neoknight

New member
This is very helpful.

There are 2 queries:

1. My column, marked %ChgClose on the right, has a large number of entries marked "custom expression subscription limit exceeded". I researched this and it seems there is a supposed limit on how many results might be returned for custom code. However, I get 50% of entries like this even when I have only 20 or 30 results in the column. Any suggestions on how to get rid of this -- and get clean code like yours?

2. My Mark%Change column shows the % difference between the day's opening price and the after hours price - e.g. see 2nd Stock - NCTY - Mark%Change is 124%. How can I get the % difference between day's closing price and after hours price i.e. 28.9% ((19.2-14.89)/14.89*100).

Thank you!

 

Neoknight

New member
Here you go, it only works as a COLUMN.

It's a little off since it uses the current middle price, but its better than nothing, I'm sure there's a way to grab the price using secondsfromtime to grab the close/last afterhours.. I already had this one that I used... here is the code.

remember to hit the like button if you found my post usefull

PERCENT FROM MARKET CLOSE for use with AFTERHOURS



Code:
# in place.
#PERCENT FROM MARKET CLOSE for use with AFTERHOURS
#BY XeoNoX via usethinkscript.com
def middleprice = (ask-bid) / 2 + bid;
plot x = round(100*((middleprice/close)-1),1);
AddLabel(yes,aspercent(x/100),if x > 0 then color.UPTICK else if x == 0.0 then color.white else color.red);

Not sure if you saw my next post in reply the one above. Bumping this, in case you didn't see it.

Thanks in advance for any help -- because this is out of my league :)!
 

Similar threads

Top