Premarket Relative Volume Percentage watchlist?

P

princesly

New member
VIP
@BenTen and team, you guys rock! Do you happen to have a study that calculates the premarket relative volume percentage that is color-coded in a watchlist? It would also be nice to have it in a study with labels.

Gracias,
Prince
 
E

Eagle X

New member
I would like to see something like this as well. A current day premarket relative volume compared to the average premarket volume from the last 20 days. I'm thinking it could even be set up to capture a certain timeframe. In this case, the premarket hours of 4:00 A.M. to 9:30 A.M.
 
zeek

zeek

Active member
2019 Donor
I second this request, would be very useful for my strategy. I hope someone here can code something like this:)
 
O

OldBallz

New member
2019 Donor
@zeek did you ever find a solution for this?
 
zeek

zeek

Active member
2019 Donor
Unfortunately no @OldBallz Here`s hoping someone smart can figure it out and help code this for us.
 
A

alphasandstorm

New member
I found a script that can quantify the pre-market volume on TOS but this is only for one day.
There's not an average of premarket volume over the past n days.
"GetYYYYMMDD()" corresponds to the day whose trading session contains the current bar.
Does anyone know what "GetYYYYMMDD()[1]" corresponds to? Is it the next day?
If someone knows how to use GetYYYYMMDD() to get the nth previous day you I could likely use that to figure out how to get the average of the premarket volume over n days in another script.
Code:
# PreMarketForecast Volume
# TOS
def LabelTime = if SecondsFromTime(0800) > 0 and
                   SecondsTillTime(1000) >= 0
                then 1
                else 0;
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 PreMarketVol = if IsNaN(vol) then PreMarketVol[1] else vol;
AddLabel(LabelTime, "PreMarket Volume = " + PreMarketVol, Color.WHITE);
I would like to use this to create an RVOL script.
Does anyone know the best approach for using this data to create an RVOL script to find stocks in play before the market opens?

Thanks :)
Jackson
 
Last edited:
A

alphasandstorm

New member
@SirMc Have you explored the existing RVOL scripts on this site? What are your thoughts about them?
 
S

SirMc

New member
@SirMc Have you explored the existing RVOL scripts on this site? What are your thoughts about them?
Yes I have but they don't provide the solution I'm looking for which is to find the average volume for a specific time frame. For instance the relative volume of the first 5 minutes for the last N number of days vs today's first 5 minutes.
 
A

alphasandstorm

New member
I have made progress towards a solution but it is not complete / issues remain.



The following will plot the pre-market volume on a histogram below the chart and compare it to an average of the pre-market volume over the past 10 days:
Code:
declare lower;

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 volLast10DayAvg = (pmVol[1] + pmVol[2] + pmVol[3] + pmVol[4] + pmVol[5] + pmVol[6] + pmVol[7] + pmVol[8] + pmVol[9] + pmVol[10]) / 10;
plot avg = volLast10DayAvg;

plot pmVOLPlot = pmVol;
pmVOLPlot.setDefaultColor(color.red);
pmVOLPlot.setPaintingStrategy(paintingStrategy.HISTOGRAM);
AddLabel(1, "RVOL= " + pmVOL/avg, Color.YELLOW);
plot ratio = pmVol/avg;
ratio.setDefaultColor(color.GREEN);
The issues:
Now while this does allow you to quantify the pre-market volume and compare it to the pre-market volume of the past 10 days, it stops summing volume once the market opens and just holds the sum of the pre-market volume data over the course of the trading day.
I'm exploring whether / how to include the regular session volume.
I imagine this negatively affects the 10DMA.

I've included a screenshot of the indicator on AAPL on the same day an SMB trader on youtube mentioned the RVOL at market open for AAPL was ~5.5 on April 17, 2020.
The closest I've been able to get to that value with this script is ~4.5 on a 30min timeframe.
Further, when switching time frames the ratio of premarket volume to the average volume changes from a value that would get you interested on a 30min timeframe - to one that seems like the volume isn't as wild as the data shows.
Being able to have a constant or nearly constant value while switching time frames would be ideal.

I've been learning thinkscript, and in order to create a scan for this you would write a line to return a boolean (true or false) value as the result. So something like:
Code:
plot result = ratio > 5;
What I would love for this script to do is:
Calculate the sum of the current pre-market bar volume and compare it to the average sum of pre-market volume at the same relative time bar of the current day for the past x days.

For example, the current bar time is 6:15am EST.
Compare the sum of the pre-market volume at that time to the 6:15am EST candle over the past x days, and return the relative volume of the current bar to the x day average.

Any help is greatly appreciated.
@BenTen @horserider
 
Last edited:
A

alphasandstorm

New member
To comment to the potential of this type of indicator, check out how well it caught the bottom on CCL on April 2, 2020.

RVOL read as ~7, and combined with the exhaustion candle before the close the previous day, and some great news about the Saudis proclaiming a massive stake that am - the pre-market RVOL would've alerted you / added to your conviction for a great setup before the market opened.
 
V

vikram

New member
VIP
@alphasandstorm Any idea how this code can be modified to use for compare relative volume opening hour (9.30-10.30 EDT) for 10 days ?
 
V

Vimal Mittal

Member
@alphasandstorm I found this script for premarket scan if someone can transform in TOS ?

Code:
//@version=4
study("PMAI", overlay = false)

tickerid = syminfo.tickerid
//bgcolor(color=#FFFFFF, transp=70)

yesterday_close = security(tickerid, "D",close[1])
today_open = security(tickerid, "D", open)
today_close = security(tickerid, "D", close)

full = ((today_close-yesterday_close)/yesterday_close)*100
prem = ((today_open-yesterday_close)/yesterday_close)*100
intrad = ((close-today_open)/today_open)*100

plot(intrad, style=5, title="Intra-Day Return", linewidth=1, color=#FC6404, transp=0)//red
plot(prem, style=5, title="Pre-Market Return", linewidth=1, color=#228CBB, transp=60)//blue
plot(full, style=2, title="Total Return", linewidth=2, color=#000000) //black
How can I use this premarket script in my watchlist column? That would be lot easier to find stocks in my watchlist where relative volume is up . Can you write for watchlist?
 
V

vikram

New member
VIP
May I know if it's possible to get Relative Pre market buy volume in the watch list ?
 
Think_Tank

Think_Tank

New member
Happy day All!
I'm looking for a code for pre market relative volume scanner that averages the past "n" days, any help would be greatly appreciated!

Cheers!
 
Top