en y ayant rajouté trimestriel (quarterly) et semestriel (half yearly) en lignes pointillées:
//PRC_VWAP weekly,monthly,yearly
//28.09.2016
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//
// 14.01.2022 added quarterly and Half-yearly
// JC_Bywan @ www.prorealcode.com
// Sharing ProRealTime knowledge
//calculation periods
if DayOfWeek=0 or (dayofweek[1]=5 and dayofweek<>5) then
weekbar=barindex
endif
if month<>month[1] then
monthbar=barindex
if month[1]=3 or month[1]=6 or month[1]=9 or month[1]=12 then
quarterbar=barindex
endif
if month[1]=6 or month[1]=12 then
semesterbar=barindex
endif
endif
if year<>year[1] then
yearbar=barindex
endif
once dWeekly=1
once dMonthly=1
once dQuarterly=1
once dHalfyearly=1
once dYearly=1
dWeekly = max(dWeekly, barindex-weekbar)
dMonthly = max(dMonthly, barindex-monthbar)
dQuarterly = max(dQuarterly, barindex-quarterbar)
dHalfyearly = max(dHalfyearly, barindex-semesterbar)
dYearly = max(dYearly, barindex-yearbar)
VWAPweekly = SUMMATION[dWeekly](volume*typicalprice)/SUMMATION[dWeekly](volume)
VWAPmonthly = SUMMATION[dMonthly](volume*typicalprice)/SUMMATION[dMonthly](volume)
VWAPquarterly = SUMMATION[dQuarterly](volume*typicalprice)/SUMMATION[dQuarterly](volume)
VWAPhalfyearly = SUMMATION[dHalfyearly](volume*typicalprice)/SUMMATION[dHalfyearly](volume)
VWAPyearly = SUMMATION[dYearly](volume*typicalprice)/SUMMATION[dYearly](volume)
RETURN VWAPweekly as "VWAP Weekly", VWAPmonthly style(line,2) as "VWAP Monthly", VWAPquarterly style(dottedline,1) as "VWAPquarterly", VWAPhalfyearly style(dottedline,2) as "VWAPhalfyearly", VWAPyearly style(line,3) as "VWAP Yearly"
Les differentes vwap apparaissent dans une fenêtre distincte ( voir piece jointe ) . J’aimerai qu’elles soient représentées sur le graphique directement si c est possible. Ca me permettre de rester concentrer sur le graphique prix avec les vwap inclues.
c’est bel et bien un code à mettre dans la fenêtre des prix, mais pour ce faire ça ne dépend pas du code, c’est à l’utilisateur de placer l’indicateur dans la fenêtre du prix plutôt qu’en-dessous. Voici la manip à faire décrite dans cette courte vidéo:
Les vwaps ne sont pas « anchored » à chaque début de période avec les lignes de codes que j ai copié au dessus.
J ai comparé avec les Vwap sur la plateforme Américaine Think or Swim
qui elles, se remettent à 0 ( c est à dire au close du premier chandelier de chaque début de time frame ).
Les vwaps ne sont pas « anchored » à chaque début de période avec les lignes de codes que j ai copié au dessus.
J ai comparé avec les Vwap sur la plateforme Américaine Think or Swim
qui elles, se remettent à zéro ( c est à dire au close du premier chandelier de chaque début de time frame ).
Dans le code ci-dessous où l’option du choix du type de Vwap a été rajoutée, mettre la variable “anchored” réglée sur =0 pour du Vwap “classique” (code précédent), ou la mettre =1 si on veut du vwap “anchored”. Je le poste avec pré-réglage sur 1 :
//PRC_VWAP weekly,monthly,yearly
//28.09.2016
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//
// 14.01.2022 added quarterly and Half-yearly
// 24.01.2022 added anchored option
// JC_Bywan @ www.prorealcode.com
// Sharing ProRealTime knowledge
once anchored=1 // 0 //choose 0 (not anchored) or 1 (anchored)
once dWeekly=1
once dMonthly=1
once dQuarterly=1
once dHalfyearly=1
once dYearly=1
//calculation periods
if DayOfWeek=0 or (dayofweek[1]=5 and dayofweek<>5) then
weekbar=barindex
endif
if month<>month[1] then
monthbar=barindex
if month[1]=3 or month[1]=6 or month[1]=9 or month[1]=12 then
quarterbar=barindex
endif
if month[1]=6 or month[1]=12 then
semesterbar=barindex
endif
endif
if year<>year[1] then
yearbar=barindex
endif
if anchored then
dWeekly = max(1, barindex-weekbar+1)
dMonthly = max(1, barindex-monthbar+1)
dQuarterly = max(1, barindex-quarterbar+1)
dHalfyearly = max(1, barindex-semesterbar+1)
dYearly = max(1, barindex-yearbar+1)
else
dWeekly = max(dWeekly, barindex-weekbar)
dMonthly = max(dMonthly, barindex-monthbar)
dQuarterly = max(dQuarterly, barindex-quarterbar)
dHalfyearly = max(dHalfyearly, barindex-semesterbar)
dYearly = max(dYearly, barindex-yearbar)
endif
VWAPweekly = SUMMATION[dWeekly](volume*typicalprice)/SUMMATION[dWeekly](volume)
VWAPmonthly = SUMMATION[dMonthly](volume*typicalprice)/SUMMATION[dMonthly](volume)
VWAPquarterly = SUMMATION[dQuarterly](volume*typicalprice)/SUMMATION[dQuarterly](volume)
VWAPhalfyearly = SUMMATION[dHalfyearly](volume*typicalprice)/SUMMATION[dHalfyearly](volume)
VWAPyearly = SUMMATION[dYearly](volume*typicalprice)/SUMMATION[dYearly](volume)
RETURN VWAPweekly as "VWAP Weekly", VWAPmonthly style(line,2) as "VWAP Monthly", VWAPquarterly style(dottedline,1) as "VWAPquarterly", VWAPhalfyearly style(dottedline,2) as "VWAPhalfyearly", VWAPyearly style(line,3) as "VWAP Yearly"
Quand je change de timeframe, par exemple : je passe des chandelier de 1h sur 1 semaine à des chandeliers de 1 jour sur 6 mois :::: les VWAP changent aussi de prix !
C’est pas normal.
Je voudrais trader sur du 1min avec des vwap qui ne changent pas de prixx en fonction de la timeframe svp.
The information collected on this form is stored in a computer file by ProRealCode to create and access your ProRealCode profile. This data is kept in a secure database for the duration of the member's membership. They will be kept as long as you use our services and will be automatically deleted after 3 years of inactivity. Your personal data is used to create your private profile on ProRealCode. This data is maintained by SAS ProRealCode, 407 rue Freycinet, 59151 Arleux, France. If you subscribe to our newsletters, your email address is provided to our service provider "MailChimp" located in the United States, with whom we have signed a confidentiality agreement. This company is also compliant with the EU/Swiss Privacy Shield, and the GDPR.
For any request for correction or deletion concerning your data, you can directly contact the ProRealCode team by email at privacy@prorealcode.com
If you would like to lodge a complaint regarding the use of your personal data, you can contact your data protection supervisory authority.
Get Assistance
Assistance Type
Your Need
Proposed Solutions
Do you like cookies? 🍪 We use cookies to ensure you get the best experience on our website.
(Learn more)