OPEN-SOURCE SCRIPT
SVKO CFD Symbol Mapper

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.
█ 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.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.