Color coded watchlist columns for ThinkorSwim

CDJay

CDJay

Member
VIP
Thanks, @Sonny. So right now, HMHC and HTBK are the two highest RV, but they are below the VWAP. Are you suggesting to wait until they go above the line, then a pullback to the line, before putting in an order with a 5% stop-loss. Or is passing the line from below generally good enough of an indicator?
 
S

Sonny

Active member
VIP
Thanks, @Sonny. So right now, HMHC and HTBK are the two highest RV, but they are below the VWAP. Are you suggesting to wait until they go above the line, then a pullback to the line, before putting in an order with a 5% stop-loss. Or is passing the line from below generally good enough of an indicator?
So it's best to wait until 9:30 for these. Wait for a stock to break VWAP from below and hold as long as it is above VWAP or bounces off it. HTBX did that today but HMHC sloped down after 9:30.
 
Z

ZION

New member
VIP
Sonny what is the right time or right color to get in by watching rv1 AND C1 ON MY WATCH LIST NO NUMERICAL JUST A WORD NAN
 
Last edited:
S

Sonny

Active member
VIP
Sonny what is the right time or right color to get in by watching rv1 AND C1 ON MY WATCH LIST NO NUMERICAL JUST A WORD NAN
New symbols show up on the momentum scan shortly after 9:30. Have the Message Center pulled up and set alerts when new symbols show up on the Momentum scan. There is no magic RV1 number but look for stocks on the scan before 10am that are trading above VWAP and have bullish stock patterns like rounding bottom, double bottom, and bull flag. The good stocks usually have a RV1 in top 3 for the day. Good entry would be pullback to 9EMA or bounce off VWAP. Good examples are ANTE on 7/13, GENE on 7/15, BOXL on 7/16, and VRNA on 7/17.
 
R

rlohmeyer

New member
This thread has been extremely useful in developing watchlist columns to filter candidates for trading based on bullish signs. I have columns related to percent change from close and relative volume for both premarket and the regular trading session. Picture is below.



I am having trouble with one column I would like to use as a final filter for chosing candidates after the market opens. Presently it is based on just the close price being above the open. It is the first column in the watchlist and it gives me a green go or red no.
The coding for this watchlist plot is:

Code:
#Close above Open:
def AP = AggregationPeriod.DAY;
input cl = close;
input op = open;
plot co = cl>op;
co.assignValueColor(if cl>op then color.green else color.red);
However I would like to plot 2 conditions within the column indicator but cannot figure out the coding for the plot. I would also like it to give me binary response, say 0 for no and 1 for yes, like the above code. Here is what I have thus far. Anyone help I could get would be appreciated. I have learned a lot about coding recently and been able to cobble together quite a bit. But am stumped here yet again.

Code:
#Open above Yesterday Close and Close Above Open:
def ap = AggregationPeriod.DAY;
def op = open(period = ap);
def ycl = close(period = ap)[1];
def cl = close;
def cond = op > ycl[1] and cl>op;
 
R

Robby Luca

New member
Found script in here that @Sonny posted to get Relative Volume during Premarket.

Some results are NaN. Is there a way to fix that?
Also, there script only works during premarket and does not make sense during regular hours. Any way to fix that?

Code:
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 PMVol = if IsNaN(vol) then PMVol[1] else vol;
def Agg = AggregationPeriod.DAY;
def AvgVol = average(Volume(period=Agg),60)[1];

def RV = Round((PMVol/AvgVol),2);
#def L = Lg(RV);
#def p = if L>=1 then 0 else if L>=0 then 1 else 2;
#def y2 = Round(RV,p);

plot z = RV;
Third question; there's a part of the code I do not use. Can anyone explain what it does and why it's in there?
Code:
#def L = Lg(RV);
#def p = if L>=1 then 0 else if L>=0 then 1 else 2;
#def y2 = Round(RV,p);
 
CDJay

CDJay

Member
VIP
Found script in here that @Sonny posted to get Relative Volume during Premarket.

Some results are NaN. Is there a way to fix that?
Also, there script only works during premarket and does not make sense during regular hours. Any way to fix that?

Code:
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 PMVol = if IsNaN(vol) then PMVol[1] else vol;
def Agg = AggregationPeriod.DAY;
def AvgVol = average(Volume(period=Agg),60)[1];

def RV = Round((PMVol/AvgVol),2);
#def L = Lg(RV);
#def p = if L>=1 then 0 else if L>=0 then 1 else 2;
#def y2 = Round(RV,p);

plot z = RV;
Third question; there's a part of the code I do not use. Can anyone explain what it does and why it's in there?
Code:
#def L = Lg(RV);
#def p = if L>=1 then 0 else if L>=0 then 1 else 2;
#def y2 = Round(RV,p);
Sonny posted elsewhere that he will be unavailable for few weeks.
 
axlerod

axlerod

Member
No, this was a column for Premarket Relative Volume but did not work. You can get the PM relative volume as a chart label in my other thread.
So after reading through everything slightly confused.

I have 2 scripts for RV1

This one referring to this post https://usethinkscript.com/threads/color-coded-watchlist-columns-for-thinkorswim.2977/post-28578

Code:
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));
The the original code on page 1

Code:
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));
Which one do I use? Or Do i use both and one called Pre Market RV1 and the other RV1 ?

Thank you very much also the other columns you posted on page 1 I set all to 1d time is that correct? @sunny
 
Last edited:
B

bss05

New member
Using the RV1 is incredibly helpful. Thanks so much Sonny. Is there any way one can make a scan that only accepts stocks with an RV1 over a certain amount? Be amazing to just have ones over 20 RV or so.
 
murkr

murkr

Member
VIP
@Sonny If I'm setting this put and I plan to look at the 1-minute chart on gapped stocks should I change this to 1-minute (see picture) for all of the entries in post #1 or should I keep it as the default D?



The RV calculation is (today's volume) / (60 day average daily volume). When you put in the column code, make sure you mark D for day for next to Column Name.
EDIT: after reading through the pages I found this. So I'm going to set all of them to D even though ill be looking at the 1-minute chart.
 
Last edited:
scubasteve513

scubasteve513

New member
VIP
@Sonny everytime try to add this to my watchlist under Custom I get invalid statements specifically concerning the parts of the code I highlighted, the following is the errors that show as well, any help you can give would be much appreciated.

Invalid statement: Cyan at 1:1
Invalid statement: CO at 37:1
Invalid statement: L1 at 47:1
Invalid statement: RV1 at 59:1
 
Last edited:
C

coolvoice3

New 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

C1
#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));

CO
#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);

L1
#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));

RV1
#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));
======================
For the above customized columns what is the aggregration period we need to select is it the default "D" ?
Thanks
 
G

GTRudeBoy

New member
VIP
Anyone else have issues with the data taking along time to load?
 

Similar threads

Top