Bot ProOrder Gold M30 basé MBFX timing2 et Belkaya

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #225944 quote
    teshmi9z
    Participant
    New

    bonjour,
    j’ai créer un bot flèche assez simple en combinant plusieurs code que j’ai trouver sur le forum (mbfx timing2 et belkaya gravity) , j’aimerais le partager et avoir vos avis.
    actuellement il est plutôt prévue pour le gold en UT30 avec un réglage à 25

    j’ai ajouter un mode Rang à activer lorsque qu’on en détecte un (d’expérience)

    sinon il marche en tendance avec la MM200 (possible de le modifier dans le code suivant l’actif et UT)

    (ajouter les variable si copie depuis forum)

     

    merci de vos avis si vous le tester et pensez à des amélioration à faire

    mm200=Average[200](close)
    LRCentre = linearregression[len](totalprice)
    
    if LRcentre<LRCentre[1] THEN
    r=255
    G=0
    BelRouge=1
    ELSE
    BelRouge =0
    endif
    if LRcentre>LRCentre[1] THEN
    r=0
    G=255
    Belvert=1
    ELSE
    belVert=0
    endif
    
    li224=0
    if (ld8 = 0.0) then
    ld8 = 1.0
    ld16 = 0.0
    if (Len - 1 >= 5) then
    ld0 = Len - 1.0
    else
    ld0 = 5.0
    endif
    ld80 = 100.0 * ((High[li224] + Low[li224] + Close[li224]) / 3.0)
    ld96 = 3.0 / (Len + 2.0)
    ld104 = 1.0 - ld96
    else
    if (ld0 <= ld8) then
    ld8 = ld0 + 1.0
    else
    ld8 = ld8+1.0
    endif
    ld88 = ld80
    ld80 = 100.0 * ((High[li224] + Low[li224] + Close[li224]) / 3.0)
    ld32 = ld80 - ld88
    ld112 = ld104 * ld112 + ld96 * ld32
    ld120 = ld96 * ld112 + ld104 * ld120
    ld40 = 1.5 * ld112 - ld120 / 2.0
    ld128 = ld104 * ld128 + ld96 * ld40
    ld208 = ld96 * ld128 + ld104 * ld208
    ld48 = 1.5 * ld128 - ld208 / 2.0
    ld136 = ld104 * ld136 + ld96 * ld48
    ld152 = ld96 * ld136 + ld104 * ld152
    ld56 = 1.5 * ld136 - ld152 / 2.0
    ld160 = ld104 * ld160 + ld96 * Abs(ld32)
    ld168 = ld96 * ld160 + ld104 * ld168
    ld64 = 1.5 * ld160 - ld168 / 2.0
    ld176 = ld104 * ld176 + ld96 * ld64
    ld184 = ld96 * ld176 + ld104 * ld184
    ld144 = 1.5 * ld176 - ld184 / 2.0
    ld192 = ld104 * ld192 + ld96 * ld144
    ld200 = ld96 * ld192 + ld104 * ld200
    ld72 = 1.5 * ld192 - ld200 / 2.0
    if (ld0 >= ld8 and ld80 <> ld88) then
    ld16 = 1.0
    endif
    if (ld0 = ld8 and ld16 = 0.0) then
    ld8 = 0.0
    endif
    endif
    
    if (ld0 < ld8 and ld72 > 0.0000000001) then
    ld24 = 50.0 * (ld56 / ld72 + 1.0)
    if (ld24 > 100.0) then
    ld24 = 100.0
    endif
    if (ld24 < 0.0) then
    ld24 = 0.0
    endif
    else
    ld24 = 50.0
    endif
    
    if (ld24>ld24[1]) then
    dirbar=1
    endif
    if (ld24<ld24[1]) then
    dirbar=-1
    endif
    if (ld24=ld24[1]) then
    dirbar=0
    endif
    //Zone bleu
    Zbleu=dirbar<>dirbar[1]
    //if Zbleu then
    //BACKGROUNDCOLOR (214, 234, 248)
    //endif
    
    check=summation[6](zbleu)=1
    
    //mode Range
    if Rang THEN
    if zbleu and ld24>70 THEN
    DRAWARROWDOWN(barindex, high+5*pipsize) coloured (142, 68, 173)
    endif
    if zbleu and ld24<30 THEN
    DRAWARROWUP(barindex, low-5*pipsize) coloured (142, 68, 173)
    endif
    endif
    if ActivFlech then
    if close > mm200 and check and ld24<50 and Belvert and not belvert[1] then
    DRAWARROWUP(barindex, low - 2*pipsize)
    ENDIF
    if close> mm200 and zbleu and belvert and ld24<50  then
    DRAWARROWUP(barindex, low - 2*pipsize) coloured (0,0,255)
    endif
    if close <MM200 and check and BelRouge and not BelRouge[1]  and ld24>50 THEN
    DRAWARROWDOWN(barindex, high+2*pipsize)
    endif
    if close< mm200 and zbleu and ld24>60 THEN
    DRAWARROWDOWN(barindex, high+5*pipsize) coloured(200,0,0)
    endif
    endif
    RETURN LRCentre coloured (r,g,0)style(line,2)
    

     

    Bot_Gold10.itf
    #260098 quote
    Nicolas
    Keymaster
    Master

    Merci beaucoup pour ce partage, voici mon analyse complète :

    Points positifs :

    • La combinaison MBFX Timing (oscillateur 0-100) + Belkhayate (régression linéaire colorée) est cohérente, les deux se complètent bien.
    • Le mode Range / Tendance switchable via une variable est une bonne idée pratique.
    • La variable check avec summation[6](zbleu)=1 est un filtre anti-bruit intelligent : elle évite de déclencher si des inversions de direction s’accumulent trop vite.
    • Aucun conflit de noms réservés, code propre.

    Points à examiner / améliorer :

    1. Variable r non initialisée sur la première bougie. Si LRCentre = LRCentre[1] (égalité exacte, rare mais possible), ni r ni G ne sont assignés. La couleur du RETURN sera alors imprévisible. Ajouter une valeur par défaut en tête.
    2. Asymétrie des conditions flèches haut/bas. En tendance haussière, une flèche bleue se déclenche avec ld24<50 (MBFX sous 50). En tendance baissière, la flèche rouge foncée demande ld24>60. Les seuils ne sont pas symétriques, ce qui peut créer plus de signaux longs que courts. C’est peut-être voulu pour le Gold, mais à surveiller.
    3. Double signal possible. Rien n’empêche les deux blocs check et zbleu de se déclencher sur la même bougie, ce qui produirait deux flèches superposées (une blanche et une bleue par exemple). Un flag signaldonné permettrait de ne garder que le premier.
    4. pipsize vs pointsize. Sur certains instruments (indices, Gold en CFD), pipsize et pointsize peuvent différer. Sur le Gold en général ça passe, mais pour portabilité, mieux vaut utiliser pointsize ou AverageTrueRange[14]*0.1 pour l’offset des flèches.
    5. La MM200 est rigide. Vous le mentionnez vous-même. Une amélioration simple serait d’en faire un paramètre utilisateur en ajoutant mmperiod = 200 en tête et Average[mmperiod](close).

    Voici le code corrigé et légèrement amélioré avec ces ajustements :

    // --- Paramètres
    activflech = 1
    len = 100
    Rang = 0
    mmperiod = 200
    
    
    // --- Calculs de base
    mm200 = Average[mmperiod](close)
    LRCentre = linearregression[len](totalprice)
    
    
    // --- Belkhayate : direction de la régression linéaire
    r = 128
    G = 128
    BelRouge = 0
    Belvert = 0
    
    
    if LRcentre < LRCentre[1] then
        r = 255
        G = 0
        BelRouge = 1
    endif
    if LRcentre > LRCentre[1] then
        r = 0
        G = 255
        Belvert = 1
    endif
    
    
    // --- MBFX Timing
    li224 = 0
    if (ld8 = 0.0) then
        ld8 = 1.0
        ld16 = 0.0
        if (len - 1 >= 5) then
            ld0 = len - 1.0
        else
            ld0 = 5.0
        endif
        ld80 = 100.0 * ((High[li224] + Low[li224] + Close[li224]) / 3.0)
        ld96 = 3.0 / (len + 2.0)
        ld104 = 1.0 - ld96
    else
        if (ld0 <= ld8) then
            ld8 = ld0 + 1.0
        else
            ld8 = ld8 + 1.0
        endif
        ld88 = ld80
        ld80 = 100.0 * ((High[li224] + Low[li224] + Close[li224]) / 3.0)
        ld32 = ld80 - ld88
        ld112 = ld104 * ld112 + ld96 * ld32
        ld120 = ld96 * ld112 + ld104 * ld120
        ld40 = 1.5 * ld112 - ld120 / 2.0
        ld128 = ld104 * ld128 + ld96 * ld40
        ld208 = ld96 * ld128 + ld104 * ld208
        ld48 = 1.5 * ld128 - ld208 / 2.0
        ld136 = ld104 * ld136 + ld96 * ld48
        ld152 = ld96 * ld136 + ld104 * ld152
        ld56 = 1.5 * ld136 - ld152 / 2.0
        ld160 = ld104 * ld160 + ld96 * Abs(ld32)
        ld168 = ld96 * ld160 + ld104 * ld168
        ld64 = 1.5 * ld160 - ld168 / 2.0
        ld176 = ld104 * ld176 + ld96 * ld64
        ld184 = ld96 * ld176 + ld104 * ld184
        ld144 = 1.5 * ld176 - ld184 / 2.0
        ld192 = ld104 * ld192 + ld96 * ld144
        ld200 = ld96 * ld192 + ld104 * ld200
        ld72 = 1.5 * ld192 - ld200 / 2.0
        if (ld0 >= ld8 and ld80 <> ld88) then
            ld16 = 1.0
        endif
        if (ld0 = ld8 and ld16 = 0.0) then
            ld8 = 0.0
        endif
    endif
    
    
    if (ld0 < ld8 and ld72 > 0.0000000001) then
        ld24 = 50.0 * (ld56 / ld72 + 1.0)
        if (ld24 > 100.0) then
            ld24 = 100.0
        endif
        if (ld24 < 0.0) then
            ld24 = 0.0
        endif
    else
        ld24 = 50.0
    endif
    
    
    // --- Direction MBFX
    if (ld24 > ld24[1]) then
        dirbar = 1
    endif
    if (ld24 < ld24[1]) then
        dirbar = -1
    endif
    if (ld24 = ld24[1]) then
        dirbar = 0
    endif
    
    
    // --- Inversion de direction
    Zbleu = dirbar <> dirbar[1]
    
    
    // --- Filtre : une seule inversion sur 6 bougies
    check = summation[6](zbleu) = 1
    
    
    // --- Offset flèches basé sur ATR pour tous instruments
    offset = AverageTrueRange[14](close) * 0.15
    
    
    // --- Mode Range
    if Rang then
        sigR = 0
        if zbleu and ld24 > 70 and not sigR then
            DRAWARROWDOWN(barindex, high + offset) coloured(142, 68, 173)
            sigR = 1
        endif
        if zbleu and ld24 < 30 and not sigR then
            DRAWARROWUP(barindex, low - offset) coloured(142, 68, 173)
            sigR = 1
        endif
    endif
    
    
    // --- Mode Tendance
    if activflech then
        sigT = 0
        if close > mm200 and check and ld24 < 50 and Belvert and not belvert[1] and not sigT then
            DRAWARROWUP(barindex, low - offset) coloured(255, 255, 255)
            sigT = 1
        endif
        if close > mm200 and zbleu and belvert and ld24 < 50 and not sigT then
            DRAWARROWUP(barindex, low - offset) coloured(0, 0, 255)
            sigT = 1
        endif
        if close < mm200 and check and BelRouge and not BelRouge[1] and ld24 > 50 and not sigT then
            DRAWARROWDOWN(barindex, high + offset) coloured(255, 255, 255)
            sigT = 1
        endif
        if close < mm200 and zbleu and ld24 > 60 and not sigT then
            DRAWARROWDOWN(barindex, high + offset) coloured(200, 0, 0)
            sigT = 1
        endif
    endif
    
    
    RETURN LRCentre coloured(r, g, 0) style(line, 2)
    

    Résumé des modifications apportées :

    • r et G initialisés à 128 (gris neutre) pour éviter la couleur indéfinie en cas d’égalité parfaite.
    • mmperiod devient un paramètre modifiable en haut du code.
    • offset basé sur l’ATR14 * 0.15 à la place de pipsize, plus universel.
    • Flags sigR et sigT ajoutés pour éviter les flèches doubles sur la même bougie.
    • Les if/else du Belkhayate séparés proprement pour que les deux flags soient indépendants.


    robertogozzi thanked this post
    DXSXXXX-100-ticks.png DXSXXXX-100-ticks.png MGCXXXX-30-minutes.png MGCXXXX-30-minutes.png
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Bot ProOrder Gold M30 basé MBFX timing2 et Belkaya


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
teshmi9z @teshmi9z Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Nicolas
1 month ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 01/03/2024
Status: Active
Attachments: 3 files
Logo Logo
Loading...