How to draw a text only once, always aligned to the right on the current candle

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #253828 quote
    Tito Peronni
    Participant
    New

    Hi,

    I would like to add a text label at a specific vertical position (for example, above the last candle) but aligned to the right-edge of the chart. I tried doing this with the following code, but the label is printed again with each new candle, causing it to duplicate the text. How can I ensure that the text is displayed only once, always at the last position (which could change with teh candle)?

    IF islastbarupdate THEN
    DRAWTEXT(" text", BarIndex, high, Dialog, Bold, 12) COLOURED(1,1,1)
    endif
    
    return
    PRC_text.jpg PRC_text.jpg
    #253847 quote
    Iván González
    Moderator
    Master

    Hi! write this:

    defparam drawonlastbaronly=true
    IF islastbarupdate THEN
       DRAWTEXT(" text", BarIndex, high, Dialog, Bold, 12) COLOURED(1,1,1)
    endif
    return
    Tito Peronni and robertogozzi thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

How to draw a text only once, always aligned to the right on the current candle


ProBuilder: Indicators & Custom Tools

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Iván González
3 months, 1 week ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 11/20/2025
Status: Active
Attachments: 1 files
Logo Logo
Loading...