Polygon.io TradingView Adapter
JS Library for using Polygon.io with TradingView charting.
Installation
npm i @polygon.io/tradingview-adapter --save-dev
Usage
import PolygonAdapter from '@polygon.io/tradingview-adapter'
const client = new PolygonAdapter({
apikey: 'YOUR_APIKEY',
realtimeEnabled: true
})
const widget = new TradingView.widget({
fullscreen: true,
symbol: 'AAPL',
interval: '1D',
timezone: 'America/New_York',
container_id: "tv_chart_container",
datafeed: client,
library_path: "/charting_library/",
locale: "en",
disabled_features: ["use_localstorage_for_settings"],
enabled_features: ["study_templates"],
charts_storage_url: 'http://saveload.tradingview.com',
charts_storage_api_version: "1.1",
client_id: 'tradingview.com',
user_id: 'public_user_id',
theme: 'Light',
})
Currently only stocks are supported at 1min and 1day intervals. This will be fixed soon.