Open the app
Backtesting & strategy

Strategy laboratory

Where agents and humans collaborate: an explicit strategy lifecycle, immutable versioning, and clear agent boundaries.

The strategy laboratory is where agents and humans collaborate. Every strategy moves through an explicit lifecycle, and every change creates a new immutable version.

The lifecycle

  1. Idea → HypothesisA testable claim
  2. Formal specificationEntry/exit rules, feature requirements
  3. Historical test → Robustness testBacktest + out-of-sample
  4. Shadow mode → Paper tradingLive data, no/sim capital
  5. Human approvalGovernance gate
  6. Limited productionVery small capital
  7. Evaluation → Promotion or rejectionMeasured, then decided

What a strategy version pins

An immutable version captures everything needed to reproduce a trade:

PinnedExamples
LogicEntry rules, exit rules, scoring weights
InputsFeature definitions, data requirements, model versions
RiskRisk policy, position sizing
ScopeSupported exchanges and chains
StatusDraft → testing → paper → production → rejected

The common strategy interface

Every strategy implements one interface, so the engine can run them interchangeably:

strategies/base.py
class TradingStrategy(Protocol):
    strategy_id: str
    strategy_version: str

    def evaluate(self, context) -> StrategySignal | None:
        ...  # returns a signal candidate — never places an order

It must declare supported markets and timeframes, required history and data sources, parameters, entry / exit / invalidation conditions, risk assumptions and known limitations.

The reference strategy — Momentum Breakout Spot V1

The first lab is not meant to guarantee profit; it exists to validate the whole chain end-to-end. Scope: Spot, long-only, liquid quotes, no leverage, no shorting.

momentum_breakout_spot/v1
Entry — a conjunction of measured conditions

Close breaks the prior 20-candle high, volume confirms (≥2× median), momentum is positive and normalized momentum clears the threshold τ — plus spread, slippage, liquidity and data-quality gates.

atr_stop_v1
Stop & size

ATR stop (optionally tightened to the breakout level), then risk-first sizing bounded by every capital, liquidity and exchange limit.

Exit on any of:

  • stop-loss
  • take-profit
  • trailing stop
  • close below breakout
  • momentum fades
  • volume collapses
  • spread/liquidity emergency
  • max holding time
  • circuit breaker

Agent boundaries

Agents
MayPropose strategies, create hypotheses, suggest features, generate experiments, interpret results, recommend promotion/rejection.
May notSilently modify a production strategy, change capital limits, activate execution, delete failed experiments, overwrite historical results.
Immutability is the point
Strategies and configurations used by a trade stay immutable, so every trade remains reproducible from its inputs and every score references the exact feature and strategy versions that produced it.