This project uses the TradingView charting library with a custom datafeed built using the Bitquery OHLC API. It supports multiple trading sessions and displays historical OHLC data using a local cache mechanism.
📊 Custom TradingView chart setup
🔁 Multi-session trading support (24x7)
⏱️ Supports multiple time resolutions: 1, 5, 15, 30, 60, 1D, 1W, 1M
🧠 Caching of historical OHLC data using in-memory ohlcCache
🧪 JSON-based data loading from /ohlc.json
| File / Path | Description |
|---|---|
src/App.js |
Entry point with chart container |
src/TVChartContainer.js |
Chart initialization and layout |
src/custom_datafeed.js |
Core TradingView-compatible datafeed |
src/getBars.js |
Handles bar retrieval and real-time update stubs |
src/histOHLC.js |
Loads historical OHLC data from cache |
src/ohlcCache.js |
Global in-memory cache for OHLC data |
src/resolveSymbol.js |
Symbol resolution using URL params |
src/onReady.js |
TradingView datafeed's onReady implementation |
-
Clone this repository:
git clone https://github.com/your-username/tradingview-bitquery-chart.git cd tradingview-bitquery-chart -
Install dependencies:
npm install
-
Add
ohlc.jsonin the public folder:-
The file should contain OHLC bars keyed by trading pairs:
{ "TOKENA/TOKENB": [ { "time": 1620000000, "open": 1.23, "high": 1.5, "low": 1.1, "close": 1.4, "volume": 1000 }, ... ] }
-
-
Start the development server:
npm start
-
Open your browser at:
http://localhost:3000/?base=TOKENA"e=TOKENB