Skip to content

JS Library for using Polygon.io with TradingView charting.

Notifications You must be signed in to change notification settings

polygon-io/tradingview-adapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 	// True(default) = Use websockets for updates. False = use polling for new data.
})

const widget = new TradingView.widget({
	fullscreen: true,
	symbol: 'AAPL',
	interval: '1D',
	timezone: 'America/New_York',
	container_id: "tv_chart_container", /* ID of the container element */
	datafeed: client, /* Our Polygon.io Adapter */
	library_path: "/charting_library/", /* Where your TV Library files reside */
	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', /* Light or Dark */
})

Currently only stocks are supported at 1min and 1day intervals. This will be fixed soon.

Releases

No releases published

Packages

No packages published