Best % Gap Long/Short Plays (Works Pre-Market) for ThinkorSwim

Q

QUIKTDR1

New member
@QUIKTDR1 are yo sure you are pasting it into a WATCHLIST COLUMN? From your post it doesn’t seem like it.
Thank you Mike! No I don't think I loaded it in a watchlist column. Where or how do you do this?
 
Prison Mike

Prison Mike

Member
There is a small "gear" on the left at the top of the watchlist. Go to customize, then save it in a new watchlist study. Also google is a magical thing if you have problems.
 
E

emeraldcitytrader

New member
Hi everyone,
I have this working, however, I'd like to color code for gaps in both directions. This may be super simple, but nothing I've tried is working. I tried using an absolute value and also tried adding an OR statement, but Thinkscript won't accept a second > or < in the line. Here's what I have so far, but I'd like to have it do the same for gap ups.

Code:
plot pop = Round("number" = ((ask + bid) / 2 -close[1]) / close[1] * 100, "numberOfDigits" = 1);
pop.assignvalueColor(if pop < -8 then color.white
else if pop < 0 then color.black
else if pop > 0 then color.white
else color.black);
#Gap down
AssignBackgroundColor(if pop < -15 then Color.blue
else if pop < -8 then Color.DARK_GREEN
else if pop < -6 then Color.GREEN
else if pop < -4 then Color.LIGHT_GREEN
else if pop < -2 then Color.yellow
else if pop < -.01 then Color.pink else Color.black);
 
Q

QUIKTDR1

New member
Thank you Townsend , Mike and others Remember it's the watchlist not a scan or chart LOL
 
Christo Currency

Christo Currency

New member
@Townsend I noticed Pre-Market Movers (green arrow) is not editable. Is that because at the time I did this (upper left) it's not during pre-market hours?

 
Last edited by a moderator:
rlohmeyer

rlohmeyer

New member
I have appreciated using this code for a watchlist column but wanted to see gap sell as well as gap buy candidates at the top of the watchlist when sorted for the largest gaps. I solved that issue by modifying the code slightly. See image below and code changes. In the image the POP column is sorted to see the largest gaps from my scan list. You can tell if the Gap is up or down by the color. Green up, Red down.




Code:
plot pop =  Round(absValue(((ask + bid) / 2 -close[1]) / close[1]) * 100,1);
def con = Round((((ask + bid) / 2 -close[1]) / close[1]) * 100,1);
pop.assignvalueColor(if con > 1 then color.green else color.red);
 
A

andre.muhammad

New member
VIP
I have appreciated using this code for a watchlist column but wanted to see gap sell as well as gap buy candidates at the top of the watchlist when sorted for the largest gaps. I solved that issue by modifying the code slightly. See image below and code changes. In the image the POP column is sorted to see the largest gaps from my scan list. You can tell if the Gap is up or down by the color. Green up, Red down.




Code:
plot pop =  Round(absValue(((ask + bid) / 2 -close[1]) / close[1]) * 100,1);
def con = Round((((ask + bid) / 2 -close[1]) / close[1]) * 100,1);
pop.assignvalueColor(if con > 1 then color.green else color.red);

What are the steps to doing this?

I cannot figure out how this is done properly. Is it possible to send the watchlist?
 
BenTen

BenTen

Administrative
Staff
VIP
@andre.muhammad Watch the second half of the video below. In it, it shows you to add a custom watchlist column.

 
S

Slydog482

New member
VIP
Hey @Townsend. I'm very interested in what this watchlist column does/shows you. I'm just curious how this differs from the %Change column. They look pretty close, if not right on the money. Is there any way you could help explain how you utilize this column as I'm very interested in playing the market at the open if not before?
 
rlohmeyer

rlohmeyer

New member
@Slydog482 The difference between the 2 is that the POP column catches premarket since it uses the average between Bid/Ask. During the regular session, it will not be much different than %Change.

It allows you to watch premarket movers.
 
S

Slydog482

New member
VIP
@Slydog482 The difference between the 2 is that the POP column catches premarket since it uses the average between Bid/Ask. During the regular session, it will not be much different than %Change.

It allows you to watch premarket movers.
Thank you @rlohmeyer. So I have been trying to get this watchlist column loaded and I constantly get "NaN" in that column. I tried copying and pasting the original code from townsend and then I just tried copying and pasting the last one you put on there. Is there any way you can help me on getting that column loaded on there? I would greatly appreciate it.
 
rlohmeyer

rlohmeyer

New member
If you have too many watchlist columns that calculate somewhat complex scripts, you can get NAN's. Also, when the market is moving, the column needs to recalc and you will get NAN's. Is this on all your stocks in the watchlist, or just a certain number?
 

Similar threads

Top