OPEN-SOURCE SCRIPT
Обновлено

Comparison Lines with Labels

472
What It Does
This indicator overlays up to 7 additional ticker symbols onto your main chart as rebased price lines, allowing direct visual comparison of relative performance across multiple assets simultaneously.
The key mechanic is percentage rebasing: every line — including the main chart's own price — is normalised so that all series start at the same price point (the main chart's closing price at the left edge of your visible window). This means you're not comparing absolute prices, you're comparing relative returns from a common starting point.
Because the anchor point is tied to the visible left edge rather than a fixed date, the comparison automatically adjusts whenever you scroll or zoom. Every time you change your view window, all lines re-anchor together — no manual reconfiguration required.

End-of-Line Labels
Each line displays a floating label at the right edge of the chart showing:

The ticker symbol or full instrument name (your choice)
The % return from the visible left edge (e.g. +12.45% or -3.20%)

Labels stay pinned to their line's current price level at all times. Unlike static text boxes, they never need to be repositioned after zooming, scrolling, or changing timeframes — they're always exactly where you need them.

Intended Use Case — Sector Rotation & Comparative Analysis
The primary use case is sector scanning and money flow analysis. Load a basket of related tickers — for example, a set of sector ETFs, a group of resource stocks, or competing names within a theme — and immediately see:

Which instrument is leading or lagging from any given starting point
Where relative momentum is strongest
How quickly the spread between instruments is widening or narrowing

Because you can run up to 7 comparisons at once and each line is clearly labelled with its name and return percentage, you can monitor a dense watchlist without needing to cross-reference a legend, create manual text annotations, or maintain separate charts.

Settings Reference
GroupSettingPurposeSymbolsSymbol 1–7Enter any valid TradingView ticker (e.g. ASX:BHP, AMEX:XLE)SymbolsShow Base Symbol LinePlots the main chart's own rebased line — hidden by default as it overlaps candlesDisplayShow % Return in LabelAppends the return figure to each end labelDisplayShow Display NameUses the instrument's full name instead of the raw ticker codeDisplayShow Anchor Dot at StartPlaces a small circle on each line at the rebasing anchor barDisplayLabel OffsetPushes labels right by N bars so they don't overlap the last candleDisplayLine WidthVisual thickness of comparison lines (1–4)ColorsBase / Symbol 1–7Individual colour assignment per line

Important Notes

Remove any previous version before adding this indicator — two copies will cause price scale conflicts.
The indicator runs on the same timeframe as the main chart. Switching timeframes resets and recalculates everything automatically.
If a comparison ticker has no data at the visible left edge (e.g. a recently listed stock), its line will rebase from its own first available bar instead. The anchor dot will appear at a different height on those tickers, which is a visual cue that the start point differs.
max_labels_count=50 is set at the indicator level — labels are deleted and recreated on every tick so only the current set persists.
Информация о релизе
Updated to allow up to 15 comparison lines and also added RSC comparison functionality. For the RSC comparison feature, each comparison line is benchmarked bar-by-bar against a configurable ticker (default ASX:XJO). The RSC ratio is calculated as symbol price / benchmark price, and its rate of change over a rolling lookback window is used to measure momentum. When a symbol is gaining ground on the benchmark its line brightens (becomes more opaque); when it is losing ground the line fades. The speed at which a line reaches full brightness is controlled by the ROC Scale — a higher value requires stronger outperformance before the line fully brightens. The end-of-line label also shows the cumulative RSC % change since the visible left edge, so you can see at a glance both absolute return and relative performance against the benchmark over the same window.
Информация о релизе
Add setting to enable and disable the RSC comparison

Отказ от ответственности

Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.