Strategy Editor

The Strategy Editor is where you create, edit, and manage your trading strategies. Access it from the sidebar by clicking Strategies or navigating directly to /strats.

The Strategies List Page

The strategies list page (/strats) shows all your saved strategies. For each strategy you can see:

  • The strategy name and description
  • When it was created and last updated
  • Action buttons for editing, duplicating, backtesting, and deleting
flowchart LR
    A["Strategies List<br/>/strats"] --> B["Edit<br/>/strats/edit/{id}"]
    A --> C["New Strategy<br/>/strats/new"]
    A --> D["Duplicate"]
    A --> E["Delete"]
    A --> F["Backtest"]
    B --> G["Save"]
    C --> G
    G --> A

    style A fill:#4a9eff,color:#fff
    style G fill:#22c55e,color:#fff

Creating a New Strategy

To create a new strategy:

  1. Navigate to /strats (click Strategies in the sidebar).
  2. Click the New Strategy button.
  3. The editor opens with an empty TOML document.
  4. Write your strategy in TOML format (see Strategy Overview for the structure).
  5. Click Save.

The editor assigns a unique ID (UUID) to your new strategy automatically.

Tip

If you are new to writing strategies, start by duplicating one of the existing strategies and modifying it. This is faster than writing from scratch and helps you learn the TOML structure by example.

The Visual Strategy Editor

The visual editor provides a form-based interface for building strategies without writing TOML by hand. You can add actions, configure triggers, set indicator parameters, and define position management rules -- all through a structured UI.

Visual strategy editor with form-based UI for building trading strategies

The TOML Text Editor

The strategy editor at /strats/edit/{id} provides a text-based TOML editor where you write your strategy directly. The editor shows the raw TOML content of your strategy file.

Raw TOML editing view for direct strategy file editing

A typical editing session looks like this:

  1. The [meta] section is at the top -- set your strategy's name and description here.
  2. Below that, define your [[actions]] blocks with their triggers.
  3. As you type, the editor validates your TOML in real time.

Editor Layout

The editor page provides:

  • Strategy name displayed at the top
  • TOML text area for editing the strategy content
  • Save button to persist changes
  • Back to list link to return to /strats

Real-Time Validation

Every time you save or validate your strategy, Botmarley checks the TOML content for errors. The validation endpoint (POST /api/strats/validate) checks:

  • TOML syntax -- is the file valid TOML?
  • Required fields -- does [meta] have a name? Does each action have a type and amount?
  • Valid action types -- only open_long, buy, and sell are accepted.
  • Amount format -- must be "100 USDC" (fixed) or "50%" (percentage).
  • Indicator format -- must match known patterns like rsi_14, sma_50, bb_lower.
  • Operator validity -- must be one of >, <, =, cross_above, cross_below.
  • Timeframe validity -- if specified, must be 1m, 5m, 15m, 1h, 4h, or 1d.
  • Period ranges -- indicator periods must be between 1 and 200.
  • max_open_positions -- if set, must be 1 or greater.

When validation fails, the error response includes:

FieldDescription
field_pathWhere the error is, e.g. actions[0].triggers[1].operator
error_codeMachine-readable code like INVALID_FORMAT or REQUIRED
messageHuman-readable description of the problem
suggestionHint for how to fix the error

Warning

Botmarley will not let you save an invalid strategy. Fix all validation errors before saving. This prevents broken strategies from being used in backtests or live trading.

Common Validation Errors

ErrorCauseFix
INVALID_ACTION_TYPETypo in action typeUse open_long, buy, or sell
INVALID_AMOUNT_FORMATMissing unit or wrong formatUse "100 USDC" or "50%"
INVALID_PERIODNon-numeric indicator periodUse rsi_14 not rsi_fourteen
INVALID_PERIOD_RANGEPeriod 0 or > 200Keep periods between 1 and 200
REQUIREDMissing indicator or operatorAdd the missing field to your trigger
INVALID_TIMEFRAMEUnknown timeframe stringUse 1m, 5m, 15m, 1h, 4h, or 1d
INVALID_OPERATORUnknown comparison operatorUse >, <, =, cross_above, cross_below

Saving Strategies

When you click Save, Botmarley:

  1. Validates the TOML content server-side.
  2. If valid, writes the TOML file to the strats/ directory with the strategy's UUID as the filename.
  3. Returns a success response with the strategy ID.
  4. Logs the save action to the activity log.

If the strategy is new (no ID yet), a new UUID is generated. If you are editing an existing strategy, the same ID is reused and the file is overwritten.

Note

Strategy files are stored as plain .toml files in the strats/ directory. The filename is the UUID (e.g., 6f814a05-73e8-483f-8963-aa8a4ab8e1e7.toml). You can also edit these files directly with any text editor -- Botmarley reads them from disk.

Duplicating Strategies

To duplicate a strategy:

  1. Go to the strategies list (/strats).
  2. Click the Duplicate button on the strategy you want to copy.
  3. Botmarley creates a copy with " (Copy)" appended to the name.
  4. You are redirected to the editor for the new copy.

This is useful when you want to create variations of an existing strategy (for example, testing different RSI thresholds or DCA levels).

Deleting Strategies

To delete a strategy:

  1. Go to the strategies list (/strats).
  2. Click the Delete button on the strategy you want to remove.
  3. The TOML file is removed from the strats/ directory.
  4. You are redirected back to the list.

Danger

Deleting a strategy is permanent. The TOML file is removed from disk. If you think you might want the strategy later, duplicate it first or keep a backup.

Bulk Delete

You can also select multiple strategies and delete them all at once using the bulk delete feature on the strategies list page. Select the checkboxes next to the strategies you want to remove, then click the bulk delete button.

Discovering Available Pairs

When you open the backtest modal from the strategies list page, Botmarley automatically scans your downloaded market data to show you which trading pairs are available. This is based on the .arrow files in your data storage directory.

The available pairs and their date ranges are shown in the backtest form, so you can select:

  • Which pair to backtest against (e.g., XBTUSD, ETHUSD)
  • Start and end dates -- pre-filled based on your actual data range

Tip

If you do not see the pair you want, you need to download its historical data first. Go to the Market Data section to download candle history from Kraken.