OPEN-SOURCE SCRIPT
Candle Numbers (last N, no bubble)

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.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.