Explore Foresight
AccuracySpeedRealism CompatibilityWeb & desktopDocsBoards

Your Pine scripts.
A clearer view.

Test your TradingView .pine strategies in your browser — nothing to install. Your script is compiled and run on your own machine, fast enough to drag a parameter and watch the results update. Develop, inspect and test, then carry your code and settings back to TradingView.

Get beta access Watch the 56-second tour
● In your browser · nothing to install ○ Backtests run on your machine ○ Windows desktop app too
What has been measured
99.7%
Of 28,133 valid published scripts for which data is available, 99.7% compile and run.
29,459 community Pine scripts audited · data a script asks for and the audit lacks was simulated · running is not the same as matching TradingView
96.2%
Of 2,478 scripts tested against TradingView's own trade lists, all match its trade count to within 10%, and 96.2% also match on entry timing and direction.
2,822 scored backtests of 4,886 attempted · the rest could not be scored (data or reference trades unavailable)
Compile audit 2026-10-07 · TradingView comparison 2026-10-06 How this is measured
▸ The 100-second tour · recorded in the desktop app · with music

Run a Pine strategy locally · drag an input and watch the whole backtest re-run · see mistakes as you type · read every variable on any bar · replay history · tune it and see the out-of-sample result beside the in-sample one · walk-forward test it · catch a script that repaints · or let an AI agent drive it. In this example the tuned strategy looks good on the data it was tuned on and still loses on data it never saw — Foresight shows both. Served from this site: no third-party video service, and nothing downloads until you press play. Also on YouTube. Strategy shown: Vital Wave 20-50 © Especulador96 (OldWave96), unmodified, under the Mozilla Public License 2.0. Not affiliated with or endorsed by its author or TradingView. Music: “Background Music” by Sub_Clair (Pixabay). A backtest is not a prediction.

Foresight in Replay: a Pine strategy and a regression-channel indicator on a Bitcoin chart, with its volume profile, the equity curve, the Pine source, the debugger's watch list and the trade list
Foresight for Windows · strategy, chart, parameters and results in one workspace. The web app has the same engine, arranged as Develop, Debug and Research.
▸ Replay, in depth · 54 seconds · no sound

A Pine indicator replayed through history — the script is re-run as of each bar, seeing only the data it had then — and re-run live as its inputs are dragged. Indicator shown: Volume Regression Channel © BOSWaves, unmodified, under the Mozilla Public License 2.0. Not affiliated with or endorsed by BOSWaves or TradingView.

▸ Does it repaint? · 51 seconds · no sound

A strategy that backtests at an 83% win rate — because one line reads a higher-timeframe close before that bar has finished. Foresight runs every strategy twice, once as written and once seeing only data that existed at the time, and flags the difference; in Replay you can watch the line move to a price the candles only reach hours later. The repainting example was written for this video; the clean example is Vital Wave 20-50 © Especulador96 (OldWave96), unmodified, MPL 2.0. A clean verdict means no repainting was found on this data — it is not a judgement of the strategy.

◆ 02 / 08▸ MEASURED PARITY◇ AUDITED CORPUS◇ BLIND TEST◆ HONEST BOUNDARIES

Measured accuracy.
Visible limits.

Compare results with evidence, not a blanket promise. The suite below scores Foresight's trades against trade lists exported from TradingView: trade count for every scored backtest, entry timing and direction where they can be compared. It does not establish identical trades or results for every script. Baseline: 2026-10-06.

FIDELITY SUITE
4,886
backtests compared with TradingView
SCORED BACKTESTS MATCHING
100.0%
trade count within 10% of TradingView · 2,822 backtests
BLIND TEST
27/29
new scripts, chosen before any were scored, matched on the first run
COMPILE AUDIT
99.7%
of 28,133 valid scripts with data available compile and run
Measured, not promised
The 2026-10-06 baseline compares 4,886 backtests with trade lists exported from TradingView. 42% are left out of scoring for declared reasons (no reference trades, paid data). All 2,822 that are scored match on trade count; 28 of them match less closely on entry timing, and 70 have no computable timing comparison.
Honest boundaries, loudly drawn
When a construct isn't supported, you get a structured diagnostic naming it — NOT_SUPPORTED, APPROXIMATE, LIMITED — as inline squiggles and a Problems tab. These diagnostics make known limitations visible; they do not guarantee that every discrepancy is detected. The debugger inherits the rule: a value the engine didn't record is shown as unrecorded, never invented.
One compiler path
No per-script special cases, no "supported shapes" allowlist. Every Pine construct lowers through one canonical path — which is why a fix for one script is a fix for every script, and why the audit corpus keeps converging instead of whack-a-moling.
◆ 03 / 08▸ NATIVE COMPILATION◇ RUNS LOCALLY◇ OFFLINE◆ INTERACTIVE

