vwap Weekly
Forums › ProRealTime English forum › ProBuilder support › vwap Weekly
- This topic has 6 replies, 4 voices, and was last updated 5 years ago by Nicolas.
Tagged: vwap, Weekly vWap
-
-
11/07/2018 at 12:57 PM #84323
Is it possible to have the code of vwap that starts its value at the begin of the week (for any time frame), in alternative starts in a fixed day. thanks
11/07/2018 at 1:34 PM #8432611/07/2018 at 4:17 PM #84339Non mi funziona se prendo solo la parte del codice che riguarda la settimana non ho il valore corretto e se provo a costruire le bande a più dev.std (altro obiettivo) non da risultati corretti.
It does not work if I take only the part of the code that concerns the week I do not have the correct value and if I try to build the bands with several dev.std’s (other objective) it does not return correct results.
11/07/2018 at 4:27 PM #84343Gabriele Battista – English only in the English speaking forum please. Please post in the Italian speaking forum if you want to communicate in Italian.
11/07/2018 at 11:08 PM #8437111/08/2018 at 9:28 AM #84394You can simply make the two unnecessary lines INVISIBLE using the properties of the indicator, once installed on the chart, without changing the code workings. Just replace the RETURN line to get rid of STYLE:
1RETURN VWAPweekly as "VWAP Weekly", VWAPmonthly as "VWAP Monthly", VWAPyearly as "VWAP Yearly"As for bands, you did not tell about your error, But there’s no reason not to be able to draw as many bands as you want (Band2UP/Band2DN, …), this is the same code modified (without removing any original calculation), with just 1 band and the RETURN line reflecting that addition:
1234567891011121314151617181920212223242526272829//PRC_VWAP weekly,monthly,yearly//28.09.2016//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledgedefparam calculateonlastbars=10000//calculation periodsif DayOfWeek=0 or (dayofweek[1]=5 and dayofweek<>5) thenweekbar=barindexendifif month<>month[1] thenmonthbar=barindexendifif year<>year[1] thenyearbar=barindexendifonce dWeekly = 1once dMonthly = 1once dYearly = 1dWeekly = max(dWeekly, barindex-weekbar)dMonthly = max(dMonthly, barindex-monthbar)dYearly = max(dYearly, barindex-yearbar)VWAPweekly = SUMMATION[dWeekly](volume*typicalprice)/SUMMATION[dWeekly](volume)VWAPmonthly = SUMMATION[dMonthly](volume*typicalprice)/SUMMATION[dMonthly](volume)VWAPyearly = SUMMATION[dYearly](volume*typicalprice)/SUMMATION[dYearly](volume)Band1UP = VWAPweekly + ((std[20](VWAPweekly)) * 2.0) //UPPER bandBand1DN = VWAPweekly - ((std[20](VWAPweekly)) * 2.0) //UPPER bandRETURN VWAPweekly as "VWAP Weekly", VWAPmonthly as "VWAP Monthly", VWAPyearly as "VWAP Yearly",Band1UP,Band1DN11/08/2018 at 9:55 AM #84398Standard deviation bands calculation of VWAP can be found in this indicator: VWAP intraday
-
AuthorPosts