Skip to Content
AI AssistantTV → GC Migration

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.

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)

  1. Output GoCharting code, not TradingView. Map TV APIs to GC equivalents below.
  2. Package: @gocharting/chart-sdk. Entry: createChart(container, config) or <GoCharting />.
  3. Realtime: use either subscribeTicks / unsubscribeTicks (SDK aggregates ticks → bars) or subscribeBars / unsubscribeBars (host pushes complete OHLCV; no tick aggregation). Do not implement both — if both exist, ticks win.
  4. Trading: host-driven via trading + appCallback + setBrokerAccounts / updatePositionsno broker_factory / Broker API module.
  5. Payload shapes use GoCharting fields (max_tick_precision, tick_size, pane idx/id) — not TV pricescale / minmov / paneIndex.
  6. Do not invent TV-only surfaces we marked out of scope (watchlist, DOM widget, news, widget-bar, custom_indicators_getter).
  7. Prefer GoCharting field names in payloads. Client TF rebuild from daily_multipliers / intraday_multipliers is supported in history (DataProvider.getBars); still prefer hosting true bars when the feed has them.

Construction

TradingViewGoCharting
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_featuresSame keys on config (seed exclude / chrome) + runtime features() / setFeatureEnabled
overrides / studies_overrides / settings_overridesSame construct keys; runtime applyOverrides / applyStudiesOverrides
custom_css_url / custom_themescustom_css_url, customThemes(), setCSSCustomProperty
timezone / time_frames / timeframe / favoritesSame / mapped to favourite
loading_screen / custom_font_familySame construct keys
compare_symbols / symbol_search_symbols_typesSame — seed Compare / search type chips
custom_timezones / custom_translate_function / header_widget_buttons_modeSame
additional_symbol_info_fields / symbol_search_completeSame
save_chart_to_server_callbackSame
context_menu.items_processor / renderer_factorySame (item-list override; not full custom React trees)
suggested_chart_change_adapterSame — gates setSymbol / setInterval
save_load_adapter / settings_adapter / snapshot_urlSupported (Phase 5); prefer adapters over hard-coded cloud

Widget façade

TradingViewGoCharting
activeChart() / chart(i)chart.activeChart() / chart.chart(i)IChartApi
chartsCount / activeChartIndexchartsCount() / activeChartIndex() / setActiveChart
setLayout / layout / layoutNamesetLayout / layout / layoutName (Phase 5)
setLayoutSizes / resetLayoutSizesSame; independent panes fill 100% — volume may be a dependent overlay
Sync APIs (symbolSync, …)Same names → ISyncApi
subscribe / unsubscribeSame; also appCallback for trading/chrome events
save / load / server chart CRUDPhase 5: save / load / saveChartToServer / loadChartFromServer / …
takeClientScreenshot / takeScreenshotSame
createButton / createDropdown / headerReadySame
selectLineTool / magnet / lock drawingsSame; magnetMode is on/off (0/1) only — prefer magnetEnabled()
resize(w,h)Sets container size (AutoFit); prefer resizing the host element

Chart API (IChartWidgetApi)

TradingViewGoCharting
setSymbol / setResolution / setChartTypesetSymbol / setInterval (alias setResolution) / setChartType
Viewport range / bars / zoomgetVisibleRange / setVisibleRange / getVisibleBarsRange / zoomOut / setScrollEnabled / setZoomEnabled
setAllPanesHeightSame — pass independent pane heights or full chartOrder; dependents (e.g. VOLUME) overlay and do not steal stack %
Shapes CRUD / z-ordercreateShape / getAllShapes / removeEntity / bringToFront / …
Shape groupsshapesGroupController() — groups + getGidDescription / visibility APIs
Drawing eventssubscribe("drawing_event") / onDrawingEvent()
getSeries / panes / selectionISeriesApi / PaneApi / IGraphicSelectedApi (+ PriceScaleApi for mode / visibility / price-to-bar ratio — not TV pricescale formatting)
Labstv-parity-construct-lab.html, tv-parity-adapters-lab.html
reloadLineToolsFromServerReloads last named layout via save_load_adapter (warns if none)
StudiesgetAllStudies / getStudyByIdIStudyApi / createStudyTemplate / applyStudyTemplate / addIndicator
Order/position linescreateOrderLine / createPositionLine / createExecutionShape (library overlays, not Broker)
MarksDatafeed getMarks / getTimescaleMarks + clearMarks / refreshMarks
Chart eventsonSymbolChanged, onDataLoaded, crossHairMoved, … + widget subscribe("onGrayedObjectClicked")

Datafeed

TradingViewGoCharting
onReady / DatafeedConfigurationonReady + getDatafeedConfiguration(); feeds getIntervals() when symbol has no valid_intervals
getBarsgetBars
subscribeBarssubscribeBars / unsubscribeBars or prefer subscribeTicks (SDK aggregates). Mutually exclusive — ticks win if both exist
searchSymbolssearchSymbols (+ optional symbol_search_request_delay)
searchSymbolsPaginatedsearchSymbolsPaginated (first page wired; preferred over searchSymbols when present)
UDF adapterUDFCompatibleDatafeed(datafeedURL) — HTTP /config, /symbols, /history, /search (+ optional marks/time)
Quotes / depth / getServerTimeNot supported for quotes/depth (no Watchlist / DOM widgets in this SDK); UDF /time helper only for server time
daily_multipliers / client TF build-upSupported (history MVP) — see below; realtime still uses chart TF

Trading

TradingViewGoCharting
Broker API / Trading HostOut of scope — use trading.enableTrading + appCallback (PLACE_ORDER, …)
Push account statesetBrokerAccounts / 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:

  1. Read native bases from symbol intraday_multipliers / daily_multipliers (and the same keys under exchange_info).
  2. 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 6M1D behavior) and aggregate OHLCV.
  3. 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 /time as a helper)
  • getQuotes / subscribeQuotes / unsubscribeQuotesnot supported. This SDK does not ship a Watchlist widget, so quote streaming is out of scope.
  • subscribeDepth / unsubscribeDepthnot 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):

Open in CodePen  | Full screen 

API / constructor / persistence labs live on CodePen Examples and as HTML under /examples/ on the local SDK server (phase0-1aphase5-persistence, Phase 6 labs, leftovers-api-lab.html, etc.).

Last updated on