anchoredNote

Places a sticky text note at a specific bar and price. Use it to annotate entries, exits, news events, or reminders right on the chart. You can add a background box, border, word wrap, and control font styling so the note stays readable.

Syntax (one line)

anchoredNote(time, price, styles?, text?)

Parameters

time (number) · Candle time where the note is anchored (e.g., time(0)). price (number) · Price level where the note sits (e.g., closeC(0)). styles (TextLineToolOverrides) · Visual and layout options for the note:

  • backgroundColor (RGBAColor | BaseColors) · Color behind the text box.

  • backgroundTransparency (number) · 0–100 background opacity (higher = lighter).

  • bold (boolean) · Make the note text bold.

  • borderColor (RGBAColor | BaseColors) · Border color around the note box.

  • color (RGBAColor | BaseColors) · Text color.

  • drawBorder (boolean) · Show a border around the note box.

  • fillBackground (boolean) · Fill the note background area.

  • fixedSize (boolean) · Keep a fixed size (don’t autoscale with zoom).

  • fontsize (number) · Font size for the text.

  • italic (boolean) · Make the note text italic.

  • wordWrap (boolean) · Wrap text onto multiple lines.

  • wordWrapWidth (number) · Pixel width used for wrapping when wordWrap is true. text (string) · The message to display inside the note.

Return Value

(string) · The drawing ID of the created Anchored Note.

Example

What this does: Every 50 candles, it drops a blue sticky note at the current close with a short message. We give it a soft background, a thin border, and enable word wrap. All visuals live in one const style.

Tips

  • Use wordWrap + wordWrapWidth to keep longer notes tidy.

  • Pick high-contrast color vs backgroundColor so the text stays readable over candles.

  • Set fixedSize: true if you want the note to keep the same on-screen size when zooming.

Warning

  • Huge notes with long text can clutter the chart—keep messages short and focused.

Good Practice

  • Keep a few presets (e.g., blue for info, orange for warning, green for “done”) so notes are instantly recognizable.

  • Store your preferred note styling in a single const style and reuse it across scripts.

Last updated