# Foresight > Foresight runs TradingView Pine Script (v5/v6) strategies and indicators compiled, on your own computer, as a web app in the browser (nothing to install) or as a Windows desktop app: fast enough to drag an input and watch the backtest re-run immediately. It is a companion to TradingView, not a replacement: develop, inspect and stress-test locally, then carry your code and settings back to TradingView. Free during the public beta. Status: public beta. Web app: current Chrome, Edge, Firefox or Safari (iPhone/iPad need iOS 17.2 or later); free account with a confirmed email. Desktop app: build 1.1.15, Windows 10/11 x86_64. Free while in beta; pricing after the beta has not been announced. Desktop beta builds expire after 30 days so testers stay on current fixes. Not affiliated with TradingView. ## Web app and desktop app - Web app: the engine compiled to WebAssembly, run inside the browser tab on the user's machine. Script editor with diagnostics and completions, drag-to-re-run inputs, debugger and replay, repaint detection, optimizer, walk-forward, PBO, stricter broker models, your own CSV data and crypto history fetched from exchanges. An AI client can drive it through foresight.trading (a newer connection than the desktop's, with fewer tools). - Windows desktop app only, for now: multi-instrument runs, the full statistics panel (the web app shows net, win rate, profit factor, drawdown and average trade), the built-in data manager with more data providers, the local MCP server and the Python client. ## What it does - Compiles Pine Script v5/v6 (native code on desktop, WebAssembly in the browser) and runs backtests on your machine; no backtest queue. - Interactive optimization: drag inputs and the strategy re-runs immediately; built-in optimizer. - Walk-forward validation (in-sample / out-of-sample, rolling), probability of backtest overfitting (PBO) and parameter-robustness analysis. - Repaint detection: runs a strategy as written and again seeing only data that existed at the time, and flags differences (e.g. lookahead in request.security). - Execution models: TradingView (the fills its Strategy Tester assumes), Realistic (spread floors, conservative fills) and Pessimistic (adverse slippage). In the AI tools and the current Windows build these are named tv, strict and adversarial. - Multi-instrument runs: one strategy over a basket (combined equity, per-instrument spread), scaling to S&P-500-sized universes. - Statistics: CAGR, Sharpe, Sortino, Calmar, Ulcer index, profit factor, expectancy with t-stat and 95% CI, commission drag, buy-and-hold alpha, monthly returns heatmap. - A Pine debugger: step through a finished run bar by bar, inspect any variable on any bar, retroactive breakpoints; values the engine did not record are shown as unrecorded, never invented. - Replay: re-runs a script as of each historical bar. - MCP (Model Context Protocol) server so AI agents such as Claude can run backtests, sweep parameters, run the optimizer and walk-forward, read equity curves and trades, and edit scripts. Built into the desktop app from 1.1.9 (no Python needed): the installer or "? > Connect an AI Agent" registers it with Claude Desktop, Claude Code, Cursor, VS Code and Windsurf; any other MCP client launches "Foresight.exe --mcp". A matching Python client exists (source-only, not on PyPI yet). ## Accuracy and compatibility (published, dated evidence) - Compile audit (2026-10-07): 29,459 community-published Pine scripts run on one build; 28,050 compile and run. 1,326 are set aside (970 need data Foresight does not have, 266 import an unavailable library version, 90 are rejected or stopped by TradingView itself). Of the 28,133 valid scripts for which data is available, 99.7% compile and run; 83 do not yet. Missing data was simulated for the audit: this measures running, not matching TradingView. - Curated regression corpus: 6,098 of 6,213 strategies and indicators passing (98.1%) as of 2026-09-18. - Trading-fidelity suite vs TradingView (baseline 2026-10-06): 2,478 scripts (2,822 backtests) 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. 42% of the 4,886 backtests attempted are excluded from scoring for declared reasons (missing golden exports, paid data entitlements). This does not promise identical trades or results for every script. - Unsupported constructs produce structured diagnostics (NOT_SUPPORTED, APPROXIMATE, LIMITED) rather than silent differences. ## Common questions - Can I backtest a TradingView Pine Script strategy in the browser, without installing anything? Yes: sign up, confirm the email, open https://foresight.trading/app/, add a CSV or fetch crypto history from an exchange, paste the script and press Run. The script is compiled and run in the browser tab on the user's own machine; scripts and data are not uploaded. - Does it cost anything? It is free during the public beta. Pricing after the beta has not been announced. - Does it replace TradingView? No. It is a companion: a place to develop, debug and stress-test a script, then take it back to TradingView. - How do I know whether a strategy repaints? Foresight runs it as written and again seeing only the data that existed on each bar, and reports any difference; Replay shows it bar by bar. - How do I check a strategy is not overfitted? Walk-forward testing (optimize in-sample, test out-of-sample, roll forward), probability of backtest overfitting (PBO), parameter-robustness analysis, and stricter execution models. - Can an AI assistant use it? Yes. In the web app, an AI client connects as a remote MCP server through foresight.trading and works in a Foresight tab the user has open. The Windows app has a local MCP server (Foresight.exe --mcp). - What does not work? Scripts that need fundamental or economic data (request.financial and similar) are refused with a diagnostic naming the feature. Windows is the only desktop platform; on other systems use the web app. ## Who it is for Systematic traders who write or use Pine Script strategies on TradingView and want faster iteration, local debugging, and more rigorous testing (out-of-sample, overfitting and repainting checks, stricter fills) before trusting a backtest. A backtest is not a prediction. ## Links - [Home](https://foresight.trading/): overview, videos, evidence - [Documentation](https://foresight.trading/docs/) - [Get beta access / sign up](https://foresight.trading/accounts/signup/): free account, confirm email, then open the web app or download the Windows installer - [Web app](https://foresight.trading/app/): requires a signed-in account - [Downloads](https://foresight.trading/downloads/) - [Discussion boards](https://foresight.trading/boards/)