Color Coded Gap Watchlist Columns for ThinkorSwim


Active member
I have developed color coded watchlist columns which can be very helpful, especially when looking at a gap scan on the left while tracking charts on the right. These are color coded based on values. The columns eliminate all those extra zeros at the end and make it easy to spot big values. The codes are listed below. Please pass it on!

Cyan - highest
Red - 2nd highest
Green - 3rd highest
Yellow - lowest

C1 – <20, 20-40, >40
CO – <0, 0-20, 20-40, >40
L1 – 1-5, 5-10, >10
RV1 – 0-5, 5-20, >20

#Pct Change from Yesterday Close
def AP = AggregationPeriod.DAY;
def y = close(period = AP)[1];
def x = Round(100*((close/y)-1),1);
plot z=x;
z.assignValueColor(if z>=40 then color.CYAN else if z>=20 then createcolor(255,153,153) else createcolor(0,215,0));

#Percent change from open
plot x = Round(100*((close/open)-1),1);
x.assignValueColor( if x >=40 then color.CYAN else if x>=20 then createcolor(255,153,153) else if x>=0 then createcolor(0,215,0) else color.YELLOW);

#Rounded Last
def L = Round(close,2);
plot x = L;
x.assignValueColor(if x>=10 then color.CYAN else if x>=5 then createcolor(255,153,153) else createcolor(0,215,0));

#Relative Volume
def x = Average(volume, 60)[1];
def v = volume;
plot r = Round((v/x),1);
r.assignValueColor(if r >= 20 then color.CYAN else if r>=5 then createcolor(255,153,153) else createcolor(0,215,0));
Last edited:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Hi this is a very noobie question but am i meant to copy these individually (without the titles RV1/l1 etc as it wont allow it) into the add study custom script part under the scan part of TOS? I have done that (with your scan conditions from the other post) but it doesnt show anything different. Sorry for the basic question but what am i doing wrong here?!

These codes are only for watchlist columns. To use these, go to a scan and click Customize at top right. Then add each code separately to Custom column. Once you do that, there should not be any errors. These values only work after 9:30am.

@bss05 These codes are only for watchlist columns. To use these, go to a scan and click Customize at top right. Then add each code separately to Custom column. Once you do that, there should not be any errors. These values only work after 9:30am.
Last edited by a moderator:
@Danchik I took a couple of screenshots but I could not insert them here. Anyway, when you have a scan in thinkorswim, you should see a small gear icon on the far right just below the Search Results. If you click that then click Customize, a new window will pop up. Under Available Items, go to Custom columns. Double click the scroll in any Custom column and insert each code into a different Custom number. Be sure to label each one as well and save them. Then you can add these columns to a scan by clicking Customize and then Add Item. Let me know if you run into any problems.

@bss05 I guess you read my other post on the Relative Volume strategy. The RV1 value was highest on JOB today and it had 2 big spikes today.
Last edited by a moderator:
I did, and I saw that! Im still a noob with buying stocks that have this increased volume. By the time it's coming up on the scanner, I feel im late and dont want to chase. Perhaps I should be looking to play the dips (off the fibonacci levels).

edit: rereading it now, I see you suggest scanning at 9.32am. Guess that's the time to hop in!

You could have bought FRAN at less than $4.50 this morning. If you track your premarket scanner on TOS, it spiked at 7:30 when the news came out. You just wait for the pullback and then buy it. Then just hold it as long as it stays above VWAP and you can make 100% return in premarket.

Here is what I use for Premarket Scan:
Last: 0.2 to 15
Volume: 5000 to No Max
Custom Study Filter: After Hours Change, the close is greater then 10% (under Price Performance); check the Ext box and select 1m on the right.

As soon as you see FRAN pop up in the scan, just check the news in TOS, and buy it once it has the small pullback at 7:31.
@Vimal Mittal


This is the image you wanted.
@Sonny I got distracted but I was watching that one pre market and was wondering why the PM scanner wasnt picking it up as it seemed to fit all the criteria. It was at 3.80 then and I thought I had missed the run. Was going to message you about it in fact - I should have used that time to sell a bag and buy it instead!

Is there a way to scan for RV pre market (comparing it to other PM volume)?
Last edited:
You are genius. Please can you create similar watchlist for premarket? ineed it.


What "rounded last: column means? I see cyanide color two or three digit numbers mostly? please explain how to read?
Last edited by a moderator:
@Vimal Mittal

Rounded Last means I rounded the last close price so there are no extra zeros at the end. For premarket, I use a scan and my main columns are Mark % Change, Mark, and Volume.
It is not possible to compare PM volume on different days. However, if you see my post on Useful Intraday Stats, I have a chart label that looks at Relative Premarket Volume that indicates which stocks have high RV1 values before 9:30. I will also add a watchlist column that measures premarket relative volume as well.


Here is the code for a watchlist column that measures premarket relative volume. Note that these values are small since we are comparing premarket volume to average full day volume. However, you can get an idea that stocks with RV>1 will have the potential to have big spikes, either in premarket or after 9:30. It is worth tracking the top 3 RV1 stocks after 9:30 since they could spike shortly after 9:30 or in the afternoon.

def isRollover = GetYYYYMMDD() != GetYYYYMMDD()[1];
def beforeStart = GetTime() < RegularTradingStart(GetYYYYMMDD());
def vol = if isRollover and beforeStart then volume else if beforeStart then vol[1] + volume else Double.NaN;
def PMV = if IsNaN(vol) then PMV[1] else vol;
def AV = AggregationPeriod.DAY;
def x = Average(Volume(period=AV)[1],60);
def y1 = Round((PMV/x),2);
def L = Lg(y1);
def p = if L>=1 then 0 else if L>=0 then 1 else 2;
def y2 = Round(y1,p);
plot z = y2;
z.assignValueColor(if z>=10 then color.CYAN else if z>=1 then createcolor(255,153,153) else createcolor(0,215,0));
@Sonny I tried to copy and paste your code above but it gave me a error

Expected double at 10:10
No such variable: y at 10:16
Expected double at 10:10
No such variable: y at 10:16

Also is there a way to measure the current premarket volume divided by the average daily premarket volume over the last 20 days? i would like to have both on my watchlist column. I am CST time...Thanks!!!!!

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
207 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.