Pullback sur moyenne mobile

Viewing 15 posts - 1 through 15 (of 53 total)
  • Author
    Posts
  • #249024 quote
    paatof69
    Participant
    New

    Bonjour

    j ai poste un fichier concernant un souci de syntax

    pouvez  vous m aider

    merci..

    #249026 quote
    fifi743
    Participant
    Master

    copie ce code dans probuilder

    polarite8=average[8]
    polarite21=average[21]
    
    return polarite8 coloured(0,0,255) as "polarite8",polarite21 coloured(0,255,0)as"polarite21"
    paatof69 thanked this post
    #249027 quote
    paatof69
    Participant
    New

    Merci de votre reponse… je joins un fichier .. je suis pas expert en codage si vous pouvez encore m aider… merci

    #249035 quote
    Iván González
    Moderator
    Master

    Bonjour. Voici ton code sans erreurs.

    periodFast = 7
    periodSlow = 20
    pullbackTolerance = 0.0005
    
    maFast = average[periodFast](close)
    maSlow = average[periodSlow](close)
    
    crossUp = maFast crosses over maSlow
    crossDown = maFast crosses under maSlow
    
    pullbackToSlowUp = (low <= maSlow + pullbackTolerance AND high >= maSlow - pullbackTolerance)
    
    pullbackToSlowDown = (high >= maSlow - pullbackTolerance AND low <= maSlow + pullbackTolerance)
    
    buySignal = crossUp AND pullbackToSlowUp
    sellSignal = crossDown AND pullbackToSlowDown
    
    IF buySignal THEN
       DRAWARROWup(barindex, low)coloured("green")
    ENDIF
    
    IF sellSignal THEN
       DRAWARROWdown(barindex, high)coloured("red")
    ENDIF
    
    RETURN maFast coloured(0,0,255) as "Moyenne Rapide", maSlow coloured(0,255,0) as "Moyenne Lente"

    Pour la prochaine fois, il vaut mieux que tu partages le code et tes questions directement ici. Pour partager du code, il te suffit de cliquer sur le bouton pour ajouter du code PRT.

    paatof69 thanked this post
    #249036 quote
    Iván González
    Moderator
    Master

    Voici une petite variation de ton code pour détecter le pullback après le croisement et non pendant le croisement des moyennes.
    Je n’ai pas voulu trop modifier la logique de ton code, simplement attendre que le croisement soit déjà effectué.

    periodFast = 7
    periodSlow = 20
    pullbackTolerance = 0.0005
    
    // CALCULO DE MEDIAS
    maFast = average[periodFast](close)
    maSlow = average[periodSlow](close)
    
    crossUp = maFast CROSSES OVER maSlow
    crossDown = maFast CROSSES UNDER maSlow
    
    IF crossUp THEN
       crossUpBar = barindex
       checkpullbackToSlowUp=1
       checkpullbackToSlowDown=0
    elsif crossDown THEN
       crossDownBar = barindex
       checkpullbackToSlowUp=0
       checkpullbackToSlowDown=1
    ENDIF
    
    IF crossDown THEN
       crossDownBar = barindex
    ENDIF
    
    pullbackToSlowUp = (barindex > crossUpBar AND low <= maSlow + pullbackTolerance AND high >= maSlow - pullbackTolerance)
    pullbackToSlowDown = (barindex > crossDownBar AND high >= maSlow - pullbackTolerance AND low <= maSlow + pullbackTolerance)
    
    buySignal = pullbackToSlowUp AND BarsSince(crossUp) > 0 and checkpullbackToSlowUp
    sellSignal = pullbackToSlowDown AND BarsSince(crossDown) > 0 and checkpullbackToSlowDown
    
    IF buySignal THEN
       DRAWARROWup(barindex, low)coloured("green")
    ENDIF
    
    IF sellSignal THEN
       DRAWARROWdown(barindex, high)coloured("red")
    ENDIF
    
    RETURN maFast coloured(0,0,255) as "Moyenne Rapide", maSlow coloured(0,255,0) as "Moyenne Lente"
    robertogozzi and paatof69 thanked this post
    #249073 quote
    paatof69
    Participant
    New

    Bonjour

    Actuellement je fais des test d  indicateur …je ne suis pas un expert ..les corrections que vous avez apporter on bien fontioner mais je dois affiner  merci de votre aide…j ai toujours des problème  de syntax

    pouvez vous faire une correction sur ce code ..

    // — Module 1 : Détection Breaker Block M3 —
    DEFPARAM CumulateOrders = False

    // Cassure de structure simple (BOS haussier)
    bosUp = close > highest[5](close[1])
    // Cassure de structure baissière
    bosDown = close < lowest[5](close[1])

    // Enregistrer la zone du breaker block
    IF bosUp THEN
    breakerHigh = high
    breakerLow = low
    breakerMid = (breakerHigh + breakerLow) / 2
    DRAWRECTANGLE(“BreakerHaussier”, barindex, breakerHigh, barindex+5, breakerLow) coloured(255,200,0)
    ENDIF

    IF bosDown THEN
    breakerHigh = high
    breakerLow = low
    breakerMid = (breakerHigh + breakerLow) / 2
    DRAWRECTANGLE(“BreakerBaissier”, barindex, breakerHigh, barindex+5, breakerLow) coloured(200,50,50)
    ENDIF

    Merci..

    #249074 quote
    Iván González
    Moderator
    Master
    // — Module 1 : Détection Breaker Block M3 —
    // Cassure de structure simple (BOS haussier)
    bosUp = close > highest[5](close[1])
    // Cassure de structure baissière
    bosDown = close < lowest[5](close[1])
    
    // Enregistrer la zone du breaker block
    IF bosUp THEN
       breakerHigh = high
       breakerLow = low
       breakerMid = (breakerHigh + breakerLow) / 2
       DRAWRECTANGLE(barindex, breakerHigh, barindex+5, breakerLow) coloured(255,200,0)
    ENDIF
    
    IF bosDown THEN
       breakerHigh = high
       breakerLow = low
       breakerMid = (breakerHigh + breakerLow) / 2
       DRAWRECTANGLE(barindex, breakerHigh, barindex+5, breakerLow) coloured(200,50,50)
    ENDIF
    
    return
    
    JS, paatof69 and robertogozzi thanked this post
    #249075 quote
    JS
    Participant
    Senior

    Bonjour,
    Il est important de bien faire la distinction entre les indicateurs et les systèmes de trading, car chacun a une syntaxe autorisée différente…

    DefParam CumulateOrders = False appartient à un système de trading, et non à un indicateur…

    De plus, un indicateur doit toujours se terminer par RETURN

    Essayez d’exécuter ce code sous le module « Indicateurs »…

    // — Module 1 : Détection Breaker Block M3 —
    //DEFPARAM CumulateOrders = False
    
    // Cassure de structure simple (BOS haussier)
    bosUp = close > highest[5](close[1])
    // Cassure de structure baissière
    bosDown = close < lowest[5](close[1])
    
    // Enregistrer la zone du breaker block
    IF bosUp THEN
    breakerHigh = high
    breakerLow = low
    breakerMid = (breakerHigh + breakerLow) / 2
    DRAWRECTANGLE(barindex, breakerHigh, barindex+5, breakerLow) coloured(255,200,0)
    EndIf
    
    IF bosDown THEN
    breakerHigh = high
    breakerLow = low
    breakerMid = (breakerHigh + breakerLow) / 2
    DRAWRECTANGLE(barindex, breakerHigh, barindex+5, breakerLow) coloured(200,50,50)
    ENDIF
    
    Return

    Iván González, paatof69 and robertogozzi thanked this post
    #249098 quote
    paatof69
    Participant
    New
    bonjour j essai de faire codage sur structure de marche probleme de syntax merci pour la correction… // Paramètre de sensibilité DEFPARAM CumulateOrders = False depth = 5 // Détection d’un Swing High (Haut de structure) swingHigh = (high > highest[depth](high[1])) AND (high >= highest[depth](high[-depth])) // Détection d’un Swing Low (Bas de structure) swingLow = (low < lowest[depth](low[1])) AND (low <= lowest[depth](low[-depth])) // Affichage des points IF swingHigh THEN DRAWSHAPE(1, style = shapeCircle, color = green, size = 2, position = aboveBar) ENDIF IF swingLow THEN DRAWSHAPE(1, style = shapeCircle, color = red, size = 2, position = belowBar) ENDIF RETURN
    #249101 quote
    fifi743
    Participant
    Master
    deja enlever le – devant depth
    paatof69 thanked this post
    #249102 quote
    paatof69
    Participant
    New
    Merci de votre reponse ci joint fichier + erreur
    #249104 quote
    GraHal
    Participant
    Master
    Existe-t-il une commande DrawShape  ? Essayez DrawText ?
    paatof69 thanked this post
    #249115 quote
    JC_Bywan
    Moderator
    Master
    Bonjour, à propos de la première erreur de la dernière image attachée, en ligne 2, comme JS l’a mentionné un peu plus haut pour le code précédent, l’instruction DEFPARAM CumulateOrders = False ne peut pas être utilisée dans un indicateur, il faut enlever cette ligne.
    paatof69 thanked this post
    #249122 quote
    paatof69
    Participant
    New
    Bonjour à tous, Je souhaite créer un indicateur pour identifier la structure de marché. L’idée est très simple : – Afficher un point vert lorsqu’un nouveau swing high est détecté (un plus haut local) – Afficher un point rouge lorsqu’un nouveau swing low est détecté (un plus bas local) Les conditions seraient basées sur la détection des plus hauts et plus bas relatifs sur un certain nombre de bougies (paramètre de profondeur). En résumé : ✅ Point vert = swing high ✅ Point rouge = swing low Je cherche donc un code simple qui permette de tracer automatiquement ces points sur le graphique. Merci beaucoup pour votre aide !
    #249125 quote
    JS
    Participant
    Senior

    Bonjour,

    Essayez cet indicateur…

    Once Depth=5
    
    If Highest[Depth*2+1](High)=High[Depth] then
    DrawPoint(BarIndex-Depth,High[Depth],3)Coloured("Green")
    EndIf
    
    If Lowest[Depth*2+1](Low)=Low[Depth] then
    DrawPoint(BarIndex-Depth,Low[Depth],3)Coloured("Red")
    EndIf
    
    Return
    paatof69 and Iván González thanked this post
Viewing 15 posts - 1 through 15 (of 53 total)
  • You must be logged in to reply to this topic.

Pullback sur moyenne mobile


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
paatof69 @paatof69 Participant
Summary

This topic contains 52 replies,
has 7 voices, and was last updated by bertrandpinoy
4 months, 4 weeks ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 07/22/2025
Status: Active
Attachments: 18 files
Logo Logo
Loading...