Your .pine script is compiled, not interpreted.

Foresight doesn't walk your script line by line. It compiles your strategy — to WebAssembly in the browser, to native machine code in the desktop app — and runs it on your own CPU, which is where the instant, drag-to-tune re-runs come from. Speed isn't a luxury feature: when a full backtest costs milliseconds, you can afford to leave the rigorous stuff — walk-forward, robustness checks, honest fills — switched on.

01
PASTE
Pine v5 / v6, straight from TradingView
02
COMPILE
compiled on your machine — WebAssembly in the browser, native code on desktop
03
RUN
runs on your own CPU; no backtest queue
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
Measured against TradingView
Parity isn't a goal we chase — it's a suite we run: every one of the 2,822 scored backtests in our fidelity suite matches TradingView's trade count within tolerance. If your script gives different numbers, that's a bug we want to hear about and fix.
▸ 03
No cloud round-trip
Backtests execute locally using your loaded data. Optional data providers and external AI agents have their own connections and data handling; only connect services you intend to use.
▸ 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. Desktop app.
▸ 05
Honest-execution models
Re-run any backtest under TradingView, Realistic or Pessimistic fills — spread floors, adverse slippage, next-bar exits. Compare how sensitive a result is to execution assumptions. Surviving a stricter model does not establish a live trading edge.
▸ 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. Desktop app; the web app shows net, win rate, profit factor, drawdown and average trade.
▸ 07
A real debugger for Pine
Step through your strategy bar by bar — after it ran. Hover any variable to see its value on any bar, set retroactive breakpoints, and inspect the series history. And it never guesses: a value the engine didn't record shows as exactly that, never a plausible fabrication.
▸ 08
Repaint detection
The classic Pine trap: a strategy that looks brilliant on historical bars and falls apart live. Foresight checks for observed repainting behaviour, surfaces the affected bars and reports what it can establish.
◆ 04 / 08▸ BROKER MODELS◇ WALK-FORWARD◇ PBO◆ REPAINT DETECTION

A backtester that tries to talk you out of bad edges.

Most backtesters are built to flatter you — optimistic fills, one lucky chart, a number that goes up. Foresight is built the other way: its job is to kill fragile edges before your money does. Everything below exists to answer one question: would this survive contact with a real broker?

▸ BROKER MODELS
TradingView · Realistic · Pessimistic
Re-run any backtest under three execution models: TradingView (the fills its Strategy Tester assumes), Realistic (spread floors, conservative fills), and Pessimistic (adverse slippage, worst-reasonable-case). An edge that only exists under optimistic fills isn't an edge — it's a rounding error with a story.
▸ OUT-OF-SAMPLE
Walk-forward validation
Optimize in-sample, test out-of-sample, roll the window forward — the discipline that separates a tuned curve from a tradable system. Built in, one click, fast enough to run on every candidate instead of just the finalist.
▸ OVERFITTING
PBO & robustness analysis
Probability-of-backtest-overfitting scoring, parameter-neighborhood robustness (does the edge survive nudging every input?), and minimum-trades guards — the quant-desk checks that tell you whether your optimizer found a signal or memorized the noise.
▸ REPAINTING
Repaint detection
Strategies that peek — lookahead requests, recalculating signals — look phenomenal historically and evaporate live. Foresight flags repainting behaviour ambiently, before the market invoices you for the lesson.
▸ BREADTH
Multi-instrument truth
One chart can be luck. Run the same strategy across a whole basket — combined equity, per-instrument spread — and optimize for the edge that holds across symbols. Scales to S&P-500-sized universes. Desktop app.
▸ COSTS
The unglamorous stuff
Commission drag, expectancy with a t-stat and 95% confidence interval, buy-&-hold alpha, Ulcer index. The numbers that tell you whether the strategy beats doing nothing — after costs, with statistical honesty about how sure you should be.
◆ 05 / 08▸ MCP CONTROL SURFACE◇ AGENT-READY◇ PYTHON / CLAUDE◆ LOCAL

Drive it with an agent — or from Python.

