Review Staged Pine Script Changes
When Agent mode returns an applicable edit, Algo Lab stages it in a read-only side-by-side Monaco diff. The original script is on the left and the proposed script is on the right. Nothing is merged until you choose Accept All.
Read the diff
Section titled “Read the diff”- Removed lines appear on the original side.
- Added lines appear on the proposed side.
- Unchanged lines provide location and control-flow context.
- The editor supports scrolling and split-view resizing for larger changes.
The current editor does not expose a separate inline-diff mode or per-hunk accept buttons. Treat the proposal as one staged change.
Decide deliberately
Section titled “Decide deliberately”-
Compare the request with the total diff. A one-line repair should not silently replace unrelated strategy logic.
-
Review declarations, entry conditions, exit conditions, sizing, order behavior, alert payloads, and inputs touched by the proposal.
-
Choose Reject All if the base script changed, the scope is too large, or any behavior is unexplained. Then send a narrower request from the current script.
-
Choose Accept All only when every changed line is understood. Accepting replaces the active editor content with the proposed version and clears the staged state.
-
Validate with the intended provider and rerun the relevant baseline or comparison. A clean diff is not evidence that trading behavior stayed equivalent.
Review by change type
Section titled “Review by change type”| Change | Check before accepting |
|---|---|
| Validation repair | The edit addresses the reported diagnostic and does not suppress another error |
| Entry or exit logic | Position direction, confirmation timing, pyramiding, and order identifiers remain intentional |
| Risk or sizing | Units, defaults, and strategy properties match the requested behavior |
| Webhook payload | Required authentication, ticker, price, quantity, and position intent remain valid JSON |
| Refactor | Backtest events and alert behavior remain equivalent under the same inputs |
For a large replacement, ask for smaller staged steps. Smaller diffs make it easier to attribute a later result change to one decision.
If a proposal cannot apply
Section titled “If a proposal cannot apply”- Confirm the active tab is the script used to generate the request.
- Reject stale staged changes and share the current script again.
- Ask for one minimal unified diff against the exact current content.
- If the assistant returned explanation without an applicable edit, use that explanation to create a new bounded Agent request.