Checking

Strategy Studio Manual

Complete strategy editor guide

This page explains every editor button, panel, and capability so users can author, test, and maintain Pine-like strategies confidently.

Recommended Flow

From idea to backtest

Open Strategy Studio
1

Start a script

Use New Script, a template, or import a `.pine` / `.txt` file.

2

Edit and search

Write Pine-like code, use search/replace, and watch completions/docs while editing.

3

Compile

Run Test Compile to ask the backend for diagnostics, generated inputs, capabilities, and IR.

4

Run and inspect

Configure a stored dataset in Strategy Studio, run the compiled IR, then open the generated report.

Current Capabilities

What each editor feature does

New Script and templates

Fast starting points for common strategy shapes.

  • New Script creates a minimal runnable scaffold.
  • Template buttons load supported examples such as RSI + MACD, Trend Cross, and Mean Reversion.
  • Changing templates clears the previous compile result because the code has changed.

Editable Pine-like editor

The main place for writing strategy logic.

  • The editor is always LTR so code remains readable even when Persian UI is active.
  • Line numbers and diagnostic markers sit beside the editor.
  • Backend diagnostic ranges can appear as underlines inside the editor.

Search and replace

Find and change code without leaving the editor.

  • Search finds case-insensitive matches and shows the active match count.
  • Previous and next buttons move through matches and focus the selected range.
  • Replace changes the current match; All replaces every match.

Completions and hover docs

Small in-editor guidance for supported Pine-like symbols.

  • Typing symbols such as `ta.`, `strategy.`, `input.`, or `syminfo.` shows local completions.
  • Placing the cursor on a known symbol shows a short explanation and example.
  • These docs describe the current supported subset, not full TradingView parity yet.

Pine plot lines

Render script values on the generated report chart.

  • Basic `plot(series, title, color, linewidth)` calls compile into backend chart artifacts.
  • Every bar value is persisted in `chart_plots`; the frontend does not calculate replacement lines.
  • Overlay plots share the candle pane, non-overlay plots use a separate pane, and legend buttons toggle visibility.

Test Compile

Checks whether the backend can understand and run the script.

  • Sends the current script to `POST /strategies/compile`.
  • Successful compile returns generated inputs, backend capabilities, and strategy IR.
  • Failed compile returns diagnostics with line, column, code, message, and sometimes rewrite hints.

Diagnostics and compatibility

Explains what is unsupported and how to rewrite it.

  • Diagnostics panel shows backend compiler errors, warnings, and info messages.
  • Pine Compatibility combines frontend checks with backend diagnostics.
  • Clicking a diagnostic jumps to the related editor line/column.

Drafts

Keep local drafts and immutable backend versions.

  • Save Draft stores the current script and input overrides in local browser storage.
  • Save Server Version stores an immutable version with its content hash through `/strategy-drafts`.
  • Server Drafts can load the latest artifact or any previous version.

Import and export

Move strategies in and out of the platform.

  • Import Pine accepts `.pine` and `.txt` script files.
  • Export Pine downloads the current script as text.
  • Import/Export JSON uses the portable strategy definition format with script, inputs, optional IR, and schema version.

Show IR

Inspect the backend-safe strategy representation.

  • IR is only available after a successful compile.
  • It is shown in LTR JSON format even when Persian UI is active.
  • Use it for debugging backend contracts and understanding what will be sent to the runner.

Generated inputs

Tune values declared by `input.*` calls.

  • After compile, supported `input.int`, `input.float`, and `input.bool` declarations become controls.
  • Changing an input marks the compile result stale.
  • Compile again after changing inputs so the IR uses the new values.

Direct backtest runner

Test the compiled strategy without leaving Strategy Studio.

  • Select the stored dataset source, symbol, timeframe, capital, and execution costs.
  • The runner sends the current script, backend IR, and input overrides to `/backtests/run-stored`.
  • Pine runtime settings show the effective strategy declaration and can be overridden for one run through the typed backend contract.
  • Successful runs show a compact performance summary and a link to the full report.

Keyboard Shortcuts

Fast editor commands

Cmd/Ctrl + Enter

Compile the current script.

Cmd/Ctrl + S

Save the current script as a local draft.

Cmd/Ctrl + F

Focus the editor search input.

Enter / Space

Activate focused buttons where supported.

Planned Next

This manual will grow with the editor

Monaco or CodeMirror editor

A true editor model for editable syntax highlighting, better cursor positioning, and richer overlays.

Variable-aware autocomplete

Completions that understand variables declared inside the current script.

Safe rewrite actions

One-click fixes for supported backend diagnostics when the rewrite is deterministic.

Formatter

Auto-format Pine-like scripts after the parser AST becomes stable enough.

Editor-native run shortcut

Add a keyboard shortcut to the direct runner now available in Strategy Studio.

TradingView parity growth

More language constructs, chart objects, alerts, and migration assistance as backend support expands.