Stratégie automatique avec HA lissé

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #34011 quote
    larouedegann
    Participant
    Master

    Bonjour,

    J’ai repris l’indicateur mis en ligne par NICOLAS et je voudrais si c’est possible l’agrémenter  à ma sauce.

    A savoir

    ACHAT lorsque le cours touche Le plus bas du HA lissé (chandelier rouge)

    VENTE lorsque le cours touche le plus haut du HA lissé (chandelier bleu)

    et cela à chaque nouveau chandelier.

    Jai tout essayé mais je n’y suis pas arrivé.s si quelqu’un a une solution?

    merci

    ci-joint indicateur de Nicolas

    //PRC_HPT Heikin Ashi Smoothed | indicator
    //25.04.2017
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //translated from MT4 indicator code
    
    //---settings
    MaPeriod=6
    MaPeriod2=2
    //---end of settings
    
    once maOpen=Open
    once maClose=Close
    once maLow=Low
    once maHigh=High
    
    if barindex>0 then
    maOpen=(maOpen[1]*(MAperiod-1)+Open)/MAPeriod
    maClose=(maClose[1]*(MAperiod-1)+Close)/MAPeriod
    maLow=(maLow[1]*(MAperiod-1)+Low)/MAPeriod
    maHigh=(maHigh[1]*(MAperiod-1)+High)/MAPeriod
    
    haOpen=(ExtMapBuffer5[1]+ExtMapBuffer6[1])/2
    haClose=(maOpen+maHigh+maLow+maClose)/4
    haHigh=Max(maHigh, Max(haOpen, haClose))
    haLow=Min(maLow, Min(haOpen, haClose))
    if (haOpen<haClose) then
    r=0
    g=191
    b=255
    ExtMapBuffer7=haLow
    ExtMapBuffer8=haHigh
    else
    r=255
    g=10
    b=0
    ExtMapBuffer7=haHigh
    ExtMapBuffer8=haLow
    endif
    ExtMapBuffer5=haOpen
    ExtMapBuffer6=haClose
    
    ExtMapBuffer1=weightedaverage[MAperiod2](ExtMapBuffer7)
    ExtMapBuffer2=weightedaverage[MAperiod2](ExtMapBuffer8)
    ExtMapBuffer3=weightedaverage[MAperiod2](ExtMapBuffer5)
    ExtMapBuffer4=weightedaverage[MAperiod2](ExtMapBuffer6)
    endif
    DRAWCANDLE(ExtMapBuffer3,ExtMapBuffer2,ExtMapBuffer1,ExtMapBuffer4) coloured(r,g,b)
    
    short = ExtMapBuffer7[1]>ExtMapBuffer8[1] and ExtMapBuffer7[2]<ExtMapBuffer8[2] and ExtMapBuffer7[0]>ExtMapBuffer8[0]
    long = ExtMapBuffer7[1]<ExtMapBuffer8[1] and ExtMapBuffer7[2]>ExtMapBuffer8[2] and ExtMapBuffer7[0]<ExtMapBuffer8[0]
    
    RETURN long as "long signal", short as "short signal"
    #34049 quote
    Nicolas
    Keymaster
    Master

    Lorsque tu mentionnes “le plus haut du HA lissé”, tu parles du High de cette bougie Heiken Ashi ? Car ça n’est pas le cas dans ton exemple. Ce Heikin Ashi lissé est en fait construit avec des moyennes mobiles, un bon compromis serait de prendre position soit le prix médian de ces bougies ou alors même le Close. Cela revient toutefois à prendre position sur un rebond de moyenne mobile.

    #34142 quote
    larouedegann
    Participant
    Master

    Je recommence ,je devais être fatigué……

    Si le cours touche  l’ouverture de la bougie HA rouge, on achète

    Si le cours touche l’ouverture de la bougie HA bleu , on vends.

    Je pense que cela devrait être possible avec des ordres stops

    je remets un fichier.

    #34145 quote
    larouedegann
    Participant
    Master

    Décidemment,

    VENTE si le cours touche la clôture de la bougie HA rouge

    ACHAT si le cours touche l’ouverture de la bougie HA bleu

    Je pense que cela devrait être possible avec des ordres stops

    merci

    #34151 quote
    larouedegann
    Participant
    Master

    Dernière fois promis

    mon message de 11h54 est bien le bon

    Si le cours touche  l’ouverture de la bougie HA rouge, on achète

    Si le cours touche l’ouverture de la bougie HA bleu , on vends.

    Je pense que cela devrait être possible avec des ordres stops

    #34250 quote
    Nicolas
    Keymaster
    Master

    Tu trouveras ci-dessous le code de la stratégie de trading automatique avec le heikin ashi smoothed de la bibliothèque de codes.

    ça fonctionne donc avec des ordres conditionnelles de type STOP. J’ai mis des stoploss et takeprofit arbitraire à modifier à convenance.

    defparam cumulateorders=false
    //PRC_HPT Heikin Ashi Smoothed trading strategy
    //25.04.2017
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    
    //---settings
    MaPeriod=6
    MaPeriod2=2
    //---end of settings
    
    once maOpen=Open
    once maClose=Close
    once maLow=Low
    once maHigh=High
    
    if barindex>0 then
    maOpen=(maOpen[1]*(MAperiod-1)+Open)/MAPeriod
    maClose=(maClose[1]*(MAperiod-1)+Close)/MAPeriod
    maLow=(maLow[1]*(MAperiod-1)+Low)/MAPeriod
    maHigh=(maHigh[1]*(MAperiod-1)+High)/MAPeriod
    
    haOpen=(ExtMapBuffer5[1]+ExtMapBuffer6[1])/2
    haClose=(maOpen+maHigh+maLow+maClose)/4
    haHigh=Max(maHigh, Max(haOpen, haClose))
    haLow=Min(maLow, Min(haOpen, haClose))
    if (haOpen<haClose) then
    ExtMapBuffer7=haLow
    //ExtMapBuffer8=haHigh
    else
    ExtMapBuffer7=haHigh
    //ExtMapBuffer8=haLow
    endif
    ExtMapBuffer5=haOpen
    ExtMapBuffer6=haClose
    
    ExtMapBuffer1=weightedaverage[MAperiod2](ExtMapBuffer7)
    //ExtMapBuffer2=weightedaverage[MAperiod2](ExtMapBuffer8)
    //ExtMapBuffer3=weightedaverage[MAperiod2](ExtMapBuffer5)
    //ExtMapBuffer4=weightedaverage[MAperiod2](ExtMapBuffer6)
    endif
    
    if not longonmarket and close< extmapbuffer1 then
    buy 1 contract at extmapbuffer1 stop
    endif
    
    if not shortonmarket and close> extmapbuffer1 then
    sellshort 1 contract at extmapbuffer1 stop
    endif
    
    set target pprofit 30
    set stop ploss 30
    #34254 quote
    larouedegann
    Participant
    Master

    merci nicolas,

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

Stratégie automatique avec HA lissé


Support ProOrder

New Reply
Author
Summary

This topic contains 6 replies,
has 2 voices, and was last updated by larouedegann
8 years, 8 months ago.

Topic Details
Forum: Support ProOrder
Language: French
Started: 04/30/2017
Status: Active
Attachments: 5 files
Logo Logo
Loading...