Skip to content

Wickra DarwinAlphaZero for trading strategies.

Evolutionary strategy search at millions of backtests per second — mutate and cross JSON strategy specs to brute-force alpha across the indicator space. The search is data, not code — deterministic and byte-identical across ten languages.

Wickra Darwin

The search is JSON, not code

An evolution is an EvolveSpec: a seed, a population and generations, mutation and crossover rates, a fitness, and a search_space over indicators and their parameter ranges. The engine evolves StrategySpec genomes and returns the ranked survivors.

json
{
  "seed": 42,
  "population": 64,
  "generations": 20,
  "mutation_rate": 0.15,
  "crossover_rate": 0.6,
  "fitness": "sharpe",
  "search_space": {
    "indicators": [
      { "name": "rsi", "param_ranges": [{ "min": 2, "max": 30, "step": 1 }] },
      { "name": "ema", "param_ranges": [{ "min": 5, "max": 200, "step": 5 }] }
    ],
    "rules": "single_threshold",
    "max_conditions": 2
  },
  "elitism": 2,
  "top": 10
}

Install

The same search from every language — native Rust, Python, Node.js and WASM, plus a C ABI for C, C++, C#, Go, Java and R.

pip install wickra-darwin

Run it from any language

Construct a Darwin from the JSON spec, then drive it with command(json) -> json. A given seed produces the same ranked survivors in every binding.

import json
from wickra_darwin import Darwin

spec = json.dumps({
    "seed": 1, "population": 8, "generations": 3,
    "mutation_rate": 0.2, "crossover_rate": 0.6, "fitness": "sharpe",
    "search_space": {
        "indicators": [{"name": "rsi", "param_ranges": [{"min": 2, "max": 30, "step": 1}]}],
        "rules": "single_threshold", "max_conditions": 1,
    },
    "elitism": 1, "top": 5,
})

darwin = Darwin(spec)
data = {"BTCUSDT": [{"time": 1700000000, "open": 100, "high": 101, "low": 99, "close": 100.5, "volume": 10}]}
report = json.loads(darwin.command(json.dumps({"cmd": "evolve", "data": data})))
print(report["best"][0]["fitness"])

Built on the Wickra core

Wickra Darwin is part of the Wickra ecosystem. Every candidate is scored by wickra-backtest over the 514 indicators of wickra-core, so an evolved strategy sees exactly the same numbers a live chart would.

Wickra Darwin is a software library, not a trading system, and comes with no warranty — an evolved strategy is not financial advice. Use at your own risk.