Repository navigation
Expand file tree
/
Copy pathllms.txt
More file actions
26 lines (22 loc) 路 2.61 KB
/
Copy pathllms.txt
File metadata and controls
26 lines (22 loc) 路 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# TradingView-API
# https://github.com/Mathieu2301/TradingView-API
# https://www.npmjs.com/package/@mathieuc/tradingview
Independent community library for TradingView market data. Not an official TradingView API.
Version 4 release candidate: TypeScript, ESM, Node >= 20 or Bun. Breaking rewrite of v3 (no compatibility layer). Install the prerelease with npm install @mathieuc/tradingview@next; the default latest tag remains v3.
Simple data API (import from '@mathieuc/tradingview/data' or the root entry):
- getCandles({ symbol, timeframe?, count?, from?, to?, chartType?, ... }) -> Candle[] oldest first, time in Unix seconds.
- watchCandles(query, { onData, onError? }) -> watcher { latest, stop(), closed }.
- getQuote(symbol), getQuotes({ symbols }), watchQuotes({ symbols }, { onData }).
- getSymbolInfo(symbol), getIndicatorData({ symbol, indicator, inputs? }), watchIndicator(...).
- getScreener({ columns, market?, filter?, sort?, range?, symbols? }) -> { totalCount, rows }; one HTTP page, not a streaming screener.
- getHotlist({ kind, ... }) -> scanner-ranked rows, not guaranteed TradingView UI parity.
- getWatchlists({ credentials }) -> read-only account lists with ordered symbols and section markers.
- searchMarkets(text), searchIndicators(text), getTechnicalAnalysis(symbol).
- Websocket data calls accept timeoutMs, signal (AbortSignal), credentials ({ session, signature }) and client (shared TradingViewClient). HTTP lookups accept signal in options.
- Candle calls can use a custom MarketDataProvider; TradingViewProvider is the default source adapter.
- Errors are TradingViewError with a code (SYMBOL_ERROR, TIMEOUT, STUDY_ERROR, NO_DATA...).
Low-level API: TradingViewClient, client.createChart() (ChartSession: setMarket, setTimeframe, fetchMore, replay, createStudy), client.createQuoteSession(), PineIndicator, BuiltInIndicator, HTTP functions (loginUser, getUser, getIndicator, getPrivateIndicators, getDrawings, PinePermissionManager).
Pine studies need a TradingView account (session cookies). Built-in studies and candles/quotes work anonymously, with history limits.
Docs: docs/data-api.md, docs/low-level-api.md, docs/migration-v4.md, docs/v4-coverage.md, docs/v4-reliability.md, docs/protocol-contributing.md. Examples: examples/.
The next release adds an interactive setup CLI: npx @mathieuc/tradingview@next (not present in RC.0). It opens Molted Studio, launches a local coding agent with a prompt, prints that prompt, or installs the library. It is not a market-data query CLI. No MCP server, backtesting engine or hosted trading API is shipped.
Questions and bugs: https://github.com/Mathieu2301/TradingView-API/issues/new/choose