Difference between TradingView and ProRealTime VWAP

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #249106 quote
    pete2626
    Participant
    New

    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)
    [attachment file=”249107″]
    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 quote
    pete2626
    Participant
    New
    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. [attachment file=”249111″] ProRealTime (Screenshot_3.png): The VWAP seems to deviate noticeably, appearing higher or lower than TradingView’s version. [attachment file=”249110″]
    #249131 quote
    JS
    Participant
    Senior
    Hi, The first thing that stands out is that the time is not synchronized between PRT and TradingView… In TradingView, the VWAP resets at 07:00, whereas in PRT, this happens five hours later…
    Iván González and pete2626 thanked this post
    #249137 quote
    pete2626
    Participant
    New
    Hi JS, Thanks so much for pointing that out ! I really appreciate it. I’ve adjusted the code, and now the VWAP is fully synchronized between PRT and TradingView. Everything looks aligned!
    JS thanked this post
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Difference between TradingView and ProRealTime VWAP


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
pete2626 @pete2626 Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by pete2626
6 months, 2 weeks ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 07/26/2025
Status: Active
Attachments: 4 files
Logo Logo
Loading...