Work in the Algo Lab editor
Open Algo Lab → Editor to edit the active Pine strategy in the same workspace used for configuration, backtests, optimization, results, and Case Studies. The Algo Agent opens in a separate drawer and uses the active Lab context.
Strategy tabs
Section titled “Strategy tabs”- Select a tab to make it the active strategy.
- Select + to create a tab named New Strategy. Duplicate names receive a numeric suffix.
- Double-click a tab name to rename it. With the name focused, Enter or F2 starts renaming; Enter saves and Escape cancels.
- The dot on a tab means its current code is not saved to the server.
- Select the close icon to archive a tab. The confirmation includes unsaved code in the archived version.
- Use Manage Archive to search, restore, or permanently delete archived strategies.
Workspace actions
Section titled “Workspace actions”| Action | Current behavior |
|---|---|
| Save | Persists the active strategy; disabled when there are no unsaved changes. |
| Copy | Copies the complete active strategy to the clipboard. |
| Webhook | Starts a guided change for TradingView webhook output. |
| Add to Case Study | Records the current script version as a Case Study variant. |
| Manage Archive | Opens archived strategies for restore or permanent deletion. |
| Settings | Opens the Lab run settings. |
| Run / Re-run | Runs the active strategy with the current Lab scope and settings. |
The tab dot and enabled Save button are the visible unsaved-state indicators. If a save does not clear them, keep the page open, use Copy for a backup, and retry before navigating away.
Editor options
Section titled “Editor options”The three-dot Editor options menu contains:
- Auto Save — saves changed code after edits settle;
- AI Autocomplete — enables or disables inline AI completions;
- Validation — enables or pauses automatic validation;
- Internal engine or TradingView API — chooses the validation provider;
- rename and archive actions for the current script; and
- archive management.
The tab toolbar also provides Undo and Redo. Their availability belongs to the active tab’s current editor history; restoring or opening another tab is not an undo operation.
Validation panel
Section titled “Validation panel”With Validation enabled, the compact panel below the editor checks changed code after a short debounce. Expand reported errors or warnings and read the first causal diagnostic before using Fix with AI.
The default Internal engine validates against Algo Lab’s Pine-compatible runtime. TradingView API sends the source to the external compiler endpoint and requires a configured TradingView username. The two validators can disagree because they are not the same runtime.
See Validate Pine Script.
Staged changes
Section titled “Staged changes”Agent and candidate-promotion flows can stage a read-only side-by-side diff. The active tab is not replaced until you choose Accept All. Reject All leaves the active source unchanged.
There is no per-hunk accept control. Reject a proposal containing unrelated lines and request a smaller change. After acceptance, validate, save, and rerun the relevant Lab baseline.
A safe working loop
Section titled “A safe working loop”- Select and save the baseline strategy tab.
- Confirm the Lab symbol, timeframe, range, and Settings.
- Edit directly or ask Agent mode for one bounded change.
- Accept or reject the complete staged diff.
- Validate with the intended provider.
- Save and run the candidate.
- Add the version and evidence to the Case Study when the change belongs to a research decision.
- Confirm important behavior in TradingView before external use.