Recouvrements des affichage DrawText(…)

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #265374 quote
    Bernard13Bernard13
    Participant
    Senior

    Bonjour,

    L’exemple pédagogique ci-dessous fonctionne très bien pour afficher des résultats dans une marge tout à droite du graphique.

    Sauf qu’à chaque nouvelle bougie, il y a un recouvrement du texte.

    On relance l’algo et tout rentre dans l’ordre, mais ce problème devient génant dès que l’on aborde les toutes petites UT.

    Existe-t-il une astuce pour résoudre ce conflit d’affichage ?

    Merci par avance.


     X= BarIndex
    S= Close
    
    
    A= Average[5](S)
    B= Average[10](S)
    IF A CROSSES OVER B THEN
    DrawPoint(X, A, 3) Coloured("Lime")
    N= N + 1
    yA= A
    ELSIF A CROSSES UNDER B THEN
    DrawPoint(X, A, 3) Coloured("Red")
    N= N + 1
    yA= A
    ENDIF
    
    
    Xresult= -300
    Yresult= -50
    Ls= -20 // Line spacing
    IF IsLastBarUpdate THEN
    DrawText("N: #N#",             Xresult, Yresult + 0*LS, Dialog, Bold, 16) Anchor(TopRight)
    DrawText("BarIndex: #X#",      Xresult, Yresult + 1*Ls, Dialog, Bold, 16) Anchor(TopRight)
    DrawText("A last point: #yA#", Xresult, Yresult + 2*LS, Dialog, Bold, 16) Anchor(TopRight)
    DrawText("Close: #S#",         Xresult, Yresult + 3*Ls, Dialog, Bold, 16) Anchor(TopRight)
    ENDIF
    
    
    RETURN A AS "A", B AS "B"
    
    
    




    Recouvrement-Capture-decran-2026-09-28-104319.png Recouvrement-Capture-decran-2026-09-28-104319.png
    #265375 quote
    NicolasNicolas
    Keymaster
    Legend

    C’est logique, puisque les informations se cumulent et donc on réécrit au dessus sans arrêt.

    Pour éviter cela, on ajoute un

    defparam drawonlastbaronly=true
    

    en tête du code, pour ne tracer que sur la dernière bougie.

    Bernard13 and Iván González thanked this post
    #265376 quote
    Bernard13Bernard13
    Participant
    Senior

    Mes excuses, c’est résolu.

    Cependant est-il possible de rajouter dans le tutoriel ProRealCode la fonction ANCHOR et aussi la fonction COLOR avec notamment le paramètre a d’opacité.. (Demandé par un ami trader qui se lance dans le codage).

    Cordialement..

    DEFPARAM DrawOnlastBarOnly= True // Force the graph to the right
    
    
    X= BarIndex
    S= Close
    
    
    A= Average[5](S)
    B= Average[10](S)
    IF A CROSSES OVER B THEN
    DrawPoint(X, A, 3) Coloured("Lime")
    N= N + 1
    yA= A
    ELSIF A CROSSES UNDER B THEN
    DrawPoint(X, A, 3) Coloured("Red")
    N= N + 1
    yA= A
    ENDIF
    
    
    Xresult= X + 10 //-300
    Yresult= -50
    Ls= -20 // Line spacing
    //IF IsLastBarUpdate THEN
    DrawText("N: #N#",             Xresult, Yresult + 0*LS, Dialog, Bold, 16) Anchor(TopRight, Index, Yshift)
    DrawText("BarIndex: #X#",      Xresult, Yresult + 1*Ls, Dialog, Bold, 16) Anchor(TopRight, Index, Yshift)
    DrawText("A last point: #yA#", Xresult, Yresult + 2*LS, Dialog, Bold, 16) Anchor(TopRight, Index, Yshift)
    DrawText("Close: #S#",         Xresult, Yresult + 3*Ls, Dialog, Bold, 16) Anchor(TopRight, Index, Yshift)
    //ENDIF
    
    
    RETURN A AS "A", B AS "B"
    
    
    




    Iván González thanked this post
    #265378 quote
    NicolasNicolas
    Keymaster
    Legend

    Ce sera fait, merci pour le retour.

    Bernard13 thanked this post
Viewing 4 posts - 1 through 4 (of 4 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

Recouvrements des affichage DrawText(…)


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
Bernard13 @bernard13 Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by NicolasNicolas
10 hours, 9 minutes ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 09/28/2026
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...