OPEN-SOURCE SCRIPT

Candle Numbers (last N, no bubble)

48
snapshot

Candle Numbers (last N, no bubble) is a lightweight utility indicator that labels candles with sequential numbers to make chart analysis and discussion easier (e.g., “candle 213”, “the breakout candle”, “the pivot”). It is designed for clarity and performance: labels are text-only (no background bubble) and are drawn only for the last N bars.

What it does

Numbers the last N candles on the chart (a sliding window near the most recent bar).

Counting starts at the left edge of that window:

the leftmost bar in the window is 1

the most recent bar in the window is N (or fewer if you use stepping / limits).

Allows numbering every Nth bar to keep the chart clean.

Places numbers below each candle, with a configurable vertical offset measured in ticks.

Inputs

Bars to number (last N) (barsWindow)
Size of the numbered window (default 200).

Number every N bars (step)
1 = every bar, 2 = every second bar, 5 = every fifth bar, etc.

Text color (txtColor)

Text size (txtSizeIn)
tiny / small / normal / large

Vertical offset (ticks) (offsetTick)
Moves the label down by offsetTick * syminfo.mintick. You can use large values if needed.

Max numbers to plot (maxMarks)
Extra safeguard to control label count and performance.

How it works (implementation notes)

Labels are drawn only when barstate.islast is true (updates on the latest bar).

Previously created labels are deleted and re-created each update to avoid clutter.

Uses max_labels_count=500 plus maxMarks to stay within TradingView label limits.

Notes

This is not a trading signal indicator. It’s a chart annotation tool for analysis and manual backtesting.

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.