Run Native Backtests
Test Pine strategies against loaded OHLCV bars and inspect metrics, trades, equity curve, and drawdown behavior.
The Algo Lab is the browser-based Pine Script research workspace that brings the whole loop together: AI-assisted Pine editing, a built-in Pine v6 engine for native backtests, manual parameter sweeps, the autonomous Algo Agent, and an evidence ledger of Case Studies — so every variant and trial stays in one investigation.
Location: Dashboard > Algo Lab
Run Native Backtests
Test Pine strategies against loaded OHLCV bars and inspect metrics, trades, equity curve, and drawdown behavior.
Optimize Iterations
Run local Manual Sweep tests, compare Agent candidates, and keep results grouped by symbol, timeframe, and date range.
Use Case Studies
Keep a research scope together: file-bound variants, trials, evidence, promoted candidates, and linked reports.
Ask the Algo Agent
Use the AI rail to review code, propose changes, compare timeframes, and reason about evidence before promoting a variant.
The chart stays above the workspace. The lower workspace has five tabs:
| Tab | Use it for |
|---|---|
| Editor | Edit the active Pine strategy, ask for AI-assisted changes, add webhook payloads, add versions to a Case Study, and run the chart scope. |
| Backtesting Report | Inspect the latest run: metrics, trades, warnings, equity behavior, and selected iteration details. |
| Case Study | Keep the research ledger: hypothesis, linked Pine file, versions, trials, evidence, reports, and promoted candidates. |
| Params Optimization | Run manual parameter sweeps and compare candidate rows before applying parameter values back to the editor. |
| Configuration | Adjust run inputs and strategy properties that materially change backtest results. |
The Open Algo Agent button opens a separate drawer, not another tab. Use it when you want the agent to review the current Lab state, propose structural changes, compare timeframes, or run evidence-gated research against the active Case Study.
A case study is bound to one Pine strategy tab. Keeping that relationship explicit prevents agent-generated variants from fragmenting into unrelated files.
The lab needs historical bars before it can run a backtest. There are two supported paths:
The lab accepts the TradingView-style timeframe set used by the Agent tools: 1, 2, 3, 5, 10, 13, 15, 30, and 45 minutes; 1, 2, 3, and 4 hours; 1 day; 1 week; 1 month; and 3 months.
Open or create a strategy tab — Start with existing Pine code or paste a new strategy.
Choose the scope — Set symbol, timeframe, and date range.
Load market data — Use platform-served IEX bars when enabled, or your connected Alpaca account.
Run the backtest — Review performance metrics, trades, equity curve, and runtime warnings.
Create or select a case study — Bind the investigation to the current Pine tab and hypothesis.
Iterate or optimize — Run manual tests, Manual Sweep, or ask the Algo Agent to propose candidates and compare timeframes.