Skip to content
Algo Trade Analytics Docs

Algo Lab

Basic or Professional

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:

TabUse it for
EditorEdit the active Pine strategy, ask for AI-assisted changes, add webhook payloads, add versions to a Case Study, and run the chart scope.
Backtesting ReportInspect the latest run: metrics, trades, warnings, equity behavior, and selected iteration details.
Case StudyKeep the research ledger: hypothesis, linked Pine file, versions, trials, evidence, reports, and promoted candidates.
Params OptimizationRun manual parameter sweeps and compare candidate rows before applying parameter values back to the editor.
ConfigurationAdjust 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.

  • Create or select a case study before serious optimization so manual runs, local sweeps, and Agent trials can be tracked.
  • Use Add to Case Study to store the current editor code as a named version in the active study.
  • Use Load into tab name to replace the study’s related Pine tab with a stored variant when you want to test it in the same file context.
  • Use Load into editor when an older study is not linked to an open tab and you intentionally need a new editor tab.
  • Link Backtest vs Alerts or Alerts vs Fills reports when fill-review evidence matters for the promoted candidate.

The lab needs historical bars before it can run a backtest. There are two supported paths:

  • Platform-served market data: If enabled by the platform team, the lab can load IEX stock bars without a personal Alpaca connection.
  • Your Alpaca account: If platform data is disabled, or if you need your own feed entitlement, connect Alpaca in Account Integrations.

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.

  1. Open or create a strategy tab — Start with existing Pine code or paste a new strategy.

  2. Choose the scope — Set symbol, timeframe, and date range.

  3. Load market data — Use platform-served IEX bars when enabled, or your connected Alpaca account.

  4. Run the backtest — Review performance metrics, trades, equity curve, and runtime warnings.

  5. Create or select a case study — Bind the investigation to the current Pine tab and hypothesis.

  6. Iterate or optimize — Run manual tests, Manual Sweep, or ask the Algo Agent to propose candidates and compare timeframes.