anchored-VWAP début plus haut et plus bas Intraday

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #211701 quote
    Thib2335
    Participant
    Junior

    Bonjour,

    Comme illustré sur l’image attachée, je voudrais ancrer l’indicateur anchored-VWAP au point le plus haut de la journée (ici aVWAP en vert) (et un second aVWAP-Low au plus bas (aVWAP en rouge)). Et ceci de manière dynamique en intraday (départ du calcul première cotation de la journée et lorsque nouveau sommet pendant la journée alors l’ancrage change).

    En pratique cela reviendrais, je pense, à fusionner les deux codes suivants trouver sur prorealcode (qui séparément et manuellement appliqués ont produit l’image) afin d’avoir un traçage automatique des aVWAP dès que l’on sélectionne une valeur :

    -code Indicateurs   High&Low

    -Code Indicateur  anchoredVWAP

    Je sèche pour mettre en relation les coordonnées Highest(dhigh) (ou Lowest(dLow) récupérées dans le premier code High&Low avec les variables startDate et startTime (point d’entrée du code anchoredVWAP). Comment associer/transformer les coordonnées (High/Low) pour les insérer comme point de départ (date et Time) de l’anchored-VWAP?

    Par avance merci pour tout aide.

    DEFPARAM DRAWONLASTBARONLY=true
    DEFPARAM CALCULATEONLASTBARS = 1000
    
    ////variables externes :
    Period = 47
    nb=2
    
    If intradaybarindex then
    
    HighestV = Highest[Period](dhigh(0))
    LowestV = Lowest[Period](dlow(0))
    
    if IsLastBarUpdate then
     
    For j = 1 To nb do
    
    for i = 0 To Period-1 do
    
    IF High[period*(j-1)+i]=HighestV[(j-1)*period] Then
    HighestI = BarIndex[period*(j-1)+i]
    DRAWTEXT(HighestV[(j-1)*period], HighestI, HighestV[(j-1)*period]+0.5, Dialog, Standard, 12) COLOURED(0,255,0)
    DRAWARROWDOWN(HighestI,HighestV[(j-1)*period]+0.25) COLOURED(0,255,00)
    endif
    
    IF Low[period*(j-1)+i]=LowestV[(j-1)*period] Then
    LowestI = BarIndex[period*(j-1)+i]
    DRAWTEXT(LowestV[(j-1)*period], LowestI, LowestV[(j-1)*period]-0.5, Dialog, Standard, 12) COLOURED(200,0,0)
    DRAWARROWUP(LowestI,LowestV[(j-1)*period]-0.25) COLOURED(255,0,00)
    endif
     
    next
    DRAWRECTANGLE(barindex[j*(period)]+1, LowestV[(j-1)*period], barindex[(j-1)*period], HighestV[(j-1)*period])
    next
    
    endif
    endif
    RETURN
    //_________________________________HIGH-anchored-VWAP___________________
    //variables externes : 
    startDateH = 20230317
    startTimeH = 071500
    
    //variable
    highVWAP=undefined
    
    if opendate=startDateH and opentime=startTimeH then
    startbar=barindex
    barcount=1
    endif
    
    if barcount>=1 then
    
    barcount=barindex-startbar+1
    d = max(1, barcount)
    highVWAP = SUMMATION[d](volume*typicalprice)/SUMMATION[d](volume)
    
    if highVWAP>highVWAP[1] then
    color = 1
    else
    color = -1
    endif
    endif
    
    RETURN highVWAP coloured by color as "highAVWAP"
    HighLow_anchoredVWAP.png HighLow_anchoredVWAP.png
    #211773 quote
    Nicolas
    Keymaster
    Master

    Le code ci-dessous ancre son calcul de VWAP sur les plus haut et plus bas de la journée.

    if intradaybarindex=0 then 
    hh=high
    ll=low
    endif 
    
    hh=max(hh,high)
    ll=min(ll,low)
    if hh>hh[1] then 
    starthh=barindex
    endif 
    if ll<ll[1] then 
    startll=barindex
    endif 
    
    hhbars=max(1,barindex-starthh)
    highVWAP = SUMMATION[hhbars](volume*typicalprice)/SUMMATION[hhbars](volume)
    
    llbars=max(1,barindex-startll)
    lowVWAP = SUMMATION[llbars](volume*typicalprice)/SUMMATION[llbars](volume)
    
    RETURN highVWAP coloured ("green"), lowvwap coloured("red")

    Cela me fait penser à un autre indicateur qui ancre ses VWAP sur les derniers plus haut et bas: https://market.prorealcode.com/product/swing-vwap/

    vwap-high-and-low-daily.png vwap-high-and-low-daily.png
    #211816 quote
    Thib2335
    Participant
    Junior

    Génial …Merci beaucoup Nicolas, je vais tester tout de suite ce code sur différentes valeurs/marchés.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

anchored-VWAP début plus haut et plus bas Intraday


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Thib2335 @thib2335 Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Thib2335
2 years, 12 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 03/17/2023
Status: Active
Attachments: 2 files
Logo Logo
Loading...