Strategies Overview

What Is a Trading Strategy?

A trading strategy is a set of rules that tell Botmarley when to buy and when to sell a cryptocurrency. Instead of watching charts all day and making emotional decisions, you define your rules once, and Botmarley follows them automatically -- 24 hours a day, 7 days a week.

Think of a strategy as a recipe:

  • Ingredients are market data (prices, indicators, candle patterns).
  • Instructions are the rules (if RSI drops below 30, buy).
  • The result is consistent, disciplined trading without human emotion.

The Strategies List

The web interface provides a central place to manage all your strategies. From the list page you can edit, duplicate, delete, backtest, or start live trading for any strategy with a single click.

Strategies list page showing saved strategies with action buttons for Edit, TOML, Duplicate, Delete, Backtest, and Start Live

How Botmarley Strategies Work

Botmarley strategies are defined as TOML files -- simple, human-readable text files that describe a rule engine. Each strategy file lives in the strats/ directory and contains:

  1. Metadata -- the strategy's name, description, and position limits.
  2. Actions -- a list of things the bot can do (open a position, add to it, or sell).
  3. Triggers -- conditions that must be true for each action to fire.

Note

Botmarley's strategy engine is exchange-agnostic. The same strategy TOML file works for any trading pair -- you select the pair when you start a backtest or live session, not in the strategy itself.

Strategy Evaluation Flow

Every time a new candle closes, Botmarley evaluates your strategy. Here is how the evaluation loop works:

flowchart TD
    A["New Candle Received"] --> B["For Each Action in Strategy"]
    B --> C{"Check ALL Triggers<br/>(AND logic)"}
    C -- "All triggers TRUE" --> D["Execute Action<br/>(open_long / buy / sell)"]
    C -- "Any trigger FALSE" --> E["Skip This Action"]
    D --> F["Update Position State"]
    E --> F
    F --> G{"More Actions?"}
    G -- "Yes" --> B
    G -- "No" --> H["Wait for Next Candle"]
    H --> A

    style A fill:#4a9eff,color:#fff
    style D fill:#22c55e,color:#fff
    style E fill:#6b7280,color:#fff
    style H fill:#4a9eff,color:#fff

Key points about evaluation:

  • Each action is evaluated independently -- one strategy can have multiple buy and sell actions, and each is checked every tick.
  • Triggers within an action are AND-combined -- ALL triggers must be true for the action to fire.
  • Actions are evaluated in order -- from first to last as written in the TOML file.

Basic Strategy Anatomy

A Botmarley strategy TOML file has two main sections:

1. The [meta] Section

This defines your strategy's identity and global settings:

[meta]
name = "My First Strategy"
description = "A simple RSI-based entry and exit"
max_open_positions = 3
FieldRequiredDescription
nameYesHuman-readable name for the strategy
descriptionNoOptional explanation of the strategy's logic
max_open_positionsNoMaximum concurrent open positions. Omit for unlimited.

2. The [[actions]] Array

Each [[actions]] block defines one thing the bot can do, along with the conditions that must be met:

[[actions]]
type = "open_long"          # What to do: open_long, buy, or sell
amount = "100 USDC"         # How much: fixed amount or percentage
average_price = false        # Whether to average the entry price (DCA)

  [[actions.triggers]]       # When to do it: one or more trigger conditions
  indicator = "rsi_14"
  operator = "<"
  target = "30"

A Simple Complete Example

Here is a complete, working strategy that buys when RSI is oversold and sells when it recovers:

[meta]
name = "RSI_Scalper"

# ACTION 1: Open a position when RSI drops below 30
[[actions]]
type = "open_long"
amount = "100 USDC"

  [[actions.triggers]]
  indicator = "rsi_14"
  operator = "<"
  target = "30"

# ACTION 2: Sell half when RSI recovers to 50
[[actions]]
type = "sell"
amount = "50%"

  [[actions.triggers]]
  indicator = "rsi_14"
  operator = ">"
  target = "50"

# ACTION 3: Sell everything when RSI reaches 70
[[actions]]
type = "sell"
amount = "100%"

  [[actions.triggers]]
  indicator = "rsi_14"
  operator = ">"
  target = "70"

What this strategy does, step by step:

  1. Action 1 watches RSI(14). When it drops below 30 (oversold territory), the bot opens a new position by buying 100 USDC worth of the asset.
  2. Action 2 watches for RSI to rise above 50. When it does, the bot sells 50% of the position to lock in partial profit.
  3. Action 3 watches for RSI to rise above 70 (overbought territory). When it does, the bot sells the remaining 100% of the position to fully exit.

Tip

Start simple. A strategy with 2-3 actions is often more effective than a complex one with 10 actions. You can always add complexity after backtesting confirms the base logic works.

What's Next?

Now that you understand how strategies are structured, explore the following topics: