Exciting Update: Version 1.0.6 is now available, introducing Direct Pine Script Mode, Pine Logs Runtime Bridge, Zero-Repaint Linting, Source Maps, Intrabar MFE/MAE Stats, and expanded Pine v5/v6 Transpiler Parity. Read more
Version: 1.0.6

Script Version History & Revision Management

Never lose your trading logic or indicator experiments. The BacktestX Script Editor provides built-in automated revision tracking, timestamped code snapshots, and instant 1-click rollback directly on the chart canvas—preserving editable Pine Script sourceCode, lang, and langMode state across restores.

Why Script History Matters

When developing complex trading strategies and algorithmic indicators, fine-tuning indicator periods or altering exit rules can accidentally break previously working code. BacktestX Script History captures snapshot checkpoints continuously, allowing you to experiment fearlessly.

Auto-Snapshots

Every time you hit Run (Ctrl+Enter) or save, a fresh snapshot is indexed automatically.

1-Click Restore

Preview exact code revisions side-by-side and restore any previous version instantly without manual copy-pasting.

Safe Rollback

Restoring a past version creates a new milestone instead of overwriting, ensuring zero risk of losing current work.

Looking for Starter Templates?

Explore the 3 New Script Creation Modes (Custom Indicator, Strategy Backtest, and 169+ Indicator Library) to scaffold new code with one click.

How to Open Script History

To view, compare, or restore revisions of your active script in the Script Editor:

1

Click the "History" Button

Look at the top action bar inside the Script Editor (next to the Run and Save buttons) and click the History button ().

2

Inspect Chronological Revisions

The Version History side-panel will open, displaying all previous revisions sorted chronologically with exact date/time stamps, line counts, and change summaries.

3

Click Any Revision to Preview

Click on any listed revision to see a syntax-highlighted code preview or diff comparison against your current working editor code.

Snapshot Triggers & Engine Logic

BacktestX employs an intelligent snapshot engine to ensure lightweight performance while preventing revision loss:

Compile-Time Snapshots

Whenever you run code via Run or Ctrl+Enter, the engine verifies syntax and automatically registers a new version checkpoint before executing on the chart canvas.

Manual Save Checkpoints

Pressing Ctrl+S saves the script and marks a designated milestone in your history timeline.

Content-Hash Deduplication

To keep history clean, identical code runs do not create duplicate entries. The engine compares SHA hashes of script buffers before appending new revision records.

Restoring & Reverting Revisions

Restoring previous code is seamless and non-destructive:

"Restore Revision" Button

In the history preview modal, click the blue "Restore Revision" button. The editor immediately populates with the selected snapshot code.

Automatic Safety Milestone

Before rolling back, the engine captures your pre-restoration code as a new safety snapshot, so you can always toggle back if needed.