Is there any working intraday VWAP?
Forums › ProRealTime English forum › ProOrder support › Is there any working intraday VWAP?
- This topic has 18 replies, 6 voices, and was last updated 1 year ago by Nicolas.
-
-
12/17/2019 at 10:11 PM #115123
Hello,
I am trying different VWAP indicators but none of them seem to work. For example when I try https://www.prorealcode.com/prorealtime-indicators/vwap-intraday/ I get the result i attached in this post.
I’ve tried other VWAP indicators and all of them give very strange results similiar to that one.I would really appriciate getting a VWAP indicator with bands to work.
Best regards,
12/18/2019 at 10:43 AM #115142There is a built-in VWAP bands in the indicator list of the platform.
I think that the indicator you refer to has a problem of calculation for the bands when the volumes are not present. Here is a quick fix:
123456789101112131415161718192021222324252627282930//PRC_VWAP intraday//07.09.2016//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledged = max(1, intradaybarindex)if volume>0 thenVWAP = SUMMATION[d](volume*typicalprice)/SUMMATION[d](volume)if(intradaybarindex=0) thensd = vwapelsesd = SUMMATION[d](max(abs(high-vwap),abs(vwap-low)))/dendifendifSDup1 = vwap+sdSDlw1 = vwap-sdSDup2 = vwap+sd*2SDlw2 = vwap-sd*2SDup3 = vwap+sd*3SDlw3 = vwap-sd*3if vwap>vwap[1] thencolor = 1elsecolor = -1endifRETURN VWAP coloured by color STYLE(LINE,2) as "VWAP", SDup1 coloured(102,102,102) STYLE(DOTTEDLINE,1) as "upper 1 STD", SDlw1 coloured(102,102,102) STYLE(DOTTEDLINE,1) as "lower 1 STD", SDup2 coloured(102,102,102) STYLE(DOTTEDLINE,1) as "upper 2 STD", SDlw2 coloured(102,102,102) STYLE(DOTTEDLINE,1) as "lower 2 STD", SDup3 coloured(102,102,102) STYLE(DOTTEDLINE,1) as "upper 3 STD", SDlw3 coloured(102,102,102) STYLE(DOTTEDLINE,1) as "lower 3 STD"2 users thanked author for this post.
12/18/2019 at 12:38 PM #11515712/18/2019 at 12:51 PM #115159Hello again,
So now I get this result (see attachment), which is better but I still have one or two questions.
Why do the bands spike up and down like crazy right at the beginning of the day? Now I have the chart time only during open hours 09.00-17.30.
Also second question, is it suppose to differ this much comapred to the built in VWAP bands in PRT? I want to use it for algo trading so I cannot use the built in one.Best regards,
12/18/2019 at 1:44 PM #115164Why do the bands spike up and down like crazy right at the beginning of the day?
Because at the beginning of the day you don’t have much data to base the calculations on so each bit has a far larger effect than at the end of the day At the end of the day you have lots of data and so a new bit of data has little overall effect unless it is extremely different to all that came before it.
12/18/2019 at 1:57 PM #11516912/18/2019 at 4:28 PM #11517901/02/2020 at 5:16 PM #11577901/06/2020 at 10:57 AM #11601101/09/2020 at 3:35 PM #116309with the help of PRT, we finally recode it to be perfectly the same as the one from the platform, here is the VWAP code:
12345678910111213141516171819202122232425262728293031//PRC_VWAP intraday//SAME VERSION AS THE ORIGINAL VWAP FROM THE PLATFORM//09.01.2020//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledgeif day<>day[1] thend=0elsed=d+1if volume >0 thenVWAP = SUMMATION[d](volume*typicalprice)/SUMMATION[d](volume)endifsd = std[d](abs(typicalprice-vwap))SDup1 = vwap+sdSDlw1 = vwap-sdSDup2 = vwap+sd*2SDlw2 = vwap-sd*2SDup3 = vwap+sd*3SDlw3 = vwap-sd*3endifif vwap>vwap[1] thencolor = 1elsecolor = -1endifRETURN VWAP coloured by color STYLE(LINE,2) as "VWAP", SDup1 coloured(102,102,102) STYLE(DOTTEDLINE,1) as "upper 1 STD", SDlw1 coloured(102,102,102) STYLE(DOTTEDLINE,1) as "lower 1 STD", SDup2 coloured(102,102,102) STYLE(DOTTEDLINE,1) as "upper 2 STD", SDlw2 coloured(102,102,102) STYLE(DOTTEDLINE,1) as "lower 2 STD", SDup3 coloured(102,102,102) STYLE(DOTTEDLINE,1) as "upper 3 STD", SDlw3 coloured(102,102,102) STYLE(DOTTEDLINE,1) as "lower 3 STD"Make sure to have sufficient bars on your chart for the calculation to perfectly match the original VWAP indicator.
5 users thanked author for this post.
01/26/2020 at 3:00 AM #11785111/15/2020 at 7:12 AM #15053801/19/2021 at 11:19 PM #158591Hi Nicolas,
With the code you published, the VWAP is now almost similar to the native indicator in PRT (there are still some minor discrepencies I don’t understand).
However, the bands remain totally different. My point is that I prefer the native indicator bands rather than the standard deviations bands you coded. Do you have more information about the way they coded these bands?Thanks.
01/20/2021 at 10:38 AM #158639@BizzTrade: Time Anchored VWAP
@screbassa I’m trying to understand why it doesn’t look the same as before in v11 and let you know..1 user thanked author for this post.
04/11/2021 at 5:06 PM #166785Hello Nicolas,
Have you found why your custom code for the vwap bands and the native indicator doesn’t match? I think there are bugs at least when there is no volume in the CFD at some part of the day (holidays, or before future openings). See for example the 6 April on Dax CFD “Allemagne 30 Cash (5€)”
-
AuthorPosts
Find exclusive trading pro-tools on