SELF-LEARNING

Agents That Get Smarter Every Trade

Learning cycles analyze performance, propose mutations, paper-test changes, and promote or roll back through a governed state machine.

Four Stages of Continuous Improvement

Each cycle runs automatically after a configurable number of trades. The agent reflects on what worked, what failed, and how to improve -- then proves it with data.

1

Analyze

Review recent trades, win rates, drawdowns, and signal accuracy across all positions

2

Propose

AI generates strategy mutations: adjusted thresholds, new data sources, improved sizing

3

Paper Test

Shadow-execute the mutation against live market data. Same prices, same timestamps -- simulated money

4

Evaluate and Gate

Must pass all harness safety rules and clear the configured benchmark. Otherwise, rolled back automatically

Mutation Pipeline State Machine

IDLE
ANALYZING
PAPER_TESTING
EVALUATING
ROLLED_BACK

Every mutation moves through this pipeline. Auto-mode applies changes automatically when promoted. Manual mode requires your approval at the EVALUATING stage. A code diff viewer shows exactly what changed before you decide.

Before and After: Learning Cycle #14

An illustrative example showing how a political momentum agent can be evaluated over repeated learning cycles.

Before (Cycle 1)
Win Rate 52.1%
Avg Return +1.2%
Max Drawdown -18.4%
Sharpe Ratio 0.61
Profit Factor 1.08
Avg Trade Size $48.20
Threshold 3.0 pts
After (Cycle 14)
Win Rate 68.7%
Avg Return +4.8%
Max Drawdown -7.1%
Sharpe Ratio 1.94
Profit Factor 2.31
Avg Trade Size $72.50
Threshold 2.4 pts

Intelligent Mutation Engine

The learning pipeline is not random trial-and-error. The AI analyzes which specific decisions led to losses, identifies patterns in losing trades, and generates targeted mutations designed to address those specific weaknesses.

Mutations can adjust thresholds, add new data source integrations, change position sizing algorithms, modify entry/exit timing, or refactor evaluation logic entirely. Each mutation is a minimal, focused change that can be independently validated.

  • Root-cause analysis on every losing trade
  • Targeted mutations, not random changes
  • Full version history with instant rollback
  • Optional human approval before any change deploys
v1.14 deployed v1.12 rolled back
mutation_proposal.py CYCLE #14
# Learning Cycle #14 - Proposed Mutation
# Target: Reduce false positives in
# low-volatility periods

class Mutation_14:
    type = "threshold_adjustment"
    target = "evaluate.threshold"

    changes = {
        "threshold": 3.0 -> 2.4,
        "vol_filter": True,
        "min_volume": 1000,
    }

    rationale = """
    Analysis of 23 losing trades shows
    68% occurred in low-volume markets.
    Adding volume filter and lowering
    threshold to capture more high-
    confidence signals."""


    backtest_result = {
        "win_rate": 0.687,
        "sharpe": 1.94,
        "status": "APPROVED"
    }
learning_cycle.log LIVE
14:32:01INFOLearning cycle #14 initiated
14:32:01INFOAnalyzing last 50 trades...
14:32:03LEARNFound 23 losing trades, 27 winning
14:32:04LEARNPattern: 68% of losses in low-volume mkts
14:32:05LEARNProposing mutation: add volume filter
14:32:05LEARNProposing mutation: lower threshold 3.0 > 2.4
14:32:06TESTShadow strategy instantiated for paper testing
14:32:06TESTBaseline hash captured: d4e1...8f2a
14:45:22TESTPaper trade 10/10 complete: win=70% pnl=+$14.20
14:45:22OKHarness check: 4/4 cases passed (0 blocking)
14:45:22OKBaseline hash unchanged -- no concurrent drift
14:45:23OKPaper win rate 70% exceeds live 52%
14:45:23OKMutation promoted -- deployed to live strategy
14:45:23INFOEvidence recorded: 3 records (mutation, harness, perf)

Learning With a Control Plane

Self-learning does not mean uncontrolled. Every mutation is paper-tested against live market data before deployment. Losing trades are classified as structural, noise, or sizing -- and structural failures become permanent safety rules.

The control plane includes a circuit breaker that halts trading after consecutive losses, a rate limiter, and harness cases that accumulate over time. Safety only grows. Every decision is recorded in an immutable evidence trail.

  • Paper-tested mutations against live market data
  • AI loss classification: structural, noise, or sizing
  • Monotonic harness rules that only accumulate
  • Circuit breaker and rate limiter on every signal
  • Immutable evidence trail for every decision
Full Governance Details

You Control the Learning

Fine-tune every aspect of how your agents learn and evolve.

learning_config.json EDITABLE
{
  "learning_enabled": true,
  "cycle_trigger": "every_50_trades",
  "auto_approve": false,
  "min_improvement": 0.05,
  "max_mutations_per_cycle": 3,
  "backtest_window_days": 90,
  "rollback_on_drawdown": 0.15,
  "notify_on_learn": true,
  "version_retention": "all"
}

Let Your Agents Learn While You Sleep

Continuous improvement, zero maintenance. Start with a simple strategy and watch it evolve.