OPEN-SOURCE SCRIPT

bar count plot only for far lookback

49
Purpose:
TradingView limits the number of text/label objects (≈500), which causes traditional bar-count indicators to stop showing numbers when you scroll far back in history.
This plots-only version bypasses that limitation entirely, allowing you to view bar numbers anywhere on the chart, even thousands of bars back.

How It Works:

Displays each bar’s in-day sequence number (1–78 by default) under the candles.

Counts restart automatically at the start of each trading day.

Uses a dual-channel “digit plot” system (tens + ones) instead of labels—extremely light on performance and unlimited in lookback.

The digits are drawn every N bars (default = 3) to keep the view uncluttered.

Key Parameters:

Show every Nth bar: Controls how often numbers appear (1 = every bar, 3 = every 3 bars, etc.).

Notes:

Digits are plotted directly via plotshape()—no labels—so they remain visible even 5 000 + bars back.

Alignment may vary slightly depending on chart zoom; this version is intended mainly for deep historical review rather than precise near-term alignment.

免責事項

これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。