ATH Label/Bubble

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #243921 quote
    gp38supergp38super
    Participant
    New

    Anyone know how to code a bubble or label that plots on price at ATH and updates live? Should ideally only visible on chart where ATH is within range/sight/scope. One that prints high of day and/or ATH would be killer also. I attached a TOS image of similar.

    Thanks!

    Screenshot-2025-02-16-at-10.06.04 AM.png Screenshot-2025-02-16-at-10.06.04 AM.png
    #243939 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Hi. Here an example to calculate the ATH.

    DEFPARAM DRAWONLASTBARONLY = TRUE  // Ensures that the drawing is only updated on the last bar
    
    // Calculation of the All-Time High (ATH)
    ONCE highestATH = 0  // Variable to store the highest recorded price
    IF high > highestATH THEN  
        highestATH = high  // Update the highest ATH if a new high is reached
    ENDIF
    
    // Draws the ATH label if it is within the visible range
    IF islastbarupdate THEN  
        DRAWTEXT("ATH:  #highestATH#", -100, -100, Dialog, Bold, 12) COLOURED(255,0,0,255) ANCHOR(TOPRIGHT, xshift, yshift)  
        DRAWHLINE(highestATH) STYLE(DOTTEDLINE3) COLOURED("RED")  // Draws a horizontal dotted line at ATH level
    ENDIF
    
    RETURN 
    gp38super thanked this post
    #243948 quote
    gp38supergp38super
    Participant
    New

    Great! Thank you! I will also try on my own, as I’m trying to learn more coding everyday, but I’m pretty sure it’s possible to anchor text to the high candle, correct? I just think that with my still very limited knowledge, it would continue to repeat a new label rather than just move with the new high, but I will try to figure that out as well. I won’t be upset if you beat me to it. Ha! Thanks again.

Viewing 3 posts - 1 through 3 (of 3 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

ATH Label/Bubble


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
gp38super @gp38super Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by gp38supergp38super
1 year, 7 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 02/16/2025
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...