The desktop app 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? The source-only Python client drives the same engine — OHLCV and result series move as numpy arrays, against the live GUI or fully headless. It is not bundled with the installer or published on PyPI yet. The web app can be driven by an AI client too: the client connects through foresight.trading and works in a Foresight tab you have open. That connection is newer than the desktop server, and some tools are desktop-only.

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 — TradingView / Realistic / Pessimistic (tv, strict, adversarial).
from foresight import ClientSame engine, same verbs — driven from Python.
Illustrative agent workflownot a recorded result
USER
Sweep the fast MA from 5 to 30 on this strategy and find the best Sharpe.
→ Configure the input bounds, then run the optimizer.
Review the selected inputs, scoring period and execution assumptions.
CLAUDE
Compare the candidate out of sample and under stricter execution assumptions before interpreting the result.
~/strategies/ma_cross.pinemcp · foresight
◆ 06 / 08▸ PINE v5 / v6◇ BROAD COVERAGE◇ TRACKED◆ IMPROVING

Audited against 29,459 real published Pine scripts.

The compile audit ran all 29,459 community-published Pine scripts on one build (2026-10-07). 28,050 compile and run. 1,326 are set aside: 970 need data Foresight does not have, 266 import a library version that is no longer available, and 90 are rejected or stopped by TradingView itself. Of the 28,133 that remain, 99.7% compile and run; 83 do not yet. Where a script asks for data the audit lacks, the data was simulated: this shows the script runs, not that its values match TradingView. Our curated regression corpus (6,213 strategies & indicators, incl. LuxAlgo) records 98.1% passing as of 2026-09-18. Trade accuracy is measured separately: 2,478 scripts (2,822 backtests) are scored against TradingView's own trade lists. Every one matches its trade count within tolerance, and 96.2% also match on entry timing and direction (baseline 2026-10-06). 42% of the 4,886 backtests attempted are excluded from scoring for declared reasons (missing golden exports, paid data entitlements) — we publish that rather than bury it. 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-TIMEFRAME5
OHLCV built-ins and standard OHLCV CSV files● SUPPORTED
Higher-timeframe request.security — incl. ta.* & computed expressions● SUPPORTED
Cross-symbol request.security (other tickers, e.g. VIX) — needs that symbol's data loaded● SUPPORTED
Lower-timeframe / intrabar (request.security_lower_tf) — minute floor; matching finer data must be loaded, or fetchable (in the web app, from crypto exchanges only)● SUPPORTED
Library imports (import Author/Lib/N) — vendored or local libraries● SUPPORTED
NOT YET SUPPORTED1
request.financial / economic data○ NOT YET
See the full feature list in the docs →
◆ 07 / 08▸ BETA◇ FREE FOR NOW◇ WINDOWS◆ DOWNLOAD

Free while we're in beta.

Foresight is free to use during the public beta — the web app and the Windows desktop app, on one account. Pricing after the beta has not been announced. Desktop beta builds expire after 30 days so testers move onto current fixes and compatibility updates; the web app is always the current version.

BETA
Freewhile in beta
  • › The web app and the Windows desktop app
  • › Backtesting, debugger, optimizer, walk-forward
  • › Local MCP server for agent workflows (desktop)
  • › A direct line to shape what gets built
Get beta access

PRICING AT LAUNCH — TO BE ANNOUNCED

Bring your own strategy.

One free beta account opens both. Start in the browser — there is nothing to install — and add the Windows app when you want the parts the browser doesn't have yet.

▸ WEB APP · START HERE
In your browser
Paste a script, drop in a CSV or fetch crypto history from an exchange, and run. The engine is downloaded once and runs inside the browser tab, on your CPU. Current Chrome, Edge, Firefox or Safari; best on a desktop or laptop screen. iPhone and iPad need iOS 17.2 or later. Create account & open
▸ DESKTOP APP
Windows · x86_64
Windows 10 / 11 installer. Adds multi-instrument runs, the full statistics panel, the built-in data manager with more data providers, and a local MCP server and Python client. Beta builds refresh regularly. Download for Windows
WHAT'S WHEREWEB · DESKTOP
Editor with diagnostics and completions (one-click fixes on the web)● WEB● DESKTOP
Drag an input, the strategy re-runs● WEB● DESKTOP
Debugger — values on any bar, breakpoints, replay● WEB● DESKTOP
Optimizer, walk-forward, PBO, stricter broker models● WEB● DESKTOP
Your own CSV data; crypto history from exchanges● WEB● DESKTOP
Repaint detection● WEB● DESKTOP
Drive it from an AI client (MCP) — newer on the web, with fewer tools● WEB● DESKTOP
Full statistics panel and monthly-returns heatmap○ NOT YET● DESKTOP
Built-in data manager with more data providers○ NOT YET● DESKTOP
One strategy across many instruments○ NOT YET● DESKTOP
Python client○ NOT YET● DESKTOP
Already have an account? Sign in.