Points pivot avec une enveloppe dans un seul graphique

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #7295 quote
    Carl
    Participant
    Average

    Ci-dessous une demande qui a été envoyée à ProRealTime :

    Je souhaite ajouter le point pivot hebdo et mensuel à mon code point pivot journalier avec une enveloppe pour afficher les différents points pivots sur le même graphique. Quelles sont les valeurs/variables à ajouter au programme pour ces 2 pivots ?

    //+———————————+
    //|           PIVOT DAILY           |
    //+———————————+

    BS = DLOW(1)
    HT = DHIGH(1)
    C  = DCLOSE(1)

    PIVOTH = PIVOT*(1+CO*0.01)
    PIVOT  = (BS+HT+C)/3
    PIVOTB = PIVOT*(1-CO*0.01)

    RETURN PIVOTH AS “PIVOT DAILY_HAUT”, PIVOT AS “PIVOT DAILY”, PIVOTB AS “PIVOT DAILY_BAS”

    //+———————————+

     

    Et une proposition de réponse pour le point pivot journalier :

    REM Points Pivots +
    Pivot=1
    
    // Formule en fonction de la valeur du paramètre Pivot
    IF Pivot=2 THEN
    // Point pivot : P = (Hveille + Bveille + Cveille + Ojour) / 4
    P = (DHIGH(1) + DLOW(1) + DCLOSE(1) + DOPEN(0)) / 4
    ELSIF Pivot=3 THEN
    // Point pivot : P = (Hveille + Bveille + Ojour) / 3
    P = (DHIGH(1) + DLOW(1) + DOPEN(0)) / 3
    ELSE
    // Point pivot : P = (Hveille + Bveille + Cveille) / 3
    P = (DHIGH(1) + DLOW(1) + DCLOSE(1)) / 3
    ENDIF
    
    // Résistance 3 : R3 = Hveille + 2*(P - Bveille)
    PR3 = DHIGH(1) + 2*(P - DLOW(1))
    
    // Résistance 2 : R2 = P + (Hveille - Bveille)
    PR2 = P + (DHIGH(1) - DLOW(1))
    
    // Résistance 1 : R1 = 2 * P - Bveille
    PR1 = 2 * P - DLOW(1)
    
    // Support 1 : S1 = 2 * P - Hveille
    PS1 = 2 * P - DHIGH(1)
    
    // Support 2 : S2 = P - (Hveille - Bveille)
    PS2 = P - (DHIGH(1) - DLOW(1))
    
    // Support 3 : S3 = Bveille)- 2*(Hveille - p)
    PS3= Low[1]-2*(High[1]-P)
    
    RETURN PR3 COLOURED(0,180,0) AS "Res3" , PR2 COLOURED(0,0,255) AS "Res2" , PR1 COLOURED(155,0,155) AS "Res1" ,P COLOURED(0,0,0) AS "Pivot" , PS1 COLOURED(155,0,155) AS "Sup1" , PS2 COLOURED(0,0,255) AS "Sup2" , PS3 COLOURED(0,180,0) AS "Sup3"

     

    Et une proposition de réponse pour le point pivot hebdomadaire :

     

    Pivot=1
    
    if dayofweek < dayofweek[1] then
    hveille=myH
    Bveille=myB
    Cveille=close[1]
    Oveille=Oday
    myH=high
    myB=Low
    Oday=open
    else
    myH=max(high,myH)
    myB=min(Low,myB)
    endif
    
    // Formule en fonction de la valeur du paramètre Pivot
    IF Pivot=2 THEN
    // Point pivot : P = (Hveille + Bveille + Cveille + Ojour) / 4
    P = (Hveille + Bveille + Cveille + Oveille) / 4
    ELSIF Pivot=3 THEN
    // Point pivot : P = (Hveille + Bveille + Ojour) / 3
    P = (Hveille + Bveille + Oveille) / 3
    ELSE
    // Point pivot : P = (Hveille + Bveille + Cveille) / 3
    P = (Hveille + Bveille + Cveille) / 3
    ENDIF
    MyR3=Hveille + 2*(P - Bveille)
    myR2 = P + (Hveille - Bveille)
    myR1 = 2 * P - Bveille
    myS1 = 2 * P - Hveille
    myS2 = P - (Hveille - Bveille)
    myS3= Bveille-2*(Hveille-P)
    
    return myR3 as "R3",myR2 as "R2",myR1 as "R1", P as "Pivot",myS1 as "S1",myS2 as "S2",myS3 as "S3"

     

    Et une proposition de réponse pour le point pivot mensuel :

     

    Pivot=1 //change this variable to change the calcul of pivot points
    
    if openmonth <> openmonth[1] then
    mylastHigh=myhigh
    mylastlow=mylow
    mylastclose=close[1]
    myhigh=high
    mylow=low
    myopen=open
    else
    myhigh=max(myhigh,high)
    mylow=min(mylow,low)
    endif
    
    // Formule en fonction de la valeur du paramètre Pivot
    IF Pivot=2 THEN
    // Point pivot : P = (Hveille + Bveille + Cveille + Ojour) / 4
    P = (mylastHigh + mylastLow + mylastClose + myopen) / 4
    ELSIF Pivot=3 THEN
    // Point pivot : P = (Hveille + Bveille + Ojour) / 3
    P = (mylastHigh + mylastLow + myopen) / 3
    ELSE
    // Point pivot : P = (Hveille + Bveille + Cveille) / 3
    P = (mylastHigh + mylastLow + mylastClose) / 3
    ENDIF
    
    PR1 = (2 * P) - mylastLow
    PR2 = P + ( mylastHigh - mylastLow )
    PR3 = mylasthigh + 2*(P - mylastlow)
    
    PS1 = (2 * P) - mylastHigh
    PS2 = P - ( mylastHigh - mylastLow )
    PS3= mylastlow-2*(mylasthigh-P)
    
    RETURN PR3 COLOURED(0,180,0) AS "Res3" , PR2 COLOURED(0,0,255) AS "Res2" , PR1 COLOURED(155,0,155) AS "Res1" ,P COLOURED(0,0,0) AS "Pivot" , PS1 COLOURED(155,0,155) AS "Sup1" , PS2 COLOURED(0,0,255) AS "Sup2" , PS3 COLOURED(0,180,0) AS "Sup3"
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

Points pivot avec une enveloppe dans un seul graphique


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Carl @carl Participant
Summary

This topic contains 1 voice and has 0 replies.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 05/18/2016
Status: Active
Attachments: No files
Logo Logo
Loading...