Join useThinkScript to post your question to a community of 21,000+ developers and traders.
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 = Volume(period=AV)[1];
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));
i Cant find an option to add this in ThinkorSwim, Can you direct?
Hi, Sonny, very appreciate your program. I have a question: this relative volume cauculation is based on what time frame? should I use daily or 1 minute volume & Average(volume, 60) for counting? thank you
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.
Hi, Sonny, thank you very much for your explanation. Your ideas is: based on this RV ranking after 9:30 am(like in first 5 minutes) , several top-RV-ratio stocks are high-probability targets to trade after they have pull back, right? that;s because where the huge money flow in, right?
Hi, Is this the updated code for RV1 ?
The columns only work after 9:30. If you want premarket relative volume, then see my thread called Useful Intraday Stats at page 4.@Sonny: Does this watch list work only when the market is opening at 9:30 or if I check at 8:30 AM EDT it compares present pre market volume with last 60 days total volume ?
#Relative Volume
def AV = AggregationPeriod.DAY;
def x1 = Average(volume(period = AV)[1], 50);
def v1 = volume(period = AV);
def z1 = v1 / x1;
def z2 = if Lg(z1) >= 2 then 0 else 1;
def h = high;
def v = volume;
def bar = BarNumber();
def GlobeX = GetTime() < RegularTradingStart(GetYYYYMMDD());
#Premarket Volume
def vol = if GlobeX and !GlobeX[1] then v else if GlobeX then vol[1] + v else Double.NaN;
def L2 = RoundDown(Lg(vol), 0);
def C1 = if L2 > 4.5 and L2 < 5.5 then 1 else 0;
#Premarket Relative Volume
plot z3 = vol / x1;
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?
Start a new thread and receive assistance from our community.
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.
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.