@mathieuc/tradingview 4.0.0-beta.1 → 4.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -25,7 +25,7 @@ console.log(candles.at(-1)); // { time, open, high, low, close, volume }
25
25
 
26
26
  Prefer to start without code? The setup paths below work too.
27
27
 
28
- > **Version 4 is a breaking rewrite** in TypeScript, with a new API and no compatibility layer. Coming from v3? Read the [migration guide](docs/migration-v4.md). Every v3 feature is still available: see the [coverage matrix](docs/v4-coverage.md). npm versions 3.x keep the previous `Client` API; check the [npm page](https://www.npmjs.com/package/@mathieuc/tradingview) for the version you install.
28
+ > **Version 4 is a breaking rewrite** in TypeScript, with a new API and no compatibility layer. Coming from v3? Read the [migration guide](docs/migration-v4.md). Every v3 feature is still available: see the [coverage matrix](docs/v4-coverage.md) and [reliability evidence](docs/v4-reliability.md). npm versions 3.x keep the previous `Client` API; check the [npm page](https://www.npmjs.com/package/@mathieuc/tradingview) for the version you install.
29
29
 
30
30
  ## Get started
31
31
 
@@ -28,3 +28,5 @@ export type { GraphicsData } from '../chart/graphics.js';
28
28
  export type { StrategyReport } from '../chart/strategy.js';
29
29
  export { summarizeStrategyReport } from '../chart/strategy.js';
30
30
  export type { StrategySummary } from '../chart/strategy.js';
31
+ export { getScreener } from '../http/screener.js';
32
+ export type { ScreenerFilter, ScreenerQuery, ScreenerResult, ScreenerRow } from '../http/screener.js';
@@ -14,3 +14,4 @@ export { DEFAULT_TIMEOUT_MS } from './operation.js';
14
14
  export { getTechnicalAnalysis, searchIndicators, searchMarkets, } from '../http/index.js';
15
15
  export { TradingViewError } from '../errors.js';
16
16
  export { summarizeStrategyReport } from '../chart/strategy.js';
17
+ export { getScreener } from '../http/screener.js';
@@ -109,13 +109,13 @@ export async function getUser(credentials, options = {}) {
109
109
  if (!credentials?.session)
110
110
  throw new TradingViewError('INVALID_ARGUMENT', 'A session cookie is required');
111
111
  const maxRedirects = options.maxRedirects ?? 5;
112
- let location = trustedAccountLocation(options.location ?? 'https://www.tradingview.com/');
112
+ let location = trustedAccountLocation(options.location ?? 'https://www.tradingview.com/chart/');
113
113
  for (let redirects = 0;; redirects += 1) {
114
- const { text, headers } = await request(location, { credentials, redirect: 'manual' }, options);
114
+ const { status, text, headers } = await request(location, { credentials, redirect: 'manual' }, options);
115
115
  if (text.includes('auth_token'))
116
116
  return parseUserPage(text, credentials);
117
117
  const next = headers.get('location');
118
- const resolved = next ? new URL(next, location).toString() : undefined;
118
+ const resolved = status >= 300 && status < 400 && next ? new URL(next, location).toString() : undefined;
119
119
  if (!resolved || resolved === location) {
120
120
  throw new TradingViewError('AUTH_ERROR', 'Wrong or expired sessionid/signature');
121
121
  }
@@ -9,3 +9,5 @@ export { getChartToken, getDrawings } from './layouts.js';
9
9
  export type { Drawing, DrawingPoint, GetDrawingsOptions, LayoutOptions, } from './layouts.js';
10
10
  export { PinePermissionManager } from './pine-permissions.js';
11
11
  export type { AuthorizedUser, AuthorizedUserOrder, PinePermissionOptions } from './pine-permissions.js';
12
+ export { getScreener } from './screener.js';
13
+ export type { ScreenerFilter, ScreenerQuery, ScreenerResult, ScreenerRow } from './screener.js';
@@ -3,3 +3,4 @@ export { getTechnicalAnalysis, searchMarkets } from './market.js';
3
3
  export { clearIndicatorCache, getIndicator, getPrivateIndicators, parseIndicatorDefinition, searchIndicators, } from './indicators.js';
4
4
  export { getChartToken, getDrawings } from './layouts.js';
5
5
  export { PinePermissionManager } from './pine-permissions.js';
6
+ export { getScreener } from './screener.js';
@@ -17,6 +17,10 @@ export interface MarketSearchResult {
17
17
  export interface SearchMarketsOptions extends HttpOptions {
18
18
  /** Restricts results to a market type. */
19
19
  type?: MarketType;
20
+ /** Restricts results to an ISO country code, such as `US`. */
21
+ country?: string;
22
+ /** Restricts results to a sector, such as `Finance`. */
23
+ sector?: string;
20
24
  /** Pagination offset. */
21
25
  offset?: number;
22
26
  /** Restricts results to an exchange. `searchMarkets('BINANCE:BTC')` sets it too. */
@@ -9,6 +9,7 @@ export async function searchMarkets(query, options = {}) {
9
9
  const { data, status } = await request('https://symbol-search.tradingview.com/symbol_search/v3/', {
10
10
  query: {
11
11
  text, exchange, search_type: options.type ?? '', start: options.offset ?? 0,
12
+ country: options.country, sector: options.sector,
12
13
  },
13
14
  headers: ORIGIN,
14
15
  }, options);
@@ -0,0 +1,32 @@
1
+ import { type AuthHttpOptions } from './request.js';
2
+ export interface ScreenerFilter {
3
+ left: string;
4
+ operation: string;
5
+ right?: unknown;
6
+ }
7
+ export interface ScreenerQuery {
8
+ /** Scanner universe, e.g. america, crypto, forex or global. */
9
+ market?: string;
10
+ /** Exact scanner field names, including optional timeframe suffixes. */
11
+ columns: string[];
12
+ filter?: ScreenerFilter[];
13
+ sort?: {
14
+ sortBy: string;
15
+ sortOrder: 'asc' | 'desc';
16
+ };
17
+ /** Zero-based, end-exclusive page range. Defaults to [0, 50]. */
18
+ range?: [number, number];
19
+ /** Optional exchange-qualified symbols. */
20
+ symbols?: string[];
21
+ }
22
+ export interface ScreenerRow {
23
+ symbol: string;
24
+ /** Values retain upstream types and nulls; keys match requested columns. */
25
+ values: Record<string, unknown>;
26
+ }
27
+ export interface ScreenerResult {
28
+ totalCount: number;
29
+ rows: ScreenerRow[];
30
+ }
31
+ /** One scanner page. This does not subscribe to live prices or grant exchange entitlements. */
32
+ export declare function getScreener(query: ScreenerQuery, options?: AuthHttpOptions): Promise<ScreenerResult>;
@@ -0,0 +1,36 @@
1
+ import { TradingViewError } from '../errors.js';
2
+ import { request } from './request.js';
3
+ /** One scanner page. This does not subscribe to live prices or grant exchange entitlements. */
4
+ export async function getScreener(query, options = {}) {
5
+ const market = query.market ?? 'global';
6
+ const range = query.range ?? [0, 50];
7
+ if (!/^[a-z][a-z0-9_-]*$/i.test(market)
8
+ || !Array.isArray(query.columns) || !query.columns.length
9
+ || query.columns.some((column) => typeof column !== 'string' || !column.trim())
10
+ || new Set(query.columns).size !== query.columns.length
11
+ || range.length !== 2 || !range.every(Number.isSafeInteger) || range[0] < 0 || range[1] <= range[0]) {
12
+ throw new TradingViewError('INVALID_ARGUMENT', 'Invalid screener market, columns or page range');
13
+ }
14
+ const { data, status } = await request(`https://scanner.tradingview.com/${market}/scan`, {
15
+ method: 'POST',
16
+ credentials: options.credentials,
17
+ headers: { origin: 'https://www.tradingview.com' },
18
+ json: {
19
+ columns: query.columns, range, filter: query.filter ?? [], sort: query.sort,
20
+ symbols: query.symbols === undefined ? undefined : { tickers: query.symbols },
21
+ },
22
+ }, options);
23
+ if (status < 200 || status >= 300 || !data || !Number.isSafeInteger(data.totalCount)
24
+ || data.totalCount < 0 || !Array.isArray(data.data)
25
+ || data.data.some((row) => !row || typeof row.s !== 'string'
26
+ || !Array.isArray(row.d) || row.d.length !== query.columns.length)) {
27
+ throw new TradingViewError('HTTP_ERROR', `Unexpected screener response (HTTP ${status})`);
28
+ }
29
+ return {
30
+ totalCount: data.totalCount,
31
+ rows: data.data.map((row) => ({
32
+ symbol: row.s,
33
+ values: Object.fromEntries(query.columns.map((column, index) => [column, row.d[index]])),
34
+ })),
35
+ };
36
+ }
package/docs/data-api.md CHANGED
@@ -283,3 +283,9 @@ Every failure is a `TradingViewError` with a `code`:
283
283
  | `CALLBACK_ERROR` | A watcher callback threw; the stream remains active. |
284
284
 
285
285
  `error.details` keeps the raw server payload when there is one.
286
+
287
+ ## Screener
288
+
289
+ Use [`getScreener`](screener.md) for a single scanner page with custom columns,
290
+ filters, ranking and explicit pagination. Available from this high-level entry
291
+ point as well as the root package; no chart or quote session is required.
@@ -211,3 +211,14 @@ protocol.createSessionId('cs'); // 'cs_Ab12Cd34Ef56'
211
211
  ```
212
212
 
213
213
  Frames are `~m~<length>~m~<payload>`, where the length counts UTF-16 code units; heartbeats are `~h~<id>` and must be echoed (the client does it).
214
+
215
+ ### Country and sector search filters
216
+
217
+ ```js
218
+ const banks = await searchMarkets('', {
219
+ type: 'common_stock', country: 'US', sector: 'Finance', exchange: 'NASDAQ',
220
+ });
221
+ ```
222
+
223
+ `country` and `sector` are optional TradingView symbol-search filters. They combine
224
+ with `type`, `exchange`, and `offset`; omitting them preserves the default search.
@@ -0,0 +1,75 @@
1
+ # Extending the TradingView protocol
2
+
3
+ This guide is for maintainers and coding agents. The protocol is undocumented and
4
+ may change upstream. Start from an observed exchange, not a guessed command name.
5
+
6
+ ## 1. Establish a reproducible case
7
+
8
+ Record the issue, symbol, timeframe, account plan, study identifier and expected
9
+ behavior. Separate a missing implementation from an entitlement refusal, stale
10
+ cookie, closed market or browser-only feature. Confirm the same operation in the
11
+ matching TradingView account before asserting parity.
12
+
13
+ For browser captures, keep only the minimal request/response sequence needed to
14
+ explain the behavior. Remove cookies, auth tokens, account identifiers and private
15
+ script source. Never commit a raw authenticated network log.
16
+
17
+ ## 2. Choose the layer
18
+
19
+ | Concern | Implementation | Regression tests |
20
+ | --- | --- | --- |
21
+ | Frame lengths, heartbeats, packet decoding | `src/protocol/` | `tests/unit/protocol.test.ts` |
22
+ | Socket lifecycle and session routing | `src/client/` | `tests/unit/client.test.ts` |
23
+ | Chart commands, candle state, Replay | `src/chart/chart-session.ts` | `tests/unit/chart.test.ts` |
24
+ | Study updates and graphics | `src/chart/study.ts`, `graphics.ts` | `tests/unit/study.test.ts` |
25
+ | Plain/compressed strategy reports | `src/chart/strategy.ts` | `tests/unit/strategy.test.ts` |
26
+ | HTTP endpoints | `src/http/` | `tests/unit/http.test.ts` |
27
+ | One-shot calls and cancellable watchers | `src/data/` | `tests/unit/data.test.ts` |
28
+
29
+ Read the closest implementation and test before editing. Preserve the distinction
30
+ between native `BuiltInIndicator` identifiers and Pine identifiers resolved by
31
+ `getIndicator`. A chart session is not the browser's existing chart. Deep
32
+ Backtesting uses a separate history protocol; ordinary strategy reports do not
33
+ prove support for it.
34
+
35
+ ## 3. Make the contract explicit
36
+
37
+ Define public types, units, ordering and missing-value behavior. Candle timestamps
38
+ are Unix seconds and high-level candles are oldest first. Preserve unknown values
39
+ as unknown instead of converting absence into zero. Keep existing exports and
40
+ cancellation/timeout behavior. HTTP additions use the existing request helper and
41
+ accept injected `fetch` and `signal`; socket additions use existing session routing.
42
+
43
+ For stateful packets, test initial data, incremental updates, malformed payloads,
44
+ server errors and cleanup. Validate a complete update before mutating state. A
45
+ watcher must stop on cancellation/disconnection and release listeners/sessions.
46
+ Do not promise automatic reconnect: the current client is terminal after close.
47
+
48
+ ## 4. Verify at the right strength
49
+
50
+ ```sh
51
+ npm ci
52
+ npm run check
53
+ npm run test:bun
54
+ npm audit
55
+ ```
56
+
57
+ For upstream behavior, run a small bounded live probe or `npm run test:live`.
58
+ Authenticated tests read `SESSION` and `SIGNATURE` from the environment; do not put
59
+ them in examples, logs or command arguments. Run live tests only with authorized
60
+ accounts/assets. Record the tested symbol, timeframe and account tier, not secrets.
61
+
62
+ Use `npm run probe:parity` for the documented V3/V4 candle comparison and
63
+ `npm run probe:endurance -- --minutes=2 --cycle-seconds=30` for a short lifecycle
64
+ smoke. See [reliability evidence](v4-reliability.md) for setup and longer probes.
65
+ A rotating-connection run is not a single long-lived connection reproduction;
66
+ a crypto probe cannot establish forex or subscribed-futures parity.
67
+
68
+ ## 5. Deliver without overstating coverage
69
+
70
+ Update API docs, a runnable example if useful, [coverage](v4-coverage.md) and the
71
+ relevant [backlog disposition](v4-backlog-triage.md). Distinguish mocked regression,
72
+ live observation and unresolved account-specific reports. Include commands and
73
+ results in the PR; inspect all CI jobs, including non-blocking live failures.
74
+ Publish prereleases with `--tag beta` only. Keep `latest` on V3 until a separate
75
+ stable-release decision; a merged PR does not itself publish an npm version.
@@ -0,0 +1,25 @@
1
+ # 4.0.0-beta.2
2
+
3
+ Target npm dist-tag: **beta**. Keep **latest** on 3.5.2.
4
+
5
+ ## Changes since beta.1
6
+
7
+ - Account lookup starts on `/chart/` and follows only HTTP redirects (#321).
8
+ - Market search accepts optional country and sector filters (#225).
9
+ - Regression coverage for empty notification counts (#243).
10
+ - Upgrade development tooling to patched Vitest 4.1.11+; npm audit is clean.
11
+ - Integrate V3/V4 parity and endurance probes and the controlled-disconnection
12
+ live regression from #330, without its stale release/version changes.
13
+ - Record the completed two-hour rotating-connection run and its limitations.
14
+ - Add a protocol contribution guide and correct prerelease installation guidance
15
+ in `llms.txt`.
16
+
17
+ No intended breaking change relative to beta.1. See [migration-v4.md](migration-v4.md)
18
+ for the breaking V3-to-V4 migration and [backlog triage](v4-backlog-triage.md) for
19
+ unresolved private, paid-account and long-duration reports.
20
+
21
+ ## Release checks
22
+
23
+ Run deterministic Node/Bun suites, typecheck, lint, build, packed-consumer smoke,
24
+ dependency audit and live tests. Publish the inspected tarball only after CI
25
+ passes; verify the registry version, dist-tags and a fresh installation afterward.
@@ -0,0 +1,42 @@
1
+ # Screener
2
+
3
+ `getScreener` is available from both the root package and `@mathieuc/tradingview/data`.
4
+ It performs one HTTP scan, without creating WebSocket sessions.
5
+
6
+ ```js
7
+ import { getScreener } from '@mathieuc/tradingview/data';
8
+
9
+ const page = await getScreener({
10
+ market: 'america',
11
+ columns: ['name', 'close', 'volume', 'Stoch.RSI.D'],
12
+ filter: [{ left: 'type', operation: 'equal', right: 'stock' }],
13
+ sort: { sortBy: 'volume', sortOrder: 'desc' },
14
+ range: [0, 20],
15
+ });
16
+ console.log(page.totalCount, page.rows);
17
+ ```
18
+
19
+ Each row has an exchange-qualified `symbol` and a `values` object keyed by the
20
+ requested columns. Values retain their upstream types, including null. Columns
21
+ must be nonempty and unique. Unknown fields and invalid server filters throw
22
+ `TradingViewError` with code `HTTP_ERROR`; they do not silently become empty results.
23
+
24
+ The default market is `global`. Other upstream universes include `america`,
25
+ `crypto` and `forex`. Exact column names, filter operations and available markets
26
+ are controlled by TradingView, not a stable schema owned by this package.
27
+ Use `symbols: ['NASDAQ:AAPL']` to restrict the scan to explicit tickers.
28
+
29
+ `range` is zero-based and end-exclusive, defaulting to `[0, 50]`. Request subsequent
30
+ pages explicitly. Rankings can change between requests; pages are not a transactionally
31
+ consistent snapshot. There is no automatic unbounded pagination, polling or retry.
32
+
33
+ The second argument accepts `credentials`, `fetch`, `headers` and `signal`.
34
+ Account cookies may be supplied but do not grant paid exchange rights. This is
35
+ **not a real-time screener subscription**: delays and entitlements remain upstream.
36
+ Use `watchQuotes` separately when you need quote updates for selected symbols.
37
+
38
+ ## Live evidence
39
+
40
+ On 3 October 2026 an anonymous America scan with stock filters, volume sorting and
41
+ `name`, `close`, `volume`, `Stoch.RSI.D` returned a total count and two typed rows.
42
+ This establishes the request/response contract, not paid real-time availability.
@@ -0,0 +1,146 @@
1
+ # V4 backlog triage — 3 October 2026
2
+
3
+ Baseline: `da67081` / published `4.0.0-beta.1`. Snapshot: **96 open issues and 8 open PRs**.
4
+
5
+ Follow-up: #334 was merged on 3 October 2026. The focused fixes are included in the beta.2 release candidate. Reliability tools from #330 were subsequently ported without its stale version/README changes; the completed two-hour result is recorded in [reliability evidence](v4-reliability.md). Historical rows below describe the initial snapshot, not current PR state.
6
+
7
+ This is an issue-by-issue disposition, not a claim that 96 bugs were reproduced or fixed.
8
+ Evidence comes from issue descriptions, current source/tests and the existing [coverage matrix](v4-coverage.md).
9
+ “Covered by code” is weaker than a targeted regression or live reproduction. “Needs” means keep open.
10
+ No issues/legacy PRs were closed, and no contributor comments were sent by this pass.
11
+
12
+ ## Immediate findings
13
+
14
+ 1. **Authentication gap:** PR #330 is still open. Its `/chart/` default and non-3xx redirect guard are absent from beta.1. This change ports only that focused fix with its regression test, not its old release/version text.
15
+ 2. **Concrete missing feature:** #225 country/sector search filters implemented in this change, with deterministic query coverage and a public live endpoint probe.
16
+ 3. **Do not close private/paid/long-running reports from general smoke results.** In particular #89, #188, #236, #311 and #24 remain unresolved.
17
+ 4. **Discovery priorities:** screener (#53/#85), watchlists/hotlists (#87), then Deep Backtesting (#118/#313, paid-account prerequisite). Alerts and paper trading are separate API families, not chart extensions.
18
+
19
+ ## Issues
20
+
21
+ | Issue | Disposition | Evidence / next action |
22
+ | --- | --- | --- |
23
+ | [#321](https://github.com/Mathieu2301/TradingView-API/issues/321) getUser reports "Too many redirects" for HTTP 200 responses without auth_token | Partial → patched | The beta avoids missing-Location loops, but still starts at the homepage and follows a Location on HTTP 200. Ported the focused fix from PR #330; HTTP regression test passes. Not yet published. |
24
+ | [#319](https://github.com/Mathieu2301/TradingView-API/issues/319) More Control and access to data | Missing | Paper-trading account management and order execution are not exposed by V4. |
25
+ | [#313](https://github.com/Mathieu2301/TradingView-API/issues/313) History Create Session / Request History Data Features help | Missing / gated | No HistorySession or request_history_data implementation. PR #204 is a protocol reference, not V4-compatible code; requires entitled-account live validation. |
26
+ | [#312](https://github.com/Mathieu2301/TradingView-API/issues/312) tradingview wss is updated? | Needs reproduction | Current transport and timeouts are implemented, but the original connection timeout has no host/network trace. Capture exact endpoint, Node version and error on V4. |
27
+ | [#311](https://github.com/Mathieu2301/TradingView-API/issues/311) Session for setMarket not changing CME group | Needs reproduction | session is encoded, but CME regular versus electronic-session semantics need a matching subscribed-account/browser comparison; encoding tests do not prove this. |
28
+ | [#308](https://github.com/Mathieu2301/TradingView-API/issues/308) Remove MR's | Administrative | Request to remove closed PRs is not a library defect. Do not delete contributor history as part of technical triage. |
29
+ | [#303](https://github.com/Mathieu2301/TradingView-API/issues/303) Implement "Use settlement as close" flag for Futures | Missing | No settlement-as-close option in chart resolution. Capture actual protocol key before implementing. |
30
+ | [#296](https://github.com/Mathieu2301/TradingView-API/issues/296) Analyst Forecast | Missing | No analyst-forecast API; technical ratings are not analyst price forecasts. |
31
+ | [#294](https://github.com/Mathieu2301/TradingView-API/issues/294) Can't init client with session and signature | Needs account reproduction | V4 credentials are { session, signature }; focused getUser patch helps page selection, but does not establish the original account entitlement or cookie validity. |
32
+ | [#293](https://github.com/Mathieu2301/TradingView-API/issues/293) Create feature drawing on chart | Missing / clarify | No API to create GUI drawings/Fibonacci objects. getDrawings reads saved data; study graphics are a different capability. |
33
+ | [#292](https://github.com/Mathieu2301/TradingView-API/issues/292) help in retrieving OHLCV data from the project: | Covered | README installation/quick start, docs/data-api.md and examples cover the requested entry point; package consumer smoke passes. |
34
+ | [#283](https://github.com/Mathieu2301/TradingView-API/issues/283) Alarms | Missing | No TradingView alert CRUD or triggered-alert subscription. Local quote/study listeners are not server-side alerts. |
35
+ | [#280](https://github.com/Mathieu2301/TradingView-API/issues/280) Stoch rsi k and D | Needs reproduction | getTechnicalAnalysis exposes summary ratings, not arbitrary scanner columns such as STOCH.RSI.D. Verify study output or design scanner API. |
36
+ | [#278](https://github.com/Mathieu2301/TradingView-API/issues/278) Login error: Please confirm that you are not a robot by clicking the captcha box | Upstream challenge | loginUser explicitly does not handle CAPTCHA/2FA. Document browser session cookies; do not report CAPTCHA as fixed. |
37
+ | [#277](https://github.com/Mathieu2301/TradingView-API/issues/277) load in indicators | Missing | No saved indicator-template/layout-to-studies loader. Reading drawings is not loading chart studies. |
38
+ | [#268](https://github.com/Mathieu2301/TradingView-API/issues/268) Issue with searchIndicator not returning results for some search terms. | Needs reproduction | Community search remains server-driven. Reproduce full-name versus short query with searchIndicators; do not infer exact-name matching from general search tests. |
39
+ | [#265](https://github.com/Mathieu2301/TradingView-API/issues/265) login ERROR in apis | Needs reproduction | CloudFront HTTP 400 is not proof of a parsing bug. Need sanitized request/status and response context on V4. |
40
+ | [#251](https://github.com/Mathieu2301/TradingView-API/issues/251) Table Cell Contents Unavailable | Needs private fixture | Graphics cells parser exists and is unit-tested, but original private-indicator table payload has not been replayed. |
41
+ | [#243](https://github.com/Mathieu2301/TradingView-API/issues/243) GetUser function error on notification count parsing | Covered | parseUserPage uses defensive pageNumber parsing; tests/unit/http.test.ts covers missing notification counts. |
42
+ | [#242](https://github.com/Mathieu2301/TradingView-API/issues/242) Real-time data of the exchange rate between Ethereum and the US dollar | Covered | getQuote/watchQuotes and getCandles expose exchange-qualified crypto pairs; choose the intended ETH/USD venue. See docs/data-api.md. |
43
+ | [#241](https://github.com/Mathieu2301/TradingView-API/issues/241) Support source as an input value type | Partial | Input values and multiple studies exist, but cross-study source dependencies (e.g. st4$4), lifecycle and ordering have no dedicated contract/test. |
44
+ | [#240](https://github.com/Mathieu2301/TradingView-API/issues/240) check study unexpected error | Usage / verify | STD;DEMA is a Pine identifier: use getIndicator, not BuiltInIndicator. Need authenticated DEMA-specific live reproduction before closing. |
45
+ | [#238](https://github.com/Mathieu2301/TradingView-API/issues/238) Getting adjusted price data | Partial | adjustment is available and encoded; split/dividend parity against a specific browser chart is not proven. |
46
+ | [#237](https://github.com/Mathieu2301/TradingView-API/issues/237) Exporting / Receiving Timestamps to/from external application via WebSocket? | Missing | Library sessions do not remote-control an existing browser chart. Replay events are available only for library-owned sessions. |
47
+ | [#236](https://github.com/Mathieu2301/TradingView-API/issues/236) Connection Freezing After 30 Pings with No Error | Needs endurance proof | Heartbeat echo exists. Open PR #330 contains endurance tooling, but a general smoke does not reproduce OANDA:EURUSD HeikinAshi after 30 pings. |
48
+ | [#235](https://github.com/Mathieu2301/TradingView-API/issues/235) TypeScript Implementation | Covered | Native TypeScript sources and emitted declarations; strict consumer checked by scripts/smoke.mjs. |
49
+ | [#232](https://github.com/Mathieu2301/TradingView-API/issues/232) Crypto Cap (e.g. CRYPTOCAP:TOTAL) symbols return "invalid symbol" | Needs reproduction | Issue is specifically CRYPTOCAP Replay, not ordinary candles. Test replay on TOTAL/OTHERS with an entitled account. |
50
+ | [#231](https://github.com/Mathieu2301/TradingView-API/issues/231) Missing data in examples/FromToData.js - provided date and custom date | Partial / server limits | getCandles from/to pagination is implemented; historical intraday availability remains server/account limited. Reproduce original window, not just a recent range. |
51
+ | [#230](https://github.com/Mathieu2301/TradingView-API/issues/230) os.version is not a function / Can't resolve 'os" | Unsupported environment | V4 targets Node/Bun and imports node:os/ws. Browser-extension support is not established by removing the old os.version call. |
52
+ | [#225](https://github.com/Mathieu2301/TradingView-API/issues/225) Add additional filter on search market v3 | Missing → implemented | Added country/sector to searchMarkets, preserving exchange/type/offset. Unit coverage and public endpoint probe; not yet published. |
53
+ | [#224](https://github.com/Mathieu2301/TradingView-API/issues/224) Default setting indicators | Partial | getIndicator provides defaults and PineIndicator.clone preserves a baseline. No reset-to-defaults convenience method; document reload/clone workflow. |
54
+ | [#223](https://github.com/Mathieu2301/TradingView-API/issues/223) Premium account doesn't return 20000 bars for server='prodata' | Needs entitled account | Pagination and credentials exist, but Premium/prodata 20k-bar entitlement is not proven with Basic. |
55
+ | [#222](https://github.com/Mathieu2301/TradingView-API/issues/222) Wrong or expired sessionid/signature - all time | Needs account reproduction | V4 credentials are { session, signature }; focused getUser patch helps page selection, but does not establish the original account entitlement or cookie validity. |
56
+ | [#221](https://github.com/Mathieu2301/TradingView-API/issues/221) "Wrong or expired sessionid/signature" Consistently over and over again, tried fixes. | Needs account reproduction | V4 credentials are { session, signature }; focused getUser patch helps page selection, but does not establish the original account entitlement or cookie validity. |
57
+ | [#220](https://github.com/Mathieu2301/TradingView-API/issues/220) Retrieve chart pattern studies example missing | Needs entitled account | Chart patterns use native study IDs rather than Pine source retrieval. Need paid-pattern capture and example. |
58
+ | [#212](https://github.com/Mathieu2301/TradingView-API/issues/212) Unable to Access Invite Only Indicator: study_not_auth:Script@tv-scripting-507 undefined | Needs private asset | Private listing/auth paths are implemented; specific invite-only access and private study values require an authorized matching script fixture. |
59
+ | [#210](https://github.com/Mathieu2301/TradingView-API/issues/210) New Project: TradingView+NodeRed | Administrative | Collaboration/service proposal, not a reproducible library defect. No unsolicited outreach in this triage. |
60
+ | [#209](https://github.com/Mathieu2301/TradingView-API/issues/209) [FR] Pull a saved indicator template. | Missing | No saved indicator-template/layout-to-studies loader. Reading drawings is not loading chart studies. |
61
+ | [#207](https://github.com/Mathieu2301/TradingView-API/issues/207) Provide a backtest example | Covered | examples/strategy-report.js demonstrates trades and PnL; docs/v4-coverage.md records authenticated live evidence. Not Deep Backtesting. |
62
+ | [#202](https://github.com/Mathieu2301/TradingView-API/issues/202) `TradingView.loginUser` fails : 'Please confirm that you are not a robot by clicking the captcha box.' | Upstream challenge | loginUser explicitly does not handle CAPTCHA/2FA. Document browser session cookies; do not report CAPTCHA as fixed. |
63
+ | [#201](https://github.com/Mathieu2301/TradingView-API/issues/201) Private indicators | Needs private asset | Private listing/auth paths are implemented; specific invite-only access and private study values require an authorized matching script fixture. |
64
+ | [#199](https://github.com/Mathieu2301/TradingView-API/issues/199) Manage pine scripts | Missing | Pine permissions/listing are not script source create/update/delete APIs. |
65
+ | [#193](https://github.com/Mathieu2301/TradingView-API/issues/193) TypeError: str.replace is not a function - Handling Buffer Input in parseWSPacket | Covered by code | src/client/transport.ts converts Buffer, Buffer[] and ArrayBuffer to text before framing. Historical caller-specific environment not reproduced. |
66
+ | [#192](https://github.com/Mathieu2301/TradingView-API/issues/192) 15 minutes delay for MOEX market | Upstream entitlement / missing | Exchange real-time rights and server delays must be checked with that venue/account. General stock screener API is not implemented. |
67
+ | [#191](https://github.com/Mathieu2301/TradingView-API/issues/191) How to install? | Covered | README installation/quick start, docs/data-api.md and examples cover the requested entry point; package consumer smoke passes. |
68
+ | [#188](https://github.com/Mathieu2301/TradingView-API/issues/188) Pine 'referencing length of a series' error after about 12 hours | Needs long-run reproduction | 12-hour Pine max_bars_back failure is not a normal indicator input. Need script and long-running capture; short endurance runs cannot resolve it. |
69
+ | [#184](https://github.com/Mathieu2301/TradingView-API/issues/184) Proxy support | Partial | Custom WebSocket transport and HTTP fetch hooks permit adapters, but no documented/tested unified proxy configuration. PR #208 cannot be merged unchanged. |
70
+ | [#182](https://github.com/Mathieu2301/TradingView-API/issues/182) Can't load indicator - (Study error: Study not allowed in this connection) | Upstream auth requirement | Authenticated Pine path is live-tested; anonymous study refusal is not eliminated. Recheck original script with credentials. |
71
+ | [#179](https://github.com/Mathieu2301/TradingView-API/issues/179) "Calculation timed out" error and account bans | Upstream limits | Server study/session/calculation limits are not removed by V4. Bound concurrency, release sessions and reproduce account-specific thresholds; no bulk retry flood. |
72
+ | [#174](https://github.com/Mathieu2301/TradingView-API/issues/174) How to use Supertrend? | Partial documentation | Indicator values/events and Pine discovery are documented. Supertrend transition semantics and plot selection deserve a focused example. |
73
+ | [#173](https://github.com/Mathieu2301/TradingView-API/issues/173) Max Sessions Rate Reached Error | Upstream limits | Server study/session/calculation limits are not removed by V4. Bound concurrency, release sessions and reproduce account-specific thresholds; no bulk retry flood. |
74
+ | [#172](https://github.com/Mathieu2301/TradingView-API/issues/172) Invite Only Indicators | Needs private asset | Private listing/auth paths are implemented; specific invite-only access and private study values require an authorized matching script fixture. |
75
+ | [#170](https://github.com/Mathieu2301/TradingView-API/issues/170) Can I generate alerts based on my PineScript Startegy? | Partial / missing | Study/strategy data can drive application callbacks; TradingView webhook-alert management is absent. |
76
+ | [#168](https://github.com/Mathieu2301/TradingView-API/issues/168) ECONN RESET | Needs reproduction | ECONNRESET is surfaced by transport; no transparent reconnect/resubscribe guarantee. Need original network trace. |
77
+ | [#167](https://github.com/Mathieu2301/TradingView-API/issues/167) Retrieve a picture of the custom chart. | Missing | No renderer/screenshot endpoint for library-owned chart sessions. |
78
+ | [#160](https://github.com/Mathieu2301/TradingView-API/issues/160) I need access to 1s timeframe of ETH/USDT (bianance) | Upstream entitlement | 1S accepted as a timeframe; seconds_not_entitled requires account rights, not a syntax fix. Ten-day history not proven. |
79
+ | [#159](https://github.com/Mathieu2301/TradingView-API/issues/159) new | Administrative | Collaboration/service proposal, not a reproducible library defect. No unsolicited outreach in this triage. |
80
+ | [#157](https://github.com/Mathieu2301/TradingView-API/issues/157) Replay mode works only on 1D or larger timeframes | Needs timeframe proof | Daily Replay verified in beta.1; that does not establish intraday Replay on the reporter’s plan/window. |
81
+ | [#153](https://github.com/Mathieu2301/TradingView-API/issues/153) why i cant get my private indicators? | Needs private asset | Private listing/auth paths are implemented; specific invite-only access and private study values require an authorized matching script fixture. |
82
+ | [#147](https://github.com/Mathieu2301/TradingView-API/issues/147) How to get an year worth of data? | Partial / server limits | getCandles from/to pagination is implemented; historical intraday availability remains server/account limited. Reproduce original window, not just a recent range. |
83
+ | [#145](https://github.com/Mathieu2301/TradingView-API/issues/145) can't backtest using specific from to date even while using my tradingview premium session | Missing / clarify | Chart candle date filtering is not a strategy calculation-date window. Deep Backtesting remains separate and unimplemented. |
84
+ | [#144](https://github.com/Mathieu2301/TradingView-API/issues/144) What does `rtc` field stand for on quotes? | Needs field documentation | Raw quote fields are passed through; verify rtc semantics with session-specific captures before promising extended-hours behavior. |
85
+ | [#138](https://github.com/Mathieu2301/TradingView-API/issues/138) Chart indicator study periods getting out of sync/corrupting themselves over time? | Needs long-run reproduction | Study-value merging exists; repainting versus index drift requires original script plus incremental/reloaded comparisons. |
86
+ | [#136](https://github.com/Mathieu2301/TradingView-API/issues/136) Alerts management | Missing | No TradingView alert CRUD or triggered-alert subscription. Local quote/study listeners are not server-side alerts. |
87
+ | [#135](https://github.com/Mathieu2301/TradingView-API/issues/135) Not sure how to install, index.js also missing | Covered | README installation/quick start, docs/data-api.md and examples cover the requested entry point; package consumer smoke passes. |
88
+ | [#134](https://github.com/Mathieu2301/TradingView-API/issues/134) Future data | Needs reproduction | Futures symbols supported generically, but original venue/contract and permission details are missing. Do not infer ES/CL success from crypto. |
89
+ | [#133](https://github.com/Mathieu2301/TradingView-API/issues/133) No ask and bid after subscribing for quotes | Upstream data / verify | Bid/ask fields may be requested, but upstream availability for TSE:2801 is not guaranteed. Capture quote payload and update mode. |
90
+ | [#132](https://github.com/Mathieu2301/TradingView-API/issues/132) Replaying old time with both "replay" and "to" set seems to repeat same time | Needs targeted regression | Replay and to each exist; their combination is not proven by separate tests. Reproduce repeated-candle scenario. |
91
+ | [#128](https://github.com/Mathieu2301/TradingView-API/issues/128) How would I get the values from a indicator ? | Partial documentation | Indicator values/events and Pine discovery are documented. Supertrend transition semantics and plot selection deserve a focused example. |
92
+ | [#125](https://github.com/Mathieu2301/TradingView-API/issues/125) Technicals are being handled differently | Usage / partial | Native volume-profile IDs use BuiltInIndicator, not getIndicator/Pine facade. Fixed profile is live-tested; session-profile variant needs its own proof. |
93
+ | [#124](https://github.com/Mathieu2301/TradingView-API/issues/124) How do I reconnect to client after my internet reconnects? | Missing | Client is terminal after close. Recreate client and subscriptions; automatic reconnect/backoff/resubscribe is not implemented. |
94
+ | [#120](https://github.com/Mathieu2301/TradingView-API/issues/120) Bug function searchMarket | Covered | searchMarkets splits EXCHANGE:SYMBOL and uses v3 endpoint; tests/unit/http.test.ts asserts exchange and query encoding. |
95
+ | [#119](https://github.com/Mathieu2301/TradingView-API/issues/119) ENOTFOUND event not being handled | Covered by code | wsTransport registers socket error handler; client emits typed errors. Add native DNS-failure regression before treating every network failure as resolved. |
96
+ | [#118](https://github.com/Mathieu2301/TradingView-API/issues/118) Deep Backtesting | Missing / gated | No HistorySession or request_history_data implementation. PR #204 is a protocol reference, not V4-compatible code; requires entitled-account live validation. |
97
+ | [#117](https://github.com/Mathieu2301/TradingView-API/issues/117) How to use TradingView-API? | Covered / plan limits | README, low-level docs and Replay example provide setup. Intraday availability still requires separate account/timeframe verification. |
98
+ | [#115](https://github.com/Mathieu2301/TradingView-API/issues/115) how to use FromToData.js? | Partial / server limits | getCandles from/to pagination is implemented; historical intraday availability remains server/account limited. Reproduce original window, not just a recent range. |
99
+ | [#112](https://github.com/Mathieu2301/TradingView-API/issues/112) Get 1min candle data exposed as API | Partial | Minute OHLCV retrieval exists; OI availability, external-feed import and GUI rendering are separate unsupported requirements. |
100
+ | [#111](https://github.com/Mathieu2301/TradingView-API/issues/111) Tradingview login error | Covered documentation | README/authentication docs explain credentials and login limitations; do not reuse a username/password as a session cookie. |
101
+ | [#110](https://github.com/Mathieu2301/TradingView-API/issues/110) How can i use Fibonacci Retracement | Missing / clarify | No API to create GUI drawings/Fibonacci objects. getDrawings reads saved data; study graphics are a different capability. |
102
+ | [#108](https://github.com/Mathieu2301/TradingView-API/issues/108) Error on example CustomTimeframe | Upstream entitlement | 1S accepted as a timeframe; seconds_not_entitled requires account rights, not a syntax fix. Ten-day history not proven. |
103
+ | [#105](https://github.com/Mathieu2301/TradingView-API/issues/105) How to run this app | Covered | README installation/quick start, docs/data-api.md and examples cover the requested entry point; package consumer smoke passes. |
104
+ | [#101](https://github.com/Mathieu2301/TradingView-API/issues/101) FakeReplay always returning the same day | Needs targeted regression | Negative-count history is live-tested generally; exact repeated-day/gap cases and exchange holidays still need reproduction. |
105
+ | [#89](https://github.com/Mathieu2301/TradingView-API/issues/89) No "strategyReport.trades" data for private strategy backtest | Needs private asset | Public and compressed reports are proven; missing trades for the specific private strategy is not yet reproduced. |
106
+ | [#88](https://github.com/Mathieu2301/TradingView-API/issues/88) Data point is missing in FakeReplayMode example output | Needs targeted regression | Negative-count history is live-tested generally; exact repeated-day/gap cases and exchange holidays still need reproduction. |
107
+ | [#87](https://github.com/Mathieu2301/TradingView-API/issues/87) Feature : get watchlists | Missing | No watchlist or hotlist API; useful next discovery target alongside screener. |
108
+ | [#85](https://github.com/Mathieu2301/TradingView-API/issues/85) Question : Can you enable stock screener real-time ? | Upstream entitlement / missing | Exchange real-time rights and server delays must be checked with that venue/account. General stock screener API is not implemented. |
109
+ | [#84](https://github.com/Mathieu2301/TradingView-API/issues/84) Alerts feature | Missing | No TradingView alert CRUD or triggered-alert subscription. Local quote/study listeners are not server-side alerts. |
110
+ | [#83](https://github.com/Mathieu2301/TradingView-API/issues/83) how to get update data of strategy.entry trigger signal. | Partial | Strategy reports and study updates exist; no dedicated exactly-once strategy.entry signal stream. Application must distinguish intrabar updates. |
111
+ | [#80](https://github.com/Mathieu2301/TradingView-API/issues/80) [V3] Same output multiple times | Needs reproduction | Repeated update events may be intrabar updates or study lifecycle effects. No evidence yet of a V4 fix for this exact script. |
112
+ | [#79](https://github.com/Mathieu2301/TradingView-API/issues/79) Where can I find the chart_id for getDrawings? | Partial documentation | getDrawings supports chartId/layout inputs, but extracting the correct internal chart ID needs a saved-layout example and private validation. |
113
+ | [#73](https://github.com/Mathieu2301/TradingView-API/issues/73) Strategy Optimization Steps | Partial | Inputs and reports exist; no bounded optimization runner, date-window Deep Backtest or throttle-aware multithreading API. |
114
+ | [#66](https://github.com/Mathieu2301/TradingView-API/issues/66) Maximum number of studies per chart has been reached | Upstream limits | Server study/session/calculation limits are not removed by V4. Bound concurrency, release sessions and reproduce account-specific thresholds; no bulk retry flood. |
115
+ | [#53](https://github.com/Mathieu2301/TradingView-API/issues/53) Stock Screener API | Missing | No general stock screener API; getTechnicalAnalysis is only a fixed-column ratings request. |
116
+ | [#51](https://github.com/Mathieu2301/TradingView-API/issues/51) Adding some sort of documentation | Covered | README installation/quick start, docs/data-api.md and examples cover the requested entry point; package consumer smoke passes. |
117
+ | [#30](https://github.com/Mathieu2301/TradingView-API/issues/30) Can I Hire You To Set This Up For Me? | Administrative | Collaboration/service proposal, not a reproducible library defect. No unsolicited outreach in this triage. |
118
+ | [#24](https://github.com/Mathieu2301/TradingView-API/issues/24) Renko chart's indicator value does not match GUI-based TradingView's, given same configurations | Needs parity reproduction | Renko chart type is live-tested, but this exact multi-timeframe study/GUI value mismatch is not. Need matched bars, inputs and account. |
119
+
120
+ ## Open pull requests
121
+
122
+ | PR | Verified disposition | Next action |
123
+ | --- | --- | --- |
124
+ | [#330](https://github.com/Mathieu2301/TradingView-API/pull/330) | **Not merged.** Auth fix, parity/endurance scripts and recovery live test remain useful. Version/release prose is stale. | Focused auth port included here. Retain/rebase remaining reliability work; recover saved endurance results before claiming completion. |
125
+ | [#322](https://github.com/Mathieu2301/TradingView-API/pull/322) | Legacy V3 authentication patch; not directly applicable to TS V4. | Its chart-page/status semantics are carried through #330 into this port. Decide V3 backport separately while latest is 3.5.2. |
126
+ | [#320](https://github.com/Mathieu2301/TradingView-API/pull/320) | V3 this-binding patch. V4 HTTP functions are standalone, not receiver-based. | Superseded for V4; possible V3 maintenance value. |
127
+ | [#318](https://github.com/Mathieu2301/TradingView-API/pull/318) | Binding fix is superseded, but dependency upgrade is **not** automatically superseded: The baseline still uses Vitest 3. | Audit confirmed GHSA-82fw-gwwq-j7x9 in Vitest/mocker. Updated to patched Vitest 4.1.11+ in this change; not the older vulnerable 4.1.9 from the PR. |
128
+ | [#289](https://github.com/Mathieu2301/TradingView-API/pull/289) | General chart event registration exists via Emitter.on/onAny and event tests. | Superseded for V4; no need to port V3 callback storage. |
129
+ | [#219](https://github.com/Mathieu2301/TradingView-API/pull/219) | Native TS build emits declarations and package smoke compiles a strict consumer. | Superseded for V4; avoid stale generated V3 declarations. |
130
+ | [#208](https://github.com/Mathieu2301/TradingView-API/pull/208) | Axios/ws proxy patch targets removed V3 architecture. V4 offers transport/fetch injection, not a turnkey proxy. | Preserve intent; implement/test an adapter recipe across both HTTP and WS before resolving #184. |
131
+ | [#204](https://github.com/Mathieu2301/TradingView-API/pull/204) | Distinct history-data/HistorySession protocol absent in V4. Author’s historical Premium run is not current verification. | Port only after current capture/entitlement proof; share report decoding and add failure/cleanup tests. |
132
+
133
+ ## Verification for this change
134
+
135
+ - `npm run check`: typecheck, lint, 118 deterministic tests, build, Node/Bun packed-package smoke and strict TypeScript consumer.
136
+ - `npm run test:bun`: independent Bun unit run.
137
+ - Country/sector live probe is anonymous; filter forwarding is deterministic-tested. Search results do not constitute a full sector-classification audit.
138
+ - Dependency audit: baseline had two moderate entries for the same Vitest/mocker advisory; patched development dependency in this change.
139
+ - No new authenticated, private-script, Premium or long-duration claims are made.
140
+ - No npm publication or promotion of the `latest` tag is part of this change.
141
+
142
+ ## Screener follow-up
143
+
144
+ Beta.3 adds `getScreener` for #53 and scanner fields relevant to #280. See
145
+ [screener documentation](screener.md). #85 real-time exchange entitlement is not
146
+ resolved by a successful HTTP scan. Watchlists and paid/private cases remain open.
@@ -1,17 +1,19 @@
1
1
  # v4 coverage matrix
2
2
 
3
- [Migration guide](migration-v4.md) · [Data API](data-api.md) · [Low-level API](low-level-api.md)
3
+ [Migration guide](migration-v4.md) · [Data API](data-api.md) · [Low-level API](low-level-api.md) · [Reliability evidence](v4-reliability.md) · [Protocol contribution guide](protocol-contributing.md)
4
4
 
5
5
  This matrix lists every capability of v3 (`main.js`, `src/`, examples, tests) and of the `agent.ts` preview, with its v4 replacement and the evidence that it works.
6
6
 
7
7
  **Evidence columns**
8
8
 
9
- - **Unit**: deterministic test in `tests/unit/` (`npm test` with Vitest on Node, `npm run test:bun` with Bun's runner; 115 tests, both green). Websocket tests use a scripted fake server (`tests/helpers/fake-server.ts`) or packets captured from TradingView (`tests/fixtures/live-session.json`); HTTP tests use a mocked `fetch`.
9
+ - **Unit**: deterministic test in `tests/unit/` (`npm test` with Vitest on Node, `npm run test:bun` with Bun's runner; 118 tests, both green). Websocket tests use a scripted fake server (`tests/helpers/fake-server.ts`) or packets captured from TradingView (`tests/fixtures/live-session.json`); HTTP tests use a mocked `fetch`.
10
10
  - **Live**: result of `npm run test:live` (`tests/live/`) and examples against TradingView on **2 October 2026**: 16 anonymous tests locally and 21 tests (including five authenticated) in the [manual GitHub Actions run](https://github.com/Mathieu2301/TradingView-API/actions/runs/37075296707):
11
11
  - ✅ verified live anonymously;
12
12
  - 🔒 path or variant not exercised live (often requires a specific account asset); deterministic tests only;
13
13
  - ➖ not applicable (no network involved).
14
14
 
15
+ Beta.2 follow-up on **3 October 2026**: all 22 current live tests passed locally with the existing account, including the additional controlled-disconnection/replacement-client test. The historical run above remains evidence for the original 21-test suite.
16
+
15
17
  Test names are abbreviated as `file › test`.
16
18
 
17
19
  ## Package and tooling
@@ -0,0 +1,36 @@
1
+ # V4 reliability evidence
2
+
3
+ This page tracks reproducible release checks beyond the [capability matrix](v4-coverage.md). It is evidence for a beta, not a claim that every TradingView account feature works.
4
+
5
+ ## V3/V4 candle parity
6
+
7
+ On 2 October 2026, the published `@mathieuc/tradingview@3.5.2` and V4 `main` (`95b6d0f`) loaded the same `BINANCE:BTCEUR` market. For each of `D` and `60`, the probe compared 19 closed candles out of 20 requested. All 38 matched on timestamp and OHLC. Volumes matched after applying V3's two-decimal rounding; V4 intentionally preserves the server precision. The still-open candle was excluded because it can change between sequential requests.
8
+
9
+ A repeat against the beta.2 candidate on 3 October 2026 again compared all 38 closed candles with zero mismatches.
10
+
11
+ Repeat without adding V3 to V4's dependencies:
12
+
13
+ ```sh
14
+ npm ci
15
+ npm install --prefix /tmp/tradingview-v3-baseline --no-save --no-package-lock @mathieuc/tradingview@3.5.2
16
+ TV_V3_ENTRY=/tmp/tradingview-v3-baseline/node_modules/@mathieuc/tradingview/main.js npm run probe:parity
17
+ ```
18
+
19
+ `probe:parity` exits nonzero on a mismatched closed candle. It needs live network access and is not part of deterministic CI.
20
+
21
+ ## Live connection lifecycle
22
+
23
+ `tests/live/recovery.test.ts` starts candle and quote watchers on one client, closes the connection while both are active, verifies both stop and report `DISCONNECTED`, then fetches candles with a new client. This is a controlled socket close, not proof of recovery from every network failure. The library does not reconnect a closed `TradingViewClient` automatically; consumers create a new client.
24
+
25
+ `npm run probe:endurance -- --minutes=120 --cycle-seconds=600` streams one-minute BTCUSDT candles and quotes for two hours, rotates the connection every ten minutes, and emits JSON lines with startup counts, updates, heartbeats and errors. It exits nonzero on a startup failure, an early watcher close or missing data. It never reads or logs account credentials. A one-minute smoke run on 2 October 2026 completed three cycles with 16 candle updates, 18 quote updates, five heartbeats and zero errors. The completed two-hour run on 3 October 2026 recorded 12 successful cycles, 1,721 candle updates, 1,765 quote updates and 719 heartbeats, with zero failures/errors and no interruption. Connections rotated every ten minutes: this is not a two-hour unbroken-socket test and does not close #236 or the 12-hour Pine report #188. The saved JSONL summary was recovered before recording these counts. The probe also accepts `--symbol`, `--timeframe` and `--chart-type` for issue-specific checks. For example, issue #236 can be investigated with `--symbol=OANDA:EURUSD --chart-type=HeikinAshi`, though a closed forex market cannot prove that quote updates remain live.
26
+
27
+ ## Account redirect regression
28
+
29
+ V4 now starts the account lookup at `/chart/` and follows `Location` only on HTTP 3xx responses. A deterministic test covers HTTP 200 with a misleading `Location` header. This ports the relevant guard from legacy PR #322; it does not claim to solve CAPTCHA/WAF challenges. The authenticated manual CI run passed all 22 live tests after this change. The beta.2 candidate also passed all 22 current live tests locally on 3 October 2026, including the recovered lifecycle regression.
30
+
31
+ ## Remaining beta limitations
32
+
33
+ - Live checks exercise a small set of symbols, scripts and account rights, not every capability.
34
+ - Basic daily Replay and strategy reports are documented in [v4-coverage.md](v4-coverage.md); this is not proof of Deep Backtesting or universal intraday entitlement.
35
+ - Private/invite-only script cases, subscribed futures parity, owned layouts and long-running Pine failures need matching assets and targeted reproductions. See [backlog triage](v4-backlog-triage.md).
36
+ - Live CI is non-blocking. Review its actual test results, not just the overall workflow conclusion, before release.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mathieuc/tradingview",
3
- "version": "4.0.0-beta.1",
3
+ "version": "4.0.0-beta.3",
4
4
  "description": "TradingView market data for JavaScript and TypeScript: candles, quotes, indicators and strategies, with a simple data API and full low-level access.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -34,7 +34,9 @@
34
34
  "test:live": "vitest run --config vitest.live.config.ts",
35
35
  "smoke": "node scripts/smoke.mjs",
36
36
  "check": "npm run typecheck && npm run lint && npm test && npm run build && npm run smoke",
37
- "prepack": "npm run build"
37
+ "prepack": "npm run build",
38
+ "probe:endurance": "npm run build && node scripts/endurance.mjs",
39
+ "probe:parity": "npm run build && node scripts/parity.mjs"
38
40
  },
39
41
  "repository": {
40
42
  "type": "git",
@@ -68,7 +70,7 @@
68
70
  "eslint": "^9.39.0",
69
71
  "typescript": "~5.9.3",
70
72
  "typescript-eslint": "^8.46.0",
71
- "vitest": "^3.2.4"
73
+ "vitest": "^4.1.11"
72
74
  },
73
75
  "homepage": "https://github.com/Mathieu2301/TradingView-API#readme",
74
76
  "bugs": {