Check TradingView parity
check_tradingview_parityMeasure how closely PineForge reproduces TradingView backtests by grading Pine v6 trades against a Strategy Tester export. Returns parity tier, matched counts, and mismatches.
Instructions
Check how closely PineForge reproduces a TradingView backtest, trade by trade. Give the Pine v6 script and TradingView's own Strategy Tester export: the "List of trades" CSV, or the XLSX report as base64. PineForge runs the script on the same market and window and grades the two trade lists with the grader behind its published parity figures (pineforge-engine v1.2.0 scripts/verify_corpus.py, the same file in v1.3.0). Returns the tier (excellent, strong, moderate, weak, minimal), each check with its value and thresholds, matched and unmatched trade counts, the first mismatches side by side with hints, and a timezone check. Bars: pass ohlcv_csv or ohlcv_csv_path for any market; without them, BINANCE: (spot) and BINANCE:.P (USDT-M perpetual) bars are fetched from Binance's public API (at most 100,000 bars); any other symbol needs your bars. No quota and no history window beyond that. Scripts declaring use_bar_magnifier=true also fetch 1-minute bars through the last chart bar's close, counted in that limit, on charts the harness magnifies (coarser than 1 minute, at most 1 day) unless runtime.bar_magnifier is false. With your own bars, optionally pass magnifier_ohlcv_csv or magnifier_ohlcv_csv_path; a script that declares the magnifier but runs without one gets a warning that fills inside bars may differ from TradingView's. Settings the XLSX Properties sheet states are used; an explicit input that disagrees with one is an error. The run applies the instrument's lot size and tick size as backtest_pine does, for BINANCE: and BINANCE:.P. The lot size is TradingView's own reading for the symbol, from a measured table shipped with this server (Binance's LOT_SIZE.stepSize only for a symbol TradingView does not list; TradingView's usual 0.001 for a listing newer than the table); the tick size and currencies come from Binance's public exchangeInfo (or from the sidecar next to a CSV fetched by fetch_binance_ohlcv). syminfo gives your own values and goes over all of it. The result's applied_instrument shows what was applied, and warnings says when no lot size could be found or its lot size is not a TradingView reading. The run and the grading use the pineforge-release Docker image (no network inside the container).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pine | Yes | The Pine v6 strategy source TradingView ran (at most 262,144 bytes of UTF-8). | |
| inputs | No | Pine input overrides (TradingView's Inputs tab), as in backtest_pine. | |
| symbol | No | TradingView ticker the backtest ran on, e.g. 'BINANCE:ETHUSDT.P'. Required unless the XLSX states it or you pass bars. | |
| runtime | No | Engine runtime args of list_engine_params (input_tf, script_tf, bar_magnifier, magnifier_samples, magnifier_dist). | |
| syminfo | No | The instrument's own values (qty_step, mintick, pointvalue, ...), as in backtest_pine: they win over what the symbol resolves, and are the whole instrument for a market other than Binance. Without a lot size the run floors nothing and the result warns. | |
| ohlcv_csv | No | Your bars as CSV text: header timestamp,open,high,low,close,volume (epoch ms), or TradingView's chart export time,open,high,low,close,Volume (epoch seconds or ISO 8601). At most 67,108,864 characters; use ohlcv_csv_path for more. | |
| range_end | No | ISO 8601 end of TradingView's range. Default: the export's last row (the result says so). | |
| timeframe | No | TradingView resolution of the chart: '1', '5', '15', '60', '240', '1D', '1W', ... Required unless the XLSX states it. | |
| range_start | No | ISO 8601 date or datetime of the first bar TradingView computed (UTC unless it has an offset). Required unless the XLSX states it. | |
| chart_timezone | No | IANA timezone TradingView printed the trade times in (its chart timezone), e.g. 'Asia/Taipei', 'UTC', 'America/New_York'. Required unless the export states it. | |
| max_mismatches | No | How many mismatching trades to list (default 10, at most 50); the counts are always complete. | |
| ohlcv_csv_path | No | Path to your bars CSV (same formats as ohlcv_csv, no size limit; same path rules as backtest_pine's ohlcv_csv_path, checked after resolving '..' and symlinks). | |
| strategy_overrides | No | TradingView's Properties tab: the 9 strategy() knobs of list_engine_params. | |
| tradingview_trades | Yes | TradingView's Strategy Tester export: the "List of trades" CSV text, or the XLSX report file base64-encoded (it starts with UEsDB). The CSV needs the columns Trade number, Type, Date and time and a Price column, as TradingView exports them. Limits: 33,554,432 characters as passed; the trade list graded at most 32 MiB of UTF-8 and 400,000 rows; XLSX parts at most 64 MiB each and 128 MiB together decompressed, sheets at most 400,000 rows and 256 columns, the sheets read at most 8,000,000 cells together, at most 2,000,000 shared strings. | |
| magnifier_ohlcv_csv | No | Optional 1-minute bars for a declared bar magnifier, in the same formats as ohlcv_csv and with the same 67,108,864-character limit. Cover the first chart bar's open through the last chart bar's close. | |
| magnifier_ohlcv_csv_path | No | Path to optional 1-minute magnifier bars (same formats and path rules as ohlcv_csv_path, no size limit). Pass this or magnifier_ohlcv_csv, not both. |