π Get real-time stocks from TradingView
TypeScript backtestingbacktesting-trading-strategiesbitcoinchartscryptocryptocurrencyethereumrealtime-stocksstocksstocks-apistocks-pricestradingtradingviewtradingview-apitradingview-indicatortradingview-replaytradingview-scraper
4.1.0-beta.2
Release channel: npm dist-tag beta. latest stays on 4.0.1. Freezes the report format of the backtest API for pages and charts.
Backtest API
- The report holds identifiers and numbers only. Warnings are now codes with their numbers (
short_history,no_signals,few_trades,baseline_unmatched,causality_disabled,data_gaps), turned into English byformatWarning. Rows no longer carryexitLabel.settings.signalis{ id, params, label }and each exit insettings.exitsis{ id, kind, params, label }; thelabelfields are English descriptions forformatReportonly. - New fields:
createdAt,library({ name, version }),snapshot.fetchedAt,buyHoldper segment (same fee and slippage),refBars(bar indices ofrefs) on signals and trades. chartData(report, snapshot, signal): candles, indicator series (rsi,emaforrsiDivergence, or a customsignal.indicators), warm-up and split times, signals and trades grouped by exit.backtestMany({ markets, exits, signal }): the same signal on several markets, with exits per market if needed; trades carryseries, andtradesToCsvthen adds aseriescolumn.rsiDivergencegetsid,params,indicatorsand thetrendFilteroption (false to count raw divergences).
Breaking for 4.1.0-beta.1 users: report.warnings (strings β objects), settings.signal (string β object), rows[].exitLabel removed. Results are unchanged: same rows and trades as beta.1 on the same snapshot.
Validation
- Same rows and 63 trades as the #351 engine on the BINANCE:BTCUSDT 4H snapshot.
- 33 backtest tests (207 in total under Node, 206 under Bun); the 10 deliberate mutations still each fail a test.
npm run checkincluding the packed-package smoke under Node and Bun.