VWAP en Semestre

Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • #184454 quote
    Maximedemonts
    Participant
    New

    Bonjour à tous,

    J aimerai pouvoir utiliser la vwap Semestre ( 6 mois ) dans mon trading. La première de janvier à juin et la deuxième de juillet à décembre.

    Je vois qu’il y a déjà eu des demandes pour la vwap annuelle mensuelle hebdomadaire mais pas semestrielle.

     

    Merci

    #185464 quote
    Maximedemonts
    Participant
    New

    Bonjour j aimerai utiliser la vwap trimestriel et semestriel sur mon graphique intraday.

    #185501 quote
    JC_Bywan
    Moderator
    Master

    Bonjour,

    Voici une adaptation du code de Nicolas (hebdo/mensuel/annuel en lignes pleines) dans la library:

    VWAP Weekly Monthly & Yearly

    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"
    #185856 quote
    Maximedemonts
    Participant
    New

    Bonsoir.

    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.

     

    Merci

     

    Maxime

    Capture-decran-347.png Capture-decran-347.png
    #185865 quote
    JC_Bywan
    Moderator
    Master

    Bonsoir,

    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:

    Maximedemonts thanked this post
    #185880 quote
    Maximedemonts
    Participant
    New

    Merci !

    #186183 quote
    Maximedemonts
    Participant
    New

    Bonjour

     

    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 ).

    J aimerai qu elles le soient sur PRT.

    merci

    #186491 quote
    Maximedemonts
    Participant
    New

    Bonjour

     

    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 ).

    J aimerai qu elles le soient sur PRT.

    merci

    #186503 quote
    JC_Bywan
    Moderator
    Master

    Bonjour,

    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"
    #192727 quote
    Maximedemonts
    Participant
    New

    Merci pour le code.

    Je l ai mis en application.

    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.

    #192740 quote
    Nicolas
    Keymaster
    Master

    Essayons avec cette version:

    timeframe(monthly)
    if month<>month[1] then
    d=0
    else
    d=d+1
    endif
    
    VWAP = SUMMATION[max(1,d)](volume*typicalprice)/SUMMATION[max(1,d)](volume)
    
    return vwap
    
    #192741 quote
    Maximedemonts
    Participant
    New

    Je l implante sur le graphique et rien ne s’affiche.

    #192746 quote
    Nicolas
    Keymaster
    Master

    est-ce que le début du mois est présent sur le graphique ? C’est nécessaire 🙂

    #192748 quote
    Maximedemonts
    Participant
    New

    Voila le résultat.

    Pro real code et thinkorSswim TD Ameritrade

     

    Pas le même prix et une ligne en dent de scie. Votre Vwap mensuel est la verte. La jaune est la journalière. Sur ThinkorSwim elle est violette.

    Vous voyez bien qu il y a un fossé entre les deux.

    Capture-decran-1025.png Capture-decran-1025.png
    #192750 quote
    Maximedemonts
    Participant
    New

    Voici la photo de pro realtime

    Capture-decran-1024.png Capture-decran-1024.png
Viewing 15 posts - 1 through 15 (of 21 total)
  • You must be logged in to reply to this topic.

VWAP en Semestre


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
Summary

This topic contains 20 replies,
has 4 voices, and was last updated by Nicolas
3 years, 3 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 01/03/2022
Status: Active
Attachments: 3 files
Logo Logo
Loading...