MACD[12,26,9] ?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #250133 quote
    umrkumrk
    Participant
    New

    Suite à ma découverte sur le RSI6, qui utilise la moyenne de Wilder, j’ai maintenant des doutes sur le MACD. Utilise-t-il en standard également des moyennes exotiques ? Si oui, comment puis-je obtenir le MACD qui m’intéresse, avec la moyenne standard ?

    #250135 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Bonjour. Dans ce code, tu peux voir la programmation du MACD par défaut. Des moyennes exponentielles sont utilisées.

    matype = 1 //0=SMA, 1=EMA, 2=WMA, 3=Wilder, 4=Triangular, 5=EndPoint, 6=TimeSeries, 7=Hull, 8=ZeroLag
    MEDRAP = Average[12,matype](close)
    MEDLEN = Average[26,matype](close)
    miMACD = MEDRAP - MEDLEN
    
    SENYAL = Average[9,matype](miMACD)
    
    HISTO = miMACD - SENYAL
    
    RETURN  HISTO AS "HISTOGRAMA"style(histogram),miMACD AS "MACD", SENYAL AS "SEÑAL", 0  as "Linea 0"

    Si tu veux choisir un autre type de moyenne, tu peux faire ce qui suit. Il suffit de changer la variable matype pour utiliser d’autres moyennes.

    umrk thanked this post
    #250136 quote
    umrkumrk
    Participant
    New

    Ah ! c’est ce que je soupçonnais !  Merci !

    #250149 quote
    umrkumrk
    Participant
    New

    En fait je m’aperçois que mon algo utilise un “simplified MACD” . Ce type de calcul MACD figure dans la liste des “predefined indicators” , mais comment y accéder ? (cela ne semble pas correspondre à l’indicateur MACD standard)

    #250167 quote
    Iván GonzálezIván González
    Moderator
    Legend
    #250181 quote
    umrkumrk
    Participant
    New
    #250182 quote
    umrkumrk
    Participant
    New

    Bon, ce n’est pas critique, je me suis reprogrammé “mon” MACD …

     

    ONCE VVAL9=2/10
    ONCE VVAL12=2/13
    ONCE VVAL26=2/27
    ONCE PreviousVMACD=0
    ONCE PreviousMM12=0
    ONCE PreviousMM26=0
    //

    MM26=PreviousMM26+VVal26*(Close-PreviousMM26)
    MM12=PreviousMM12+VVal12*(Close-PreviousMM12)
    VMACD=MM12-MM26-PreviousVMACD-VVal9*(MM12-MM26-PreviousVMACD)
    PreviousMM26=MM26
    PreviousMM12=MM12
    PreviousMACD=VMACD

Viewing 7 posts - 1 through 7 (of 7 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

MACD[12,26,9] ?


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
umrk @umrk Participant
Summary

This topic contains 6 replies,
has 2 voices, and was last updated by umrkumrk
1 year ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 08/28/2025
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...