# Trouble getting accurate VWAP data

**URL:** https://forum.alpaca.markets/t/trouble-getting-accurate-vwap-data/18593
**Category:** Alpaca Market Data
**Created:** [March 19, 2026, 8:34pm UTC](https://forum.alpaca.markets/t/trouble-getting-accurate-vwap-data/18593 "2026-03-19T20:34:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kcducttaper](https://avatars.discourse-cdn.com/v4/letter/k/48db29/32.png) [@kcducttaper](https://forum.alpaca.markets/u/kcducttaper)
#### Post date: [March 19, 2026, 8:34pm UTC](https://forum.alpaca.markets/t/trouble-getting-accurate-vwap-data/18593/1 "2026-03-19T20:34:31Z")

</div>

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”](https://data.alpaca.markets/v2/stocks/%7Bsymbol%7D/bars%E2%80%9D) endpoint as described here [Historical bars (single symbol)](https://docs.alpaca.markets/reference/stockbarsingle-1)
- “calculated vwap” is me doing my own calculation using the following code block:

```python
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):

 ![image](https://us1.discourse-cdn.com/flex020/uploads/alp/original/2X/0/0b4ff9f747d1979210e79e7cf887992d2eec2f25.png)

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:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/alp/original/2X/f/ff1da5e33b9d0492aad9df995d49a6ec987c1ac9.png)

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?
