OPEN-SOURCE SCRIPT

SVKO CFD Symbol Mapper

25
SVKO CFD Symbol Mapper resolves broker CFD tickers to their native TradingView symbols and performs reverse lookups for compatible indicators. It provides one shared mapping source instead of duplicating mappings across companion scripts.


█ OVERVIEW

This is a visually silent helper indicator. It does not draw signals, levels, tables, or volume. It resolves the counterpart of the current chart symbol and transports that symbol to a receiving indicator.


█ HOW IT WORKS

The Mapper checks user supplied Symbol Mappings before its built in mappings. Each pair uses a complete TradingView ticker ID on both sides in this form:

TRADENATION:NVDA.EX = NASDAQ:NVDA

On a supported broker chart, the Mapper returns the native TradingView symbol. On a native TradingView chart, it performs the inverse lookup and returns the first matching CFD symbol.

Pine Script cannot pass a ticker string between indicators through `input.source()`. The Mapper therefore encodes the resolved ticker into two hidden numeric plots named 1st code and 2nd code. A compatible receiving indicator reads both plots and reconstructs the symbol.


█ HOW TO USE

1 — Add SVKO CFD Symbol Mapper to the chart.
2 — Add any required custom pairs to Symbol Mappings.
3 — Add a compatible receiving indicator.
4 — In that indicator, select Map: 1st code for its 1st code input and Map: 2nd code for its 2nd code input. Both selections must come from the same Mapper instance.

The Mapper remains visually silent after connection.


█ MAPPING BEHAVIOUR

Custom mappings take priority in both directions. If several CFD symbols point to the same native symbol, inverse lookup returns the first pair in mapping order.

Delayed native exchange suffixes _DL and _DLY are normalised before lookup. If no mapping exists, both code plots return zero.

The Mapper transports symbol identity only. It does not request price, volume, fundamentals, or other data from the resolved symbol.


█ LIMITATIONS

The transported ticker can contain at most 18 encoded characters. Supported characters are uppercase letters, digits, dash, colon, dot, and underscore. Unsupported characters produce a runtime error.

The receiving indicator is responsible for requesting and interpreting data from the transported symbol.


█ CREDITS AND LICENCE

Original work by SVKO. Published open source under the Mozilla Public License 2.0.

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.