Backtest Pine Script at native speed.
Locally. Interactively.

Foresight runs your TradingView .pine strategies as native code on your own machine — fast enough to drag a parameter and watch the results update. No browser, no subscription, no uploading your strategies to the cloud.

Get beta access Watch the walkthrough
Windows · x86_64 Your data never leaves your machine
RE-RUN
~3 ms
8,000-bar backtest
OPTIMIZER
4,000+/sec
24-core parallel
COLD START
<250 ms
compile + first run
MEMORY
<100 MB
per backtest (engine)
MEASURED · 24-CORE DESKTOP · EURUSD 1H · 8,082 BARS 2026.05.23
▸ Walkthrough
◆ 02 / 05▸ NATIVE COMPILATION◇ RUNS LOCALLY◇ OFFLINE◆ INTERACTIVE
02 · UNDER THE HOOD

Your .pine script becomes native code.

Foresight isn't a browser interpreter. It compiles your strategy to native machine code and runs it on your CPU — which is where the instant, drag-to-tune re-runs come from.

01
PASTE
Pine v5 / v6, straight from TradingView
02
COMPILE
transpiled and built to native machine code
03
RUN
executes locally, on your machine, offline
04
TUNE
drag a slider — it re-runs immediately
▸ 01
Interactive optimization
Drag inputs and the strategy re-runs immediately — and a built-in optimizer can search the parameter space for you. Tune by feel, not submit-and-wait.
▸ 02
Built to match TradingView
We chase parity with Pine's semantics — lookahead, na-propagation, series indexing. If your script gives different numbers than TradingView, that's a bug we want to hear about and fix.
▸ 03
No cloud round-trip
Everything runs on your machine. Load any OHLCV CSV. Your data — and the edges in your strategies — never leave it.
▸ 04
Across many instruments
Run one strategy over a whole basket at once — combined equity plus per-instrument spread — and optimize for an edge that holds across symbols, not one cherry-picked chart. Scales to S&P-500-sized scans.
▸ 05
Honest-execution models
Re-run any backtest under TV, Strict or Adversarial fills — spread floors, adverse slippage, next-bar exits. If the edge survives Strict it's probably real; if it only works on optimistic fills, you'll see that too.
▸ 06
Prosumer-quant stats
CAGR, Sharpe, Sortino, Calmar, Ulcer, profit factor, expectancy with a t-stat and 95% CI, commission drag, buy-&-hold alpha — plus a monthly-returns heatmap.
◆ 03 / 05▸ MCP CONTROL SURFACE◇ AGENT-READY◇ PYTHON / CLAUDE◆ LOCAL

Drive it with an agent — or from Python.

Foresight exposes its engine over MCP (Model Context Protocol) and a matching Python client — one shared command core. Point Claude (or any MCP client) at it and the agent can run backtests, sweep parameters, run the optimizer, read equity curves and trades, and edit your script directly. Prefer code? pip install foresight and drive the same engine from Python — OHLCV and result series move as numpy arrays, against the live GUI or fully headless.

run / run_rangeCompile & run a strategy over a symbol / range.
start_optRun the optimizer over the active parameters.
run_walk_forwardIn-sample / out-of-sample rolling validation.
get_equity_curve / get_tradesPull results back as data.
modify_script / set_paramPatch the script or inputs and re-run in place.
set_broker_modelSwitch execution realism — TV / Strict / Adversarial.
pip install foresightSame engine, same verbs — driven from Python.
claude · mcp:foresight● connected
USER
Sweep the fast MA from 5 to 30 on this strategy and find the best Sharpe.
start_opt({ param: "fast_ma", min: 5, max: 30 })
⤷ optimizer ran · best fast_ma = 14 · Sharpe 1.82
CLAUDE
Best Sharpe is at fast_ma = 14 (1.82). Want me to run a walk-forward on it to check the edge holds out-of-sample?
~/strategies/ma_cross.pinemcp · foresight
◆ 04 / 05▸ PINE v5 / v6◇ BROAD COVERAGE◇ TRACKED◆ IMPROVING

Runs 89% of 4,200+ real-world Pine scripts.

We run a corpus of 4,200+ community-published Pine scripts on every build — 89% run out of the box (97% of those that only use features we support), and the rest fail with a clear compile error. On the strategies we have TradingView golden exports for, trade counts match TradingView on ~94% of ~950 tested cases, with ~90% matching entry, exit and direction trade-by-trade. Hit a script that doesn't work? Send it — fixing those is the whole game.

SUPPORTED PARTIAL NOT YET
CORE LANGUAGE6
Variables, operators, expressions● SUPPORTED
Conditionals & loops (for / while / for-in)● SUPPORTED
User-defined functions & methods● SUPPORTED
User-defined types, enums, switch● SUPPORTED
var / varip persistence, series history []● SUPPORTED
Collections — arrays, matrices, maps● SUPPORTED
INDICATORS & STRATEGY4
Strategy framework — entries, exits, sizing● SUPPORTED
Standard indicators (ta.*)● SUPPORTED
Plots, hline, fill● SUPPORTED
Tables, boxes, labels, lines● SUPPORTED
DATA & MULTI-TIMEFRAME2
OHLCV built-ins, any CSV (forex / stocks / crypto / futures)● SUPPORTED
Higher-timeframe request.security, same symbol — incl. ta.* & computed expressions● SUPPORTED
NOT YET SUPPORTED4
Cross-symbol request.security (other tickers, e.g. VIX)○ NOT YET
Lower-timeframe / intrabar (request.security_lower_tf)○ NOT YET
Library imports (import Author/Lib/N)○ NOT YET
request.financial / economic data○ NOT YET
See the full feature list in the docs →
◆ 05 / 05▸ BETA◇ FREE FOR NOW◇ WINDOWS◆ DOWNLOAD
05 · PRICING

Free while we're in beta.

Foresight is free to use during the public beta — everything unlocked. Paid plans are coming at launch (we're still finalizing them), and beta testers will get founding-member pricing.

BETA
Freewhile in beta
Get beta access

PRICING AT LAUNCH — TO BE ANNOUNCED

06 · DOWNLOAD

Install in under a minute.

Create a free beta account, confirm your email, and download the Windows installer. Beta builds refresh regularly — you'll always grab the latest.

Windows · x86_64
Windows 10 / 11 · installer
Create account & download
Already have an account? Sign in.