VWAP Band indicator
Forums › ProRealTime English forum › ProBuilder support › VWAP Band indicator
- This topic has 12 replies, 8 voices, and was last updated 2 months ago by druby.
Tagged: vwap
-
-
10/10/2020 at 2:18 PM #146981
Hello @Nicolas
I am looking for a solution to code a VWAP indicator with the same bands/SD as the PRT VWAP Band indicator.
As you can see on the screenshots (on the left the PRT one), the indicators you have created with the help of PRT (https://www.prorealcode.com/topic/is-there-any-working-intraday-vwap/#post-116309) do not give the same bands as the original indicator present on the platform.
In my manual trading one of my strategies is based on buy/sell when rejecting prices between SD2 and SD3 of the PRT VWAP Band indicator.
Is it possible to have the code to obtain the same bands as the PRT indicator in order to integrate it into a trading robot?
Thank you for your help 🙂
10/12/2020 at 8:22 AM #147113You are right there is a difference, while it is exactly the same but for CFD instrument (look at attached picture).
The formula might have changed between 10.3 and v11, I’ll try to know more about the new VWAP formula and let you know.
1 user thanked author for this post.
12/26/2020 at 3:39 PM #15524807/04/2022 at 9:13 AM #19670607/04/2022 at 10:36 AM #196713Here is the new version of the custom code of the PRT VWAP Bands, it works the same as the internal indicator now:
1234567891011121314151617181920212223242526272829303132333435363738//PRC_VWAP Bands v11 intraday//04/07/2022//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledged = max(1, intradaybarindex)VWAP = SUMMATION[d](volume*typicalprice)/SUMMATION[d](volume)if(intradaybarindex=0) thensd = 0elsep1 = SUMMATION[d](volume*typicalprice)p2 = SUMMATION[d](volume)p3 = SUMMATION[d](volume*typicalprice*typicalprice)ma = p1/p2ma2 = p3/p2sd = sqrt(abs(ma2 - ma * ma))endifSDup1 = vwap+sdSDlw1 = vwap-sdSDup2 = vwap+sd*2SDlw2 = vwap-sd*2SDup3 = vwap+sd*3SDlw3 = vwap-sd*3if vwap>vwap[1] thencolor = 1elsecolor = -1endif//yesterday vwapif intradaybarindex=0 thenyVWAP = VWAP[1]endifRETURN VWAP coloured by color as "VWAP", SDup1 coloured(102,102,102) as "upper 1 STD", SDlw1 coloured(102,102,102) as "lower 1 STD", SDup2 coloured(102,102,102) as "upper 2 STD", SDlw2 coloured(102,102,102) as "lower 2 STD", SDup3 coloured(102,102,102) as "upper 3 STD", SDlw3 coloured(102,102,102) as "lower 3 STD", yVWAP as "yesterday VWAP"4 users thanked author for this post.
09/07/2024 at 8:00 AM #237268Hi,
I have found that this indicator does not match the VWAP indicator in Prorealtime v12 that comes by default.
You don’t know why this happens?
I attach a screenshot where you can see that the green line is that of Nicolas’ VWAP and the blue line is that of the indicator that comes by default on the Prorealtime platform v12.
Thank you so much.
09/07/2024 at 10:25 AM #237270Hi,
When I compare the indicators, there is a minimal difference between… (screenshot)
(difference occurs during the first bar of the day)
The difference in your screenshot is so big because the settings of the (default) VWAP don’t match…
Time interval: 1 day
Interval mode: Reset at each interval
Data accuracy: Historical data graph (default (H+L+C)/3)
1 user thanked author for this post.
09/09/2024 at 10:09 AM #237347Hello,
Thank you very much JS, you are absolutely right. There are 2 ways to see the intraday vwap chart. One is that it uses reset on each interval (every day) and the other is that it uses it continuously.
In my case, I was referring to the continuous or sliding way. (Sorry, it was my fault for not detailing)
When I compare it with the platform’s VWAP, they don’t match. I don’t know what I should change in the indicator so that it can match me. Can anyone help me with this problem?
Thank you so much
09/09/2024 at 2:41 PM #237380Hi,
Hereby the continuous VWAP (bands):
VWAP continuous123456789101112131415161718192021222324252627282930313233343536373839404142// Continuous VWAP Bands// Adjusted to compute VWAP continuously across multiple days without reset// Initialize cumulative variables only once at the startONCE cumVolume = 0ONCE cumPriceVolume = 0ONCE cumPriceVolumeSquared = 0// Accumulate volume and price-volume continuouslycumVolume = cumVolume + volumecumPriceVolume = cumPriceVolume + (volume * typicalprice)cumPriceVolumeSquared = cumPriceVolumeSquared + (volume * typicalprice * typicalprice)// Continuous VWAP calculationVWAP = cumPriceVolume / cumVolume// Calculate Standard Deviationma = cumPriceVolume / cumVolumema2 = cumPriceVolumeSquared / cumVolumesd = sqrt(abs(ma2 - ma * ma))// Define Standard Deviation BandsSDup1 = VWAP + sdSDlw1 = VWAP - sdSDup2 = VWAP + sd * 2SDlw2 = VWAP - sd * 2SDup3 = VWAP + sd * 3SDlw3 = VWAP - sd * 3// Color VWAP based on trendif VWAP > VWAP[1] thenR=0G=255B=0elseR=255G=0B=0endif// Return VWAP and SD Bands with colorsRETURN VWAP coloured(R,G,B) as "VWAP"1 user thanked author for this post.
09/09/2024 at 8:02 PM #237428Hello,
Thank you very much again, I tried JS your VWAP indicator but I have seen that it does not work very well.
I attached a screenshot with the configuration I have in the platform’s Bandas VWAP (blue line) and the two VWAPs made with code. The green line is the intraday PRC_VWAP that resets at each interval and the VWAP (red line) is the last code posted by you in the community.
Thank you very much.
09/09/2024 at 8:59 PM #237430Hi,
When the last code is used, the continuous VWAP, and you want to compare it with the standard indicator, VWAP Bands, you should NOT set a time interval but take the setting “all” (todos)…
You should also use the “typical price”…
1 user thanked author for this post.
09/25/2024 at 5:57 AM #23798709/28/2024 at 2:10 PM #238190I was trying to verify that the VWAP statement, see code in image, tracked with the stock VWAP Bands(Daily) VWAP.
It tracks perfectly till it gets to 1am every Monday where it deviates.
When it deviates it appears to jump to a value which is equivalent to the typical price of that candle.
Then going forward eventually deviates back.
I can’t figure out how the mechanism of the jump or the return back.
I was using the ‘Dax’ German40 (DFB) on 1 hour Timeframe.
Tried others and they too have a jump to the Typical Price, However the days and times differ.
Any idea’s…
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on