Difference between TradingView and ProRealTime VWAP

Forums ProRealTime English forum ProBuilder support Difference between TradingView and ProRealTime VWAP

Viewing 2 posts - 1 through 2 (of 2 total)
  • #249106

    Hello ProBuilder Community,

    I’ve noticed a slight difference between the VWAP (Volume-Weighted Average Price) indicator on TradingView and the one on ProRealTime. On some charts, the ProRealTime VWAP appears to be offset by about five candles compared to TradingView’s, especially around gaps.

    Has anyone else encountered this? If so, is there a way to adjust the ProRealTime VWAP calculation (or code a custom version) to match TradingView’s implementation more closely?

    I’d greatly appreciate any insights or suggestions. Thank you in advance for your help.

    Pinescript code:

    //@version=6
    indicator(title=”Manual Session VWAP”, shorttitle=”VWAP”, overlay=true)
    // Fixed source and session anchor
    src = hlc3
    // Detect new daily session
    isNewSession = timeframe.change(“D”)
    // Cumulative sums reset each session
    var float cumPV = na
    var float cumVol = na
    cumPV := isNewSession ? src * volume : nz(cumPV[1]) + src * volume
    cumVol := isNewSession ? volume : nz(cumVol[1]) + volume
    vwapValue = cumPV / cumVol
    // Plot VWAP in blue
    plot(vwapValue, title = “VWAP”, color = #2962FF)
    Screenshot_2

    Probulder code:
    // PRC_VWAP intraday (VWAP only, HLC3 version)
    // SAME LOGIC, explicit HLC3 instead of typicalprice
    // 09.01.2020
    // Nicolas @ http://www.prorealcode.com
    // Modified: explicit HLC3if day <> day[1] then
    d = 0
    else
    d = d + 1

    hlc3 = (high + low + close) / 3

    if volume > 0 then
    VWAP = summation[d](volume * hlc3) / summation[d](volume)
    endif
    endif

    if VWAP > VWAP[1] then
    color = 1
    else
    color = -1
    endif

    RETURN VWAP COLOURED BY color STYLE(LINE, 2) AS “VWAP”

    #249109

    Observation:
    On the Nasdaq 100 (US Tech 100 Cash) chart for 24 July 2025 07:00 (Malaysia time), the VWAP lines on TradingView and ProRealTime are offset by several candles, especially around price gaps. Here are two screenshots for reference:

    TradingView (Screenshot_2.png): The VWAP appears at 23,098.7, aligned closely with recent price action.

    Screenshot_2-1

    ProRealTime (Screenshot_3.png): The VWAP seems to deviate noticeably, appearing higher or lower than TradingView’s version.

    Screenshot_3-1

Viewing 2 posts - 1 through 2 (of 2 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login