Skip to content

Divyn/tradingview-charting-multiple-session

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

TradingView Charting For Crypto Data with Multiple Tabs

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.

Features

📊 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 Structure

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

Installation & Setup

  1. Clone this repository:

    git clone https://github.com/your-username/tradingview-bitquery-chart.git
    cd tradingview-bitquery-chart
    
  2. Install dependencies:

    npm install
    
  3. Add ohlc.json in 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 },
          ...
        ]
      }
      
  4. Start the development server:

    npm start
    
  5. Open your browser at:

    http://localhost:3000/?base=TOKENA&quote=TOKENB
    
    

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •