TradingView Charting Library on a PHP site is your own candlestick chart on your domain, not someone else's iframe with someone else's logo. The quotes script returns history and ticks; the library draws scale, volume, and indicators. For the integrator, the chain is feed to datafeed to canvas, not "paste a widget and forget".
If a binary options or Forex terminal shows a blank plane instead of candles, nine times out of ten the API response is the issue, not terminal CSS. The chart draws only what the datafeed returns. Empty candle arrays, broken symbols, or CORS on the quotes host all look the same: gray canvas and spinner.
What is installed
The library lives in your static JS, not on TradingView CDN as a public widget. You connect it to a terminal page or an instrument card. Datafeed is a PHP layer or separate service: history by symbol and timeframe, subscription to bar updates, and symbol resolution.
The symbol must match the feed. If the market table stores BTCUSDT while the datafeed expects BTC/USDT, the chart will not open or will freeze at the last bar. The same applies to Forex: EURUSD and EUR/USD are different keys until you normalize them.
- History: REST or internal candle endpoint with timestamps.
- Realtime: WebSocket ticks or bar polling if ticks are unavailable.
- Symbol dictionary: one list for table, ticker, and chart.
- Domain access: library and API on one origin or explicit CORS.
Typical failures after deployment
Common first-day issue: the terminal runs from a local .loc host, while the quotes API uses a production whitelist, so the browser blocks the request. Or production chart points to staging feed and candles are an hour old. Users call it a frozen chart, but the last bar is simply stale.
Second classic issue is timeframe. The datafeed returns M1 while the UI opens H1 and waits for aggregation that does not exist. Or you return Unix time in seconds while the library expects milliseconds, so candles move to 1970. Catch this in Network: inspect history and verify time/open/high/low/close.
- Open the history endpoint without UI and confirm the array is not empty.
- Compare the symbol with the asset card and terminal config.
- Check that the last candle is fresh for the selected timeframe.
- Look for library chunk 404s and CORS errors in the browser console.
Quotes are described in quotes manual and quotes API. For sockets, also see WebSocket quotes.
Broker terminal connection
On a white-label platform, the chart is not a decorative site. The price on the canvas must match the price used for binary expiration or Forex margin. A one or two point difference may pass on demo; on a real account it becomes a support claim immediately.
Before opening registration, test one training account, one instrument, one timeframe. The tick must move the last candle. A deal history price should be within spread relative to the chart at click time. If the chart updates every five seconds while orders use another channel, users will say they clicked at another price.
Indicators and load
The library has many indicators. That does not mean all should be enabled in the default terminal layout. Heavy indicators plus dense WebSocket traffic across many pairs can lag the UI. Keep the preset conservative: candles, volume, and a few popular indicators.
Do not store tick streams in PHP sessions. PHP can return datafeed config and REST history. A separate process or proxy should hold the market-data stream. Otherwise worker limits and timeouts appear as blinking empty chart updates.
Local debugging on .loc
MicroServer is convenient for local terminal testing, but quotes often live on another host. Set an explicit datafeed API URL and verify DNS or hosts resolution. Self-signed HTTPS on the API with an https terminal page can trigger mixed-content or certificate blocks; curl may still return 200 while the browser refuses.
A small standalone HTML page with only the library and datafeed helps separate problems. If it draws and the terminal does not, inspect product symbol routing. If it is empty too, inspect the feed.
Crypto, Forex, stocks: one canvas
The same Charting Library can serve crypto pairs, currencies, and stocks if connected. The library does not change; the instrument dictionary and price step do. Crypto often needs higher precision; Forex commonly uses 4 or 5 digits. Wrong precision looks like a broken chart with squeezed or jumping candles.
For a CoinMarket-style showcase, the chart on a coin page must read the same ID as the table row. Otherwise BTC opens empty or shows the wrong asset. See CoinMarket script and crypto charts.
What to hand over
Before handover, capture screenshots or a short video of a live M1 tick, timeframe change without error, and price matching the terminal row. Add to the runbook: history URL, WS URL if any, symbol mapping table, and allowed domains. Without this, support will debug a frozen chart by guessing.
White-label branding does not fix a dead feed. Data first, branding second. Platform overview: white label, options: BO platform, currencies: Forex.
The formula is simple: TradingView Library draws, your datafeed feeds, and the quotes script defines the price truth. If symbol, time, and domain access match, a PHP-site chart looks like a real terminal, not a pasted image.
FAQ
Tradingview library php integration?
A candlestick chart on your domain: TradingView library and Microscript quotes feed.
How long does “TradingView Library: Quote Chart on PHP” take?
About 6 minutes to read. In practice it depends on your hosting and database setup.
Do I need a dedicated server?
For most scripts, shared hosting or a VDS with PHP and MySQL is enough. See the VDS section and PHP/MySQL requirements.
Cryptocurrency rates script for your site?
See the related manual for this query. cryptocurrency rates script for your site
Forex quotes api websocket?
See the related manual for this query. forex quotes api websocket