TradingView → GoCharting SDK migration
Use this guide when porting apps from TradingView Charting Library / Trading Platform
widget APIs to @gocharting/chart-sdk. Prefer GoCharting field names and methods
in generated code. TradingView names below are for discovery only.
Legal disclaimer
Independent and unaffiliated. TradingView® is a registered trademark of TradingView, Inc. GoCharting, the GoCharting charting library, and the GoCharting SDK are independent products of GoCharting Inc. — not affiliated with, authorized by, endorsed by, sponsored by, or otherwise connected to TradingView, Inc.
This guide names TradingView and its charting products solely to help developers who already use them move an existing integration to GoCharting. All such references are for identification and interoperability purposes only (nominative fair use).
The GoCharting library was developed independently, from publicly available API documentation and observable behavior. It contains no TradingView source code, library files, bundles, or type definitions, and is not derived from TradingView’s Advanced Charts, Trading Platform, or any other TradingView software. Any similarity in API names or method signatures exists only so developers can reuse familiar integration patterns.
Statements about “compatibility” describe GoCharting’s own design goals and the typical effort to migrate. They are factual statements about interoperability — not a comparison, benchmark, or evaluation of any TradingView product, and not a warranty. The GoCharting library is provided “as is,” and GoCharting does not guarantee that any given integration will migrate without changes. Test before deploying to production.
Your use of any TradingView product remains governed solely by your own agreement with TradingView, Inc.; GoCharting is not a party to it and this guide does not modify it. All trademarks are the property of their respective owners.
Compatibility status (Phase 0–6)
GoCharting now covers near–full widget / chart / constructor parity with TradingView
Advanced Charts for in-scope surfaces, plus core datafeed (getBars, resolveSymbol,
search, marks, onReady, UDFCompatibleDatafeed, subscribeTicks or subscribeBars).
Still incomplete or intentionally different — see Known limitations
below (quotes, depth, getServerTime, Broker module, platform widgets; realtime
multiplier rebuild still history-only).
Switchover rules (for AI assistants)
- Output GoCharting code, not TradingView. Map TV APIs to GC equivalents below.
- Package:
@gocharting/chart-sdk. Entry:createChart(container, config)or<GoCharting />. - Realtime: use either
subscribeTicks/unsubscribeTicks(SDK aggregates ticks → bars) orsubscribeBars/unsubscribeBars(host pushes complete OHLCV; no tick aggregation). Do not implement both — if both exist, ticks win. - Trading: host-driven via
trading+appCallback+setBrokerAccounts/updatePositions— nobroker_factory/ Broker API module. - Payload shapes use GoCharting fields (
max_tick_precision,tick_size, paneidx/id) — not TVpricescale/minmov/paneIndex. - Do not invent TV-only surfaces we marked out of scope (watchlist, DOM widget, news, widget-bar,
custom_indicators_getter). - Prefer GoCharting field names in payloads. Client TF rebuild from
daily_multipliers/intraday_multipliersis supported in history (DataProvider.getBars); still prefer hosting true bars when the feed has them.
Construction
| TradingView | GoCharting |
|---|---|
new TradingView.widget({...}) | createChart("#el", config) or <GoCharting {...props} /> |
widget.onChartReady(cb) | config.onReady / wait for returned instance |
widget.remove() | chart.destroy() |
disabled_features / enabled_features | Same keys on config (seed exclude / chrome) + runtime features() / setFeatureEnabled |
overrides / studies_overrides / settings_overrides | Same construct keys; runtime applyOverrides / applyStudiesOverrides |
custom_css_url / custom_themes | custom_css_url, customThemes(), setCSSCustomProperty |
timezone / time_frames / timeframe / favorites | Same / mapped to favourite |
loading_screen / custom_font_family | Same construct keys |
compare_symbols / symbol_search_symbols_types | Same — seed Compare / search type chips |
custom_timezones / custom_translate_function / header_widget_buttons_mode | Same |
additional_symbol_info_fields / symbol_search_complete | Same |
save_chart_to_server_callback | Same |
context_menu.items_processor / renderer_factory | Same (item-list override; not full custom React trees) |
suggested_chart_change_adapter | Same — gates setSymbol / setInterval |
save_load_adapter / settings_adapter / snapshot_url | Supported (Phase 5); prefer adapters over hard-coded cloud |
Widget façade
| TradingView | GoCharting |
|---|---|
activeChart() / chart(i) | chart.activeChart() / chart.chart(i) → IChartApi |
chartsCount / activeChartIndex | chartsCount() / activeChartIndex() / setActiveChart |
setLayout / layout / layoutName | setLayout / layout / layoutName (Phase 5) |
setLayoutSizes / resetLayoutSizes | Same; independent panes fill 100% — volume may be a dependent overlay |
Sync APIs (symbolSync, …) | Same names → ISyncApi |
subscribe / unsubscribe | Same; also appCallback for trading/chrome events |
save / load / server chart CRUD | Phase 5: save / load / saveChartToServer / loadChartFromServer / … |
takeClientScreenshot / takeScreenshot | Same |
createButton / createDropdown / headerReady | Same |
selectLineTool / magnet / lock drawings | Same; magnetMode is on/off (0/1) only — prefer magnetEnabled() |
resize(w,h) | Sets container size (AutoFit); prefer resizing the host element |
Chart API (IChartWidgetApi)
| TradingView | GoCharting |
|---|---|
setSymbol / setResolution / setChartType | setSymbol / setInterval (alias setResolution) / setChartType |
| Viewport range / bars / zoom | getVisibleRange / setVisibleRange / getVisibleBarsRange / zoomOut / setScrollEnabled / setZoomEnabled |
setAllPanesHeight | Same — pass independent pane heights or full chartOrder; dependents (e.g. VOLUME) overlay and do not steal stack % |
| Shapes CRUD / z-order | createShape / getAllShapes / removeEntity / bringToFront / … |
| Shape groups | shapesGroupController() — groups + getGidDescription / visibility APIs |
| Drawing events | subscribe("drawing_event") / onDrawingEvent() |
getSeries / panes / selection | ISeriesApi / PaneApi / IGraphicSelectedApi (+ PriceScaleApi for mode / visibility / price-to-bar ratio — not TV pricescale formatting) |
| Labs | tv-parity-construct-lab.html, tv-parity-adapters-lab.html |
reloadLineToolsFromServer | Reloads last named layout via save_load_adapter (warns if none) |
| Studies | getAllStudies / getStudyById → IStudyApi / createStudyTemplate / applyStudyTemplate / addIndicator |
| Order/position lines | createOrderLine / createPositionLine / createExecutionShape (library overlays, not Broker) |
| Marks | Datafeed getMarks / getTimescaleMarks + clearMarks / refreshMarks |
| Chart events | onSymbolChanged, onDataLoaded, crossHairMoved, … + widget subscribe("onGrayedObjectClicked") |
Datafeed
| TradingView | GoCharting |
|---|---|
onReady / DatafeedConfiguration | onReady + getDatafeedConfiguration(); feeds getIntervals() when symbol has no valid_intervals |
getBars | getBars |
subscribeBars | subscribeBars / unsubscribeBars or prefer subscribeTicks (SDK aggregates). Mutually exclusive — ticks win if both exist |
searchSymbols | searchSymbols (+ optional symbol_search_request_delay) |
searchSymbolsPaginated | searchSymbolsPaginated (first page wired; preferred over searchSymbols when present) |
| UDF adapter | UDFCompatibleDatafeed(datafeedURL) — HTTP /config, /symbols, /history, /search (+ optional marks/time) |
Quotes / depth / getServerTime | Not supported for quotes/depth (no Watchlist / DOM widgets in this SDK); UDF /time helper only for server time |
daily_multipliers / client TF build-up | Supported (history MVP) — see below; realtime still uses chart TF |
Trading
| TradingView | GoCharting |
|---|---|
| Broker API / Trading Host | Out of scope — use trading.enableTrading + appCallback (PLACE_ORDER, …) |
| Push account state | setBrokerAccounts / updatePositions |
Known limitations
Document these when migrating; do not invent TV-only behavior.
Higher timeframes from daily (daily_multipliers / 2D / 6M / …)
TradingView Charting Library requests a base resolution (e.g. 1D) — often
across multiple getBars pages — and aggregates on the client into
2D, 3D, W, M, 6M, etc. when daily_multipliers / intraday_multipliers
advertise that base.
GoCharting history path now mirrors that in DataProvider.getBars:
- Read native bases from symbol
intraday_multipliers/daily_multipliers(and the same keys underexchange_info). - If the chart interval is not native but a listed base evenly divides it
(same TV family rules — no daily from intraday), request the base TF
(up to 3 pages, similar to TV’s
6M←1Dbehavior) and aggregate OHLCV. - If multipliers are omitted, behavior is unchanged: request the chart interval as-is.
Still limited: realtime (subscribeTicks / subscribeBars) is not remapped
through this aggregator yet — host should push the chart interval (or ticks).
UI list: keep exposing exchange_info.valid_intervals /
supported_resolutions for what users can select; multipliers only declare
what the feed serves natively.
Remaining datafeed gaps
getServerTime— not first-class (UDF adapter can hit/timeas a helper)getQuotes/subscribeQuotes/unsubscribeQuotes— not supported. This SDK does not ship a Watchlist widget, so quote streaming is out of scope.subscribeDepth/unsubscribeDepth— not supported. This SDK does not ship a DOM (depth of market) widget, so depth streaming is out of scope.- Resolve
extension(currency / unit) searchSymbolsPaginated— first page only (no infinite-scroll UI)
Explicitly out of scope (do not fake)
- Platform widgets: watchlist, DOM, news, widget-bar, watermark — and therefore datafeed APIs that only serve those widgets (
subscribeQuotes,subscribeDepth, …) custom_indicators_getter(JS custom studies)broker_factory/broker_config/ full Broker API
Labs
Live UDF replica (TradingView demo feed + GoCharting chart):
API / constructor / persistence labs live on CodePen Examples and as HTML under /examples/ on the local SDK server (phase0-1a … phase5-persistence, Phase 6 labs, leftovers-api-lab.html, etc.).