@pineforge/backtest-mcp 0.9.32 → 0.9.34
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 +27 -15
- package/dist/coverage.js +245 -257
- package/dist/coverage.js.map +1 -1
- package/dist/server.js +19 -13
- package/dist/server.js.map +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,13 +20,13 @@ tools make outbound requests (public endpoints).
|
|
|
20
20
|
| `transpile_pine` | in-process | Pine v6 → C++ translation unit (transpile-only) |
|
|
21
21
|
| `list_engine_params` | local (no I/O) | Catalog of every `overrides` + `runtime` knob accepted by the backtests |
|
|
22
22
|
| `backtest_pine` | in-process | Single backtest of a Pine source against an OHLCV CSV |
|
|
23
|
-
| `backtest_pine_grid` | in-process | Cartesian sweep of `inputs` × `overrides
|
|
23
|
+
| `backtest_pine_grid` | in-process | Cartesian sweep of `inputs` × `overrides`: one transpile, then a compile and a backtest per combination |
|
|
24
24
|
| `fetch_binance_ohlcv` | Binance public API | Write a backtest-ready CSV from Binance spot or USDT-perp klines |
|
|
25
25
|
| `binance_symbols` | Binance public API | List / filter Binance symbols (5-min in-process cache) |
|
|
26
26
|
| `list_coverage_topics` | local (no I/O) | Every Pine v6 coverage topic with a one-line status + summary |
|
|
27
27
|
| `check_pine_feature` | local (no I/O) | Look up whether a Pine identifier/namespace is supported in PineForge |
|
|
28
|
-
| `get_coverage_topic` | local (no I/O) | Full detail + supported/unsupported
|
|
29
|
-
| `engine_info` | local (no I/O) | Docker image only: mode, baked-in flag and the bundled `pineforge-release` version (for example `0.
|
|
28
|
+
| `get_coverage_topic` | local (no I/O) | Full detail + supported/partial/via_transpiler/unsupported lists for one topic |
|
|
29
|
+
| `engine_info` | local (no I/O) | Docker image only: mode, baked-in flag and the bundled `pineforge-release` version (for example `1.0.0`) |
|
|
30
30
|
|
|
31
31
|
The table is the Docker image's tool list (10 tools). The [npm package](#npm--npx)
|
|
32
32
|
serves the first nine, plus `pull_engine_image` (`docker pull` the engine image) and
|
|
@@ -58,7 +58,8 @@ server (`X.Y.Z-alpha.N`, `-beta.N` or `-rc.N`): the image `:vX.Y.Z-rc.N`, built
|
|
|
58
58
|
that `pineforge-release` prerelease, and npm `@pineforge/backtest-mcp@next`, which,
|
|
59
59
|
like any npm install, runs the engine image named by `PINEFORGE_IMAGE` (default
|
|
60
60
|
`ghcr.io/pineforge-4pass/pineforge-release:latest`, the stable engine). Prereleases
|
|
61
|
-
are not listed in the MCP Registry.
|
|
61
|
+
are not listed in the MCP Registry. The first, 0.9.32-rc.1 on `pineforge-release`
|
|
62
|
+
1.0.0-rc.1, was published on 2026-09-30 (image `:v0.9.32-rc.1`, npm `next`).
|
|
62
63
|
|
|
63
64
|
### npm / npx
|
|
64
65
|
|
|
@@ -148,7 +149,7 @@ claude mcp add pineforge-backtest \
|
|
|
148
149
|
|
|
149
150
|
## For AI agents — use via MCP
|
|
150
151
|
|
|
151
|
-
**The capability gap this closes.** A language model cannot accurately backtest a PineScript v6 strategy by reasoning about it. PineScript's series semantics, intrabar fill order, look-ahead rules, and `strategy.*` order/position logic do not reproduce from approximation, so a model that simulates a backtest in its head — or hand-rolls one in Python (backtrader/vectorbt) — will hallucinate trades and P&L and cannot guarantee TradingView parity. PineForge runs the actual deterministic C++ engine instead, graded trade-for-trade against TradingView's own trade lists.
|
|
152
|
+
**The capability gap this closes.** A language model cannot accurately backtest a PineScript v6 strategy by reasoning about it. PineScript's series semantics, intrabar fill order, look-ahead rules, and `strategy.*` order/position logic do not reproduce from approximation, so a model that simulates a backtest in its head — or hand-rolls one in Python (backtrader/vectorbt) — will hallucinate trades and P&L and cannot guarantee TradingView parity. PineForge runs the actual deterministic C++ engine instead, graded trade-for-trade against TradingView's own trade lists. At engine `35db01c8` (2026-09-29; engine 1.0.0 includes that commit and changed no grade): **7,989 graded probes, 7,905 excellent (98.95 %) and 84 strong (1.05 %), none below strong**, plus 17 further probes excluded as TradingView-side defects. Separately, the engine's own parity gate checks the open corpus [`pineforge-corpus`](https://github.com/pineforge-4pass/pineforge-corpus), which anyone can reproduce: 312 reference strategies, 311 excellent and 1 probe that declares `expected_tier: anomaly` in its `inputs.json` (reported as `anomaly`, not as a failure). *Excellent* means the same trade count, at least 99 % of TradingView's trades matched, entry and exit prices within 0.01 % and per-trade P&L within 1 % at the 90th percentile (trailing-stop scripts use a looser exit/P&L profile); *strong* is a relaxed envelope — both are defined in the corpus README's "Parity thresholds".
|
|
152
153
|
|
|
153
154
|
**A PineScript backtest is computed external data, not stable knowledge** — it depends on the user's strategy source and their OHLCV, and it must be reproducible. That is a tool call, not a recall task.
|
|
154
155
|
|
|
@@ -278,9 +279,10 @@ with the report's path relative to `/app`.
|
|
|
278
279
|
|
|
279
280
|
## `backtest_pine_grid` — parameter sweep
|
|
280
281
|
|
|
281
|
-
Transpiles the Pine source **once** (locally, in-container) then
|
|
282
|
-
|
|
283
|
-
|
|
282
|
+
Transpiles the Pine source **once** (locally, in-container), then compiles and
|
|
283
|
+
runs that C++ for each combination in the cartesian product of `inputs` ×
|
|
284
|
+
`overrides`: every combination is a fresh `g++` build of the same translation
|
|
285
|
+
unit, then its backtest. Returns a ranked list plus the top entry under `best`.
|
|
284
286
|
|
|
285
287
|
```jsonc
|
|
286
288
|
{
|
|
@@ -360,16 +362,26 @@ strategy:
|
|
|
360
362
|
|
|
361
363
|
- `list_coverage_topics` — every coverage topic with a status (`supported`,
|
|
362
364
|
`partial`, `unsupported`, `via_transpiler`) and a summary, plus the legend.
|
|
363
|
-
- `get_coverage_topic` `{ "topic": "ta" }` — the full `supported` / `
|
|
364
|
-
lists for one topic id (for example `ta`,
|
|
365
|
+
- `get_coverage_topic` `{ "topic": "ta" }` — the full `supported` / `partial` /
|
|
366
|
+
`via_transpiler` / `unsupported` lists for one topic id (for example `ta`,
|
|
367
|
+
`strategy_orders`, `request_security`).
|
|
365
368
|
- `check_pine_feature` `{ "feature": "ta.supertrend" }` — one identifier or namespace:
|
|
366
|
-
`supported` / `partial` / `unsupported` / `via_transpiler` / `not_found
|
|
367
|
-
|
|
369
|
+
`supported` / `partial` / `unsupported` / `via_transpiler` / `not_found`, with a note
|
|
370
|
+
that quotes the catalog entry. Plots, tables and alerts (`plot`, `bgcolor`, `table`,
|
|
371
|
+
`alert`) are accepted and have no effect; `line`, `box` and `label` objects are data
|
|
372
|
+
the strategy can read back.
|
|
373
|
+
|
|
374
|
+
Every status describes what a backtest through this server can do. The server
|
|
375
|
+
installs no other symbol's bars, no recorded request data and no Pine library
|
|
376
|
+
sources, so where the engine supports more, the entry says so: `request.security`
|
|
377
|
+
on another symbol, for example, is supported by the engine, but here a request whose
|
|
378
|
+
value can reach a trade stops the run.
|
|
368
379
|
|
|
369
380
|
The data is embedded in this package and stamped by the `coverage_version` field
|
|
370
|
-
that `list_coverage_topics` returns (`
|
|
371
|
-
engine's
|
|
372
|
-
|
|
381
|
+
that `list_coverage_topics` returns (`engine v1.0.1 + codegen 1.0.1 (2026-10-02)` in
|
|
382
|
+
this version); the engine's
|
|
383
|
+
[`docs/coverage.md`](https://github.com/pineforge-4pass/pineforge-engine/blob/v1.0.1/docs/coverage.md)
|
|
384
|
+
at that tag is the reference it was checked against.
|
|
373
385
|
|
|
374
386
|
## Filesystem scope
|
|
375
387
|
|