formulation EMA (moyenne mobile exponentielle)

Viewing 5 posts - 31 through 35 (of 35 total)
  • Author
    Posts
  • #96290 quote
    SharkShark
    Participant
    Senior

    J’ai fait une capture d’écran avec explication pour être le plus clair possible en espérant que cela vous aide.

    Exemple.jpg Exemple.jpg
    #96369 quote
    SharkShark
    Participant
    Senior

    Alors je pense avoir réussi, à force de calcul et tâtonnement la formule 1, la formule est une usine à gaz mais bon ça semble fonctionner à confirmer.

    defparam drawonlastbaronly=true
    
    //Calcul DEMA[12]
    N1 = 12
    indic1 = ExponentialAverage[12](close)
    indic2 = ExponentialAverage[12](indic1)
    A = indic1[1]
    B = indic2[1]
    
    Lox = 2*A*(N1+1)*(N1+1)-6*A*(N1+1)+4*A-B*(N1+1)*(N1+1)+2*B*(N1+1)
    Lox1 = ((N1+1)*(N1+1))
    
    //Calcul DEMA[26]
    N2 = 26
    indic3 = ExponentialAverage[26](close)
    indic4 = ExponentialAverage[26](indic3)
    C = indic3[1]
    D = indic4[1]
    
    Fast = 2*C*(N2+1)*(N2+1)-6*C*(N2+1)+4*C-D*(N2+1)*(N2+1)+2*D*(N2+1)
    Fast1 = ((N2+1)*(N2+1))
    
    //Calcul MACD ZEROLAG bougie[1]
    z11 = DEMA[12](close)
    z22 = DEMA[26](close)
    f = z11[1] - z22[1]
    
    //Calcul de y pour que MACD ZR - MACDZR[1] = 0 soit e - f =0
    
    y = ((f*Lox1*Fast1)+lox1*Fast-Fast1*Lox)/((4*Fast1*((N1+1)-1))-(4*lox1*((N2+1)-1)))
    
    //Renvoie la velaur de y pour e = f
    DRAWTEXT("                                                                     ----------    #y#  MACD ZR Reverse",barindex,y,dialog,standard,13) coloured(0,0,204)
    
    return
    #96381 quote
    VonasiVonasi
    Moderator
    Master

    Il est difficile pour moi de suivre ce sujet avec précision avec Google Translate, mais c'est peut-être intéressant: https://www.prorealcode.com/topic/how-to-calculate-rsi2-at-a-price/

    Shark thanked this post
    #96549 quote
    SharkShark
    Participant
    Senior

    Voilà le code qui répond aux 2 formules, pour moi cela fonctionne à confirmer avec un peu de temps

    Merci pour votre aide qui m’a permis d’y parvenir

    defparam drawonlastbaronly=true
    x = close
    //Calcul DEMA[12]
    indic1 = ExponentialAverage[12](close)
    indic2 = ExponentialAverage[12](indic1)
    A = indic1[1]
    B = indic2[1]
    
    Lox = 264*A-143*B
    
    //Calcul DEMA[26]
    indic3 = ExponentialAverage[26](close)
    indic4 = ExponentialAverage[26](indic3)
    C = indic3[1]
    D = indic4[1]
    
    Fast = 1300*C-675*D
    
    //Calcul MACD ZERO LAG bougie courante
    e = x*(17416/123201)+264/169*A-11/13*B-1300/729*C+25/27*D
    
    //Calcul DEMA[9](e)
    indic5 = ExponentialAverage[9](e)
    indic6 = ExponentialAverage[9](indic5)
    I = indic5[1]
    J = indic6[1]
    
    Sign = 144*I-80*J
    
    //Calcul MACD ZEROLAG bougie[1]
    z11 = DEMA[12](close)
    z22 = DEMA[26](close)
    f = z11[1] - z22[1]
    
    //Calcul de y pour que MACD ZR - MACDZR[1] = 0 soit e - f =0
    
    y = (f*123201+169*Fast-729*Lox)/17416
    
    //Calcul de z pour que MACD ZR - Signal soit e = z3
    z = (9*Lox/4225-36*Fast/72900+Sign/100-264/169*A+11/13*B+1300/729*C-25/27*D)/(17416/123201-435400/8555625)
    
    //Renvoie la valeur de y pour e = flag
    DRAWTEXT(" ---------- #z# MACD ZeroLag Reverse",barindex,y,dialog,standard,13) coloured(204,0,0)
    DRAWTEXT(" ---------- #z# MACD Signal Reverse",barindex,z,dialog,standard,13) coloured(51,204,0)
    return
    Nicolas thanked this post
    #96554 quote
    SharkShark
    Participant
    Senior
    defparam drawonlastbaronly=true
    x = close
    //Calcul DEMA[12]
    indic1 = ExponentialAverage[12](close)
    indic2 = ExponentialAverage[12](indic1)
    A = indic1[1]
    B = indic2[1]
    
    Lox = 264*A-143*B
    
    //Calcul DEMA[26]
    indic3 = ExponentialAverage[26](close)
    indic4 = ExponentialAverage[26](indic3)
    C = indic3[1]
    D = indic4[1]
    
    Fast = 1300*C-675*D
    
    //Calcul MACD ZERO LAG bougie courante
    e = x*(17416/123201)+264/169*A-11/13*B-1300/729*C+25/27*D
    
    //Calcul DEMA[9](e)
    indic5 = ExponentialAverage[9](e)
    indic6 = ExponentialAverage[9](indic5)
    I = indic5[1]
    J = indic6[1]
    
    Sign = 144*I-80*J
    
    //Calcul MACD ZEROLAG bougie[1]
    z11 = DEMA[12](close)
    z22 = DEMA[26](close)
    f = z11[1] – z22[1]
    
    //Calcul de y pour que MACD ZR – MACDZR[1] = 0 soit e – f =0
    
    y = (f*123201+169*Fast-729*Lox)/17416
    
    //Calcul de z pour que MACD ZR – Signal soit e = z3
    z = (9*Lox/4225-36*Fast/72900+Sign/100-264/169*A+11/13*B+1300/729*C-25/27*D)/(17416/123201-435400/8555625)
    
    //Renvoie la valeur de y pour e = flag
    DRAWTEXT(” ———- #z# MACD ZeroLag Reverse”,barindex,y,dialog,standard,13) coloured(204,0,0)
    DRAWTEXT(” ———- #z# MACD Signal Reverse”,barindex,z,dialog,standard,13) coloured(51,204,0)
    return
    Nicolas thanked this post
    Prog.jpg Prog.jpg
Viewing 5 posts - 31 through 35 (of 35 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

formulation EMA (moyenne mobile exponentielle)


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Shark @shark Participant
Summary

This topic contains 34 replies,
has 4 voices, and was last updated by SharkShark
7 years, 6 months ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 04/10/2019
Status: Active
Attachments: 7 files
ProRealCode ProRealCode
Loading...