text

Places a free text label on the chart at a chosen bar and price. Perfect for short notes, titles, or reminders that you want to keep visible near specific candles. You can add a background box, border, word wrap, and font styling for readability.

Syntax (one line)

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

Parameters

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

  • backgroundColor (RGBAColor | BaseColors) · Box fill color behind the text.

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

  • bold (boolean) · Make the text bold.

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

  • color (RGBAColor | BaseColors) · Text color.

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

  • fillBackground (boolean) · Fill the background area behind the text.

  • fixedSize (boolean) · Keep the on-screen size constant when zooming.

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

  • italic (boolean) · Make the text italic.

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

  • wordWrapWidth (number) · Pixel width used for wrapping when wordWrap is true. value (string) · The message to display (e.g., "Breakout").

Return Value

(string) · The drawing ID of the created Text.

Example

What this does: Every 44 candles, it places a short, wrapped text label at the current close with a soft background and thin border. All visuals live in one const style.

Tips

  • Use wordWrap + wordWrapWidth to keep longer notes tidy and readable.

  • Choose high-contrast color vs backgroundColor so text stays visible over candles.

  • Set fixedSize: true if you want labels to remain the same size while zooming.

Warning

  • Very long paragraphs can cover price action — keep messages short and raise backgroundTransparency if needed.

Good Practice

  • Keep a few presets (info/warning/checklist) as reusable const style objects.

  • Align your text color scheme with other annotations (notes, callouts) for a consistent look.

Last updated