§ methodology · engine

Does the engine compute what TradingView computes?

Every number on wavealgo comes out of one open-source Pine engine, resin. A backtest is only worth reading if the engine places the same trades TradingView would. This page is the record of what it has been checked against, as of 2026-11-12 (engine commit 547c68a), including the rows that are not full and the rules nobody has settled yet.

§ 01

Against TradingView's own output

The strongest evidence: a script is run on TradingView, its trade list, plotted values or logs are exported, and the engine has to reproduce them on the same bars. A trade matches when its entry and exit bar, price, size and profit all match.

What is comparedMatched
Strategy trades, against TradingView trade lists14,867 of 14,867 tradesall
Strategy statistics per bar, against TradingView exports1,120 of 1,120 barsall
Indicator values per bar, against TradingView exports46,350 of 46,350 barsall
Logged values, against TradingView logs132 of 132 log linesall
Head-to-head cases (values, logs and trades of 97 scripts)333,936 of 333,936 recordsall

The exports were collected by the PyneCore project for its own test suite; the harness replays them. Two trades of one export are left out of the count because that export predates a change TradingView made to its rolling sum (dispute D13 below).

§ 02

Against a reference engine

TradingView exports cannot cover every combination of orders, so the harness also generates scenarios at random and compares the engine with PyneCore, an independent implementation that tests itself against TradingView exports. Two engines written separately agreeing on a random scenario is weaker evidence than an export, and is listed separately for that reason.

What is comparedMatched
Generated strategy scenarios, trade for trade against the reference engine3,600 of 3,600 scenariosall
Generated indicator scenarios, bar for bar against the reference engine789 of 800 scenarios11 differ
Generated language scenarios against the reference engine600 of 600 scenariosall
Hand-written probes of single rules118 of 118 probesall

§ 03

On scripts people actually wrote

Valid Pine v5 and v6 scripts collected from public repositories. This row says the engine accepts and runs them; it does not say their values are right, because nobody has TradingView’s output for them. A script the engine cannot convert is refused with a reason, never run approximately.

What is countedResult
Public scripts that compile (valid Pine v5/v6 from public repositories)2,965 of 2,974 scripts9 differ
Public scripts that also run to the last bar2,959 of 2,974 scripts15 differ

§ 04

Where it falls short

3 of the 11 rows above are not full. There are also 3 rules where the available sources disagree and no TradingView measurement has settled them yet. Until one does, the engine follows the written Pine reference, and the affected cases stay counted as differences.

Open questionRule
D2strategy() defaults under v6
D8hlcc4: (high + low + close + close)/4 or (high + low + 2 * close)/4
D13a TradingView export recorded before TradingView changed its rolling sum

10 earlier disagreements were settled, each by a TradingView export or by the reference manual. What none of this covers: broker-specific fills, live data feeds, and anything a script does that TradingView itself does not document. A matching backtest is a statement about arithmetic, not about future returns.

§ 05

Check it yourself

The engine and the harness are public. The harness prints this scoreboard from a clean checkout, and its ledger refuses a change that lowers any row.

RepositoryWhat it is
github.com/nullarch/resinThe engine: Pine Script to JavaScript, and the runtime
github.com/nullarch/resin-harnessThe scenarios, the exports, the scoreboard and the open disputes

How a strategy is then graded is a separate question: the scoring methodology.