Premarket volume labels showing less volume than real


Category:
0
0

Hi Pete!

I’m trying some of the premarket indicators posted here for volume labels and I noticed they don’t work fine. They show less volume than the real volume at any given time during premarket:

I used this indicator here and I had the problem I mentioned:

input startTime = 400;
input endTime = 929;
def startCounter = SecondsFromTime(startTime);
def endCounter = SecondsTillTime(endTime);
plot targetPeriod = if startCounter >= 0 and endCounter >= 0 then 1 else 0;
rec volumeTotal = if targetPeriod and !targetPeriod[1] then volume else if targetPeriod then volumeTotal[1] + volume else volumeTotal[1];
AddLabel(yes, Concat("Target Period Volume: ", volumeTotal), Color.GRAY);

 

And the same problem with this one:

 

# PreMarket Forecast Volume

# TOS

declare lower;

def Pre = if SecondsFromTime(0400) > 0 and

SecondsTillTime(0930) >= 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(yes, “Cumulative PMKT Vol: ” + PreMarketVol, if PreMarketVol > 3000000 then Color.GREEN else Color.light_gray);

 

So, any ideas what’s going on?

 

Thanks!

 

Marked as spam
Posted by (Questions: 6, Answers: 21)
Asked on February 18, 2020 11:54 am
291 views
0
Private answer

When I check the computations for the first section of code you posted it computes the volume perfectly. I added up all the volume bars during the period defined by the startTime and endTime variables and the label prints the exact same value I computed on a spreadsheet.

So, it's not the code, there is something else causing your problem We need more details.

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on February 18, 2020 1:25 pm
0
Thanks, Pete. I don't know why, it's very strange. Today I was checking different tickers in premarket and using both indicators posted above. At the same time I had those tickers in my watchlist and the watchlist volume was always higher than the volume showing at the labels. I also double checked on Nasdaq just in case, and it was also higher even considering it is a bit delayed. I'd love to know the reasons. Otherwise this labels are useless.
( at February 18, 2020 2:13 pm)
0
Make sure you have accounted for this: https://www.hahn-tech.com/ans/how-to-calculate-volume-from-the-open/
( at February 18, 2020 3:06 pm)