Epuisement via CVD Cumulative Volume Delta

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #234980 quote
    Alai-n
    Participant
    Veteran

    Bonjour, je viens solliciter de l’aide pour faire évoluer un code déjà existant via le CVD. Ci-joint le code déjà existant et qques photos de ce qu’il devrait faire ressortir.

    Le code ci-joint permet de faire apparaitre les configurations d’épuisements via le CVD Cumulative Volume Delta. Cependant tel que le code est écrit, on se retrouve avec la tête dans le guidon. Je souhaiterais une écriture du code qui permette de prendre un peu de distance, une visualisation en profondeur des fluctuations du marché.

    C’est pour quoi après avoir testé tout un tas de protocole avec des indicateurs chartistes et techniques MA, RSi etc… Je me suis arrêté sur les cycles qu’offrent le MACD.

    Il s’agirait donc de rechercher des configurations d’EPUISEMENT sur le CVD, mais seulement au cœur de deux vagues successives sur la MACD[12.26.9](close) <> 0… La valeur du MACD n’ a aucune importance dans le calcul, seule le Close sur le prix et le Close sur le CVD comptent.

    La visualisation me parait assez claire sur les images jointes, mais je reste bien sûr disponible, si mon explication écrite ne vous paraissez pas assez limpide.

    Par avance Merci

    // "Cumulative Volume Delta Epuisement"
    ////////////////////////////////////////////////////////////////////////////
    
    ////////////////////////////////////////////////////////////////////////////
    //"Cumulative Delta" (by Nicolas/ProRealcode)
    ////////////////////////////////////////////////////////////////////////////
    //U1
    if(close>=open and (close-open+2*(high-close)+2*(open-low)))>0 then
    U1= volume*(high-low)/(close-open+2*(high-close)+2*(open-low))
    else
    U1=0.0
    endif
    //D1
    if(close<open and (open-close+2*(high-open)+2*(close-low)))>0 then
    D1 = volume*(high-low)/(open-close+2*(high-open)+2*(close-low))
    else
    D1=0.0
    endif
    ////////////////////////////////////////////////////////////////////
    //Delta
    if(close>=open) then
    Delta= U1
    else
    Delta= -D1
    endif
    ////////////////////////////////////////////////////////////////////
    if barindex>1 then
    cumDelta=(cumDelta[1])+Delta
    
    if close>=open then
    hi= cumDelta
    else
    hi =cumDelta[1]
    endif
    if close<=open then
    lo= cumDelta
    else
    lo=cumDelta[1]
    endif
    //drawcandle(cumDelta[1], hi, lo, cumDelta)
    endif
    ////////////////////////////////////////////////////////////////////////////
    //
    //Variables :
    //
    MinBarRange = 1
    Rge         = Averagetruerange[10](close)
    //
    Once ShiftText = 3
    //
    CVDMax = cumDelta < cumDelta[1] and cumDelta[1] > cumDelta[2]
    CVDMin = cumDelta > cumDelta[1] and cumDelta[1] < cumDelta[2]
    //
    CVDR = 0
    //
    ////////////////////////////////////////////////////////////////////////////
    //Epuisement des Vendeurs agressifs = signal haussier
    If CVDMin then
    CVDMin1 = cumDelta[1]
    Close1 = Close[1]
    
    for I = MinBarRange to 40
    If CVDMin[I] then
    CVDMin2 = cumDelta[I+1]
    Close2 = Close[I+1]
    If Close1 <= Close2 and CVDMin1 > CVDMin2 then
    //Drawarrowup(barindex, Low - Rge / ShiftText)coloured("yellow")
    //Drawtext("Epuisement", barindex, Low - Rge / ShiftText / 0.2, SansSerif, Italic, 10)coloured("yellow")
    //Drawsegment (barindex[I], low[I], barindex, low) coloured("yellow")
    CVDR = 2
    endif
    break
    endif
    next
    endif
    
    //Epuisement des Acheteurs agressifs = signal baissier
    If CVDMax then
    CVDMax1 = cumDelta[1]
    Close1 = Close[1]
    
    for I = MinBarRange to 40
    If CVDMax[I] then
    CVDMax2 = cumDelta[I+1]
    Close2 = Close[I+1]
    If Close1 >= Close2 and CVDMax1 < CVDMax2 then
    //Drawarrowdown(barindex, High + Rge / ShiftText)coloured("gray")
    //Drawtext("Epuisement", barindex, High + Rge / ShiftText / 0.2, SansSerif, Italic, 10)coloured("gray")
    //Drawsegment (barindex[I], high[I], barindex, high) coloured("gray")
    CVDR = -2
    endif
    break
    endif
    next
    endif
    
    
    ////////////////////////////////////////////////////////////////////////////
    Return CVDR as "CVDR"
    ////////////////////////////////////////////////////////////////////////////
    #235018 quote
    Iván González
    Moderator
    Master

    Voici ce code de base pour que vous puissiez travailler avec vous. Dans le code, vous pouvez voir les valeurs minimales du prix, MACD et DeltaCum. Lorsque l'histogramme est positif, il est analysé s'il y a divergence ou non.

    //--------------------------------------------------------//
    //"Cumulative Delta" (by Nicolas/ProRealcode)
    //--------------------------------------------------------//
    //U1
    if(close>=open and (close-open+2*(high-close)+2*(open-low)))>0 then
    U1= volume*(high-low)/(close-open+2*(high-close)+2*(open-low))
    else
    U1=0.0
    endif
    //D1
    if(close<open and (open-close+2*(high-open)+2*(close-low)))>0 then
    D1 = volume*(high-low)/(open-close+2*(high-open)+2*(close-low))
    else
    D1=0.0
    endif
    //--------------------------------------------------------//
    //Delta
    if(close>=open) then
    Delta= U1
    else
    Delta= -D1
    endif
    //--------------------------------------------------------//
    if barindex>1 then
    cumDelta=(cumDelta[1])+Delta
    
    if close>=open then
    hi= cumDelta
    r=255
    g=255
    b=255
    else
    hi =cumDelta[1]
    endif
    if close<=open then
    lo= cumDelta
    r=255
    g=0
    b=0
    else
    lo=cumDelta[1]
    endif
    drawcandle(cumDelta[1], hi, lo, cumDelta) coloured(r,g,b)
    endif
    //--------------------------------------------------------//
    //-----MACD-----------------------------------------------//
    fastema=average[12,1](close)
    slowema=average[26,1](close)
    mymacd=fastema-slowema
    signal=average[9,1](mymacd)
    histo=mymacd-signal
    //--------------------------------------------------------//
    if histo crosses under 0 then
    $priceLow[n+1]=low
    $histoLow[n+1]=histo
    $cumdeltaLow[n+1]=cumdelta
    $barprice[n+1]=barindex
    $barhisto[n+1]=barindex
    $bardelta[n+1]=barindex
    n=n+1
    elsif histo < 0 then
    if low < $pricelow[n] then
    $pricelow[n]=low
    $barprice[n]=barindex
    endif
    if histo < $histolow[n] then
    $histoLow[n]=histo
    $barhisto[n]=barindex
    endif
    if cumdelta < $cumdeltalow[n] then
    $cumdeltaLow[n]=cumdelta
    $bardelta[n]=barindex
    endif
    endif
    //--------------------------------------------------------//
    if n>1 then
    
    divCumdeltaHisto = $cumdeltalow[n]>$cumdeltalow[n-1] and $histolow[n]<$histolow[n-1]
    divPriceCumdelta = $cumdeltalow[n]>$cumdeltalow[n-1] and $pricelow[n]<$pricelow[n-1]
    //-----Divergence Histogram-CumDelta & Price-------------------------//
    if histo crosses over 0 and divCumdeltaHisto and divPriceCumdelta then
    drawarrowup(barindex,$cumdeltalow[n])coloured("lightgreen")
    drawsegment($bardelta[n-1],$cumdeltaLow[n-1],$bardelta[n],$cumdeltaLow[n])coloured("lightgreen")
    //-----Divergence Histogram-CumDelta -----------------------------//
    elsif histo crosses over 0 and divCumdeltaHisto then
    drawarrowup(barindex,$cumdeltalow[n])coloured("orange")
    drawsegment($bardelta[n-1],$cumdeltaLow[n-1],$bardelta[n],$cumdeltaLow[n])coloured("orange")
    //-----Divergence Histogram-Price---------------------------------//
    elsif histo crosses over 0 and divPriceCumdelta then 
    drawarrowup(barindex,$cumdeltalow[n])coloured("yellow")
    drawsegment($bardelta[n-1],$cumdeltaLow[n-1],$bardelta[n],$cumdeltaLow[n])coloured("yellow")
    endif
    
    endif
    //--------------------------------------------------------//
    Return 
    Alai-n thanked this post
    #235150 quote
    Alai-n
    Participant
    Veteran

    Bonjour @Iván et merci pour ce travail.

    Je prends un peu temps pour jeter un œil à tout ça, afin de mieux comprendre le code et identifier d’éventuels dysfonctionnements. Car à première vue il y a de très bons déclenchements, mais aussi de très mauvais 😉 Je reviendrai vers toi la semaine prochaine!

    Encore merci et bon week-end

    #235383 quote
    Alai-n
    Participant
    Veteran

    Bonjour @Iván, bon j’ai mis le temps à comprendre que le code que tu as écrit décliné plusieurs types de configurations de “Divergences”. Ma première lecture était donc mauvaise car ton code fonctionne parfaitement!

    A partir de là, je l’ai simplifié en retirant le bloc entre les lignes 84 à 87, car c’est la partie Price + CumulativeDelta qui m’intéresse le plus! Dans un premier temps les “Epuisements” et dans un deuxième temps ce sera les “Absorptions”.

    Donc, au doigt mouillé, j’ai repris la partie de ton code pour matérialiser les “Epuisements Haussiers”, que j’ai tenté de remodeler pour faire ressortir les “Epuisements Baissiers”. Résultat, j’ai tout cassé, plus rien ne fonctionne, plus rien ne s’affiche !!!

    Aurais-tu une idée ? Merci

    //"Absorption-Epuisement PriceCumDelta" Cycle via MACD
    //--------------------------------------------------------//
    
    //--------------------------------------------------------//
    //"Cumulative Delta" (by Nicolas/ProRealcode)
    //--------------------------------------------------------//
    //U1
    if(close>=open and (close-open+2*(high-close)+2*(open-low)))>0 then
    U1= volume*(high-low)/(close-open+2*(high-close)+2*(open-low))
    else
    U1=0.0
    endif
    //D1
    if(close<open and (open-close+2*(high-open)+2*(close-low)))>0 then
    D1 = volume*(high-low)/(open-close+2*(high-open)+2*(close-low))
    else
    D1=0.0
    endif
    //--------------------------------------------------------//
    //Delta
    if(close>=open) then
    Delta= U1
    else
    Delta= -D1
    endif
    //--------------------------------------------------------//
    if barindex>1 then
    cumDelta=(cumDelta[1])+Delta
     
    if close>=open then
    hi= cumDelta
    r=255
    g=255
    b=255
    else
    hi =cumDelta[1]
    endif
    if close<=open then
    lo= cumDelta
    r=255
    g=0
    b=0
    else
    lo=cumDelta[1]
    endif
    drawcandle(cumDelta[1], hi, lo, cumDelta) coloured(r,g,b)
    endif
    //--------------------------------------------------------//
    //-----MACD-----------------------------------------------//
    fastema=average[12,1](close)
    slowema=average[26,1](close)
    mymacd=fastema-slowema
    signal=average[9,1](mymacd)
    histo=mymacd-signal
    //--------------------------------------------------------//
    if histo crosses under 0 then
    
    $priceLow[n+1]=low
    $histoLow[n+1]=histo
    $cumdeltaLow[n+1]=cumdelta
    $barprice[n+1]=barindex
    $barhisto[n+1]=barindex
    $bardelta[n+1]=barindex
    n=n+1
    
    elsif histo < 0 then
    
    if low < $pricelow[n] then
    $pricelow[n]=low
    $barprice[n]=barindex
    endif
    if histo < $histolow[n] then
    $histoLow[n]=histo
    $barhisto[n]=barindex
    endif
    if cumdelta < $cumdeltalow[n] then
    $cumdeltaLow[n]=cumdelta
    $bardelta[n]=barindex
    endif
    endif
    //--------------------------------------------------------//
    if histo crosses over 0 then
    
    $priceHigh[n+1]=high
    $histoHigh[n+1]=histo
    $cumdeltaHigh[n+1]=cumdelta
    $barprice[n+1]=barindex
    $barhisto[n+1]=barindex
    $bardelta[n+1]=barindex
    n=n+1
    
    elsif histo > 0 then
    
    if high < $pricehigh[n] then
    $pricehigh[n]=high
    $barprice[n]=barindex
    endif
    if histo < $histohigh[n] then
    $histoHigh[n]=histo
    $barhisto[n]=barindex
    endif
    if cumdelta < $cumdeltahigh[n] then
    $cumdeltahigh[n]=cumdelta
    $bardelta[n]=barindex
    endif
    endif
    //--------------------------------------------------------//
    if n>1 then
    
    //----- Epuisement Up-------------------------------------------------//
    divPriceCumdeltaEU = $cumdeltalow[n]>$cumdeltalow[n-1] and $pricelow[n]<$pricelow[n-1]
    //-----Divergence CumDelta & Price------------------------------------//
    if histo crosses over 0 and divPriceCumdeltaEU then
    drawarrowup(barindex,$cumdeltalow[n])coloured("lightgreen")
    drawsegment($bardelta[n-1],$cumdeltaLow[n-1],$bardelta[n],$cumdeltaLow[n])coloured("lightgreen")
    //-----Divergence Histogram-Price---------------------------------//
    elsif histo crosses over 0 and divPriceCumdeltaEU then
    drawarrowup(barindex,$cumdeltalow[n])coloured("yellow")
    drawsegment($bardelta[n-1],$cumdeltaLow[n-1],$bardelta[n],$cumdeltaLow[n])coloured("yellow")
    endif
    endif
    //--------------------------------------------------------//
    if n>1 then
    
    //----- Epuisement Down------------------------------------------------//
    divPriceCumdeltaED = $cumdeltahigh[n]<$cumdeltahigh[n-1] and $pricehigh[n]>$pricehigh[n-1]
    //-----Divergence CumDelta & Price------------------------------------//
    if histo crosses under 0 and divPriceCumdeltaED then
    drawarrowdown(barindex,$cumdeltahigh[n])coloured("lightgreen")
    drawsegment($bardelta[n-1],$cumdeltahigh[n-1],$bardelta[n],$cumdeltahigh[n])coloured("red")
    //-----Divergence Histogram-Price---------------------------------//
    elsif histo crosses under 0 and divPriceCumdeltaED then
    drawarrowdown(barindex,$cumdeltahigh[n])coloured("yellow")
    drawsegment($bardelta[n-1],$cumdeltahigh[n-1],$bardelta[n],$cumdeltahigh[n])coloured("yellow")
    endif
    endif
    
    //--------------------------------------------------------//
    Return
    //--------------------------------------------------------//
    
    #235385 quote
    Iván González
    Moderator
    Master

    Bonjour, je vois que vous avez ajouté les lignes 82-106. Vérifiez les symboles > et < car je pense que vous avez fait une erreur. Par exemple, la ligne 94 devrait être if high > $pricehigh[n] then .

    #235388 quote
    Alai-n
    Participant
    Veteran

    Ce n’est pas ça ! J’ai modifié les lignes 94, 98 et 102 par “>” et cela ne fonctionne toujours pas !

    Par contre si retire tout ce que j’ai rajouté dans le code et bien ce que toi tu as fait refonctionne 😉

    #235705 quote
    Alai-n
    Participant
    Veteran

    Up

    Je relance ce post, car après modifications le code ne fonctionne toujours pas ! Merci

    #235880 quote
    Alai-n
    Participant
    Veteran

    UP

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

Epuisement via CVD Cumulative Volume Delta


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Alai-n @alai-n Participant
Summary

This topic contains 7 replies,
has 2 voices, and was last updated by Alai-n
1 year, 6 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 07/09/2024
Status: Active
Attachments: 4 files
Logo Logo
Loading...