Technical reference for the AmiBroker plugin

Understand the gsTradingView runtime

This page documents how gsTradingView resolves symbols, downloads bars, refreshes live quotes, stores cache files, and handles licensing.

Runtime flow

TradingView data inside AmiBroker

Live + historical

1. Symbol resolution

The plugin maps AmiBroker tickers to TradingView symbols using market-aware rules.

2. Historical download

Bars are downloaded through TradingView's websocket feed and stored in a local cache.

3. Live polling

The last quote is refreshed periodically and applied to the chart so the latest bar stays current.

4. License check

The plugin validates the machine-bound license file before enabling full operation.

Architecture

Data path and internal responsibilities

gsTradingView is a Win32 AmiBroker data plugin. It resolves symbols online, downloads bars from TradingView, stores them in a local cache, and refreshes the latest quote on a timer.

Symbol lookup

AmiBroker tickers are translated into TradingView symbols using the selected market and the ticker format.

Historical fetch

Historical bars are downloaded through the TradingView websocket session and written to the local cache.

Live refresh

A polling thread refreshes the most recent quote every few seconds and updates the chart's current bar when needed.

Cache layer

Repeated requests can be served from disk cache to avoid unnecessary downloads.

License layer

The plugin checks the machine code, registered name, issue date, expiry date, and signature from a local license file.

Status layer

AmiBroker receives status messages and, when supported, a color-coded indicator for ready, loading, and error states.

Dialog settings

Every dialog option explained

Chart tab

  • Extended trading hours: includes pre-market and after-hours data when TradingView provides it.
  • Adjusted prices for splits: uses split-adjusted TradingView history for equity symbols.
  • Use settlement as close: uses the settlement price as the daily close when the market requires it.
  • Timeframe override: forces a specific TradingView interval instead of automatic selection.
  • Intraday shift: shifts intraday timestamps by minutes to match the exchange session.
  • EOD shift: shifts daily timestamps by whole days when the exchange date needs alignment.

Connection tab

  • Market: routing hint for symbol resolution. Use auto unless a market must be forced.
  • Username / Password: optional TradingView credentials for markets that require authentication.
  • User agent: HTTP identity string used for symbol lookup and websocket requests.
  • Timeout ms: timeout value for HTTP and websocket operations.
  • Poll seconds: live quote refresh interval. Five seconds is the recommended default.

License tab

  • License status: shows whether the plugin is trial, expired, or licensed.
  • Trial days / Trial start: used only when no annual license file exists.
  • License name / key / expiry: legacy fields retained for compatibility and support.
  • Machine code: machine fingerprint used to bind the license file to one PC.

Tools tab

  • Copy code: copies the machine fingerprint to the clipboard.
  • Open folder: opens the plugin folder containing the license file.
  • Re-download: clears cache and downloads the selected symbol again.
  • Reference page: opens this documentation page in the browser.
  • Clear cache: removes stored quote files and forces a fresh download later.

Polling and updates

Live quote refresh rules

The plugin polls TradingView on a timer. It is a periodic refresh, not a raw tick stream, and it updates the last known price plus the current chart bar when needed.

When the market is open

The plugin keeps the most recent bar aligned with the latest price. For daily data, it appends a new bar only when the session really rolls forward.

When the market is closed

No phantom daily candle is created. The last historical bar is updated so the chart still reflects the latest close.

Recommended poll interval

Five seconds is the recommended default. Lower values increase request volume and add pressure on TradingView.

What to expect in logs

You should see live quote success messages and the overlay result. Verbose websocket lines stay hidden unless debug logging is enabled.

Failure checks

Checks for the usual failures

No quotes appear

Check the ticker format, market routing, license file, internet access, and the database INI used by AmiBroker.

Wrong market symbol

Use the exchange prefix TradingView expects, for example XETR:DB1 instead of a local alias.

History not adjusting for splits

Use the re-download action after clearing cache. The plugin requests split-adjusted history from TradingView.

License file seems ignored

Make sure gsTradingView.lic is in the AmiBroker Plugins folder and that the machine code matches the current PC.

Data flow

Symbol lookup, historical bars, local cache, and live refresh are the four main layers.

Best defaults

Use auto market routing, five-second polling, and split-adjusted prices unless you have a specific reason not to.

Operational rule

If a chart looks odd, clear cache and re-download. If the license looks wrong, verify the license file and machine code first.

Runtime summary

Use this page when you need to check symbol routing, cache behavior, polling, or license handling.