I’m trying to use VWAP in some of my calculations and I’m having a hard time getting reliable VWAP data.
In my example below, I’m seeing 3 VERY different VWAP numbers. Here is the relevant part of my log file:
15:31:16 Initializing ORIS
{
“price”: “0.525”,
“purchase value”: “100”,
“ticker”: “ORIS”,
“folder”: “20260319”,
“screener”: “10_in_10”,
“file name”: “143116_ORIS_log.txt”,
“price action”: “92003.58”,
“candle calculation time”: “14:31”,
“previous minute candle”: {
“open”: “0.4996”,
“close”: “0.54”,
“high”: “0.54”,
“low”: “0.4993”,
“volume”: “170377”,
“vwap”: “0.532582”,
“calculated vwap”: “0.4068”,
“price action”: “92003.58”,
“UTC start time”: “2026-03-19T19:30:00Z”,
“UTC end time”: “2026-03-19T19:31:00Z”,
“trending”: “up”
}
- “vwap” is simply the value of the returned historical bar’s “vw” attribute using the “https://data.alpaca.markets/v2/stocks/{symbol}/bars” endpoint as described here Historical bars (single symbol)
- “calculated vwap” is me doing my own calculation using the following code block:
def getVWAPData(ticker, numMinAgo):
client = StockHistoricalDataClient(API_Key, API_Secret) end_time = datetime.datetime.now(datetime.UTC) - datetime.timedelta(minutes=numMinAgo)
# Defines UTC market open time
if (datetime.datetime.now().hour + 5) == datetime.datetime.now(datetime.UTC).hour:
start_time = end_time.replace(hour=13, minute=30, second=0, microsecond=0)
if (datetime.datetime.now().hour + 6) == datetime.datetime.now(datetime.UTC).hour:
start_time = end_time.replace(hour=14, minute=30, second=0, microsecond=0)
request_params = StockBarsRequest(
symbol_or_symbols=[ticker],
timeframe=TimeFrame.Minute,
start=start_time,
end=end_time
)
bars = client.get_stock_bars(request_params)
df = bars.df
df['tp'] = (df['high'] + df['low'] + df['close']) / 3
df['tp_vol'] = df['tp'] * df['volume']
df['cum_tp_vol'] = df['tp_vol'].cumsum()
df['cum_vol'] = df['volume'].cumsum()
df['vwap'] = df['cum_tp_vol'] / df['cum_vol']
numMinAgo = numMinAgo*(-1)
vwap_X_min_ago = round(df.iloc[numMinAgo]['vwap'],4)
return str(vwap_X_min_ago)
- Webull shows something very different as well (Webull defaults to NOT using premarket data for VWAP):
When I look at ORIS in Alpaca, it seems to think it needs more data to calculate VWAP although I’m zoomed out to the entire day:
So, my question is, which of these is right and is Alpaca struggling with VWAP somehow? Depending on which way you look at it, there is more than a 60% discrepancy between these numbers effectively rendering them useless unless one is deemed “correct” or “incorrect” (and discarded). What am I missing here?

