Skip to content

Wickra CompileWrite once as data. Deploy anywhere.

Compile a strategy spec into a standalone deployable — a WASM module, a self-contained binary, or a no_std artifact for microcontrollers. The spec is data, not code — and the manifest is byte-identical across ten languages.

Wickra Compile

The spec is JSON, not code

A compile is a CompileSpec: a strategy (the same StrategySpec a backtest runs), a target and a crate_name. The compiler embeds the strategy verbatim and generates a standalone project for the target you name.

json
{
  "strategy": {
    "symbol": "BTCUSDT", "timeframe": "1h",
    "indicators": { "fast": { "type": "Ema", "params": [12] }, "slow": { "type": "Ema", "params": [26] } },
    "entry": { "cross_above": ["fast", "slow"] },
    "exit":  { "cross_below": ["fast", "slow"] },
    "sizing": { "type": "fixed_qty", "qty": 1 }
  },
  "target": { "kind": "wasm" },
  "crate_name": "my_strategy"
}

Install

The same compiler 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-compile

Compile from any language

Construct a Compiler, then drive it with command(json) -> json. A given spec produces the byte-identical manifest in every binding.

import json
from wickra_compile import Compiler

spec = {
    "strategy": {
        "symbol": "x", "timeframe": "1h",
        "indicators": {"f": {"type": "Ema", "params": [3]}},
        "entry": {"cross_above": ["f", "f"]}, "exit": {"cross_below": ["f", "f"]},
        "sizing": {"type": "fixed_qty", "qty": 1},
    },
    "target": {"kind": "wasm"}, "crate_name": "demo",
}

c = Compiler()
resp = json.loads(c.command(json.dumps({"cmd": "compile", "dry_run": True, "spec": spec})))
print(resp["manifest"]["project_hash"])

Built on the Wickra core

Wickra Compile is part of the Wickra ecosystem. The project it generates embeds wickra-core, so a compiled strategy computes exactly the same indicator values a backtest or a live chart would.

Wickra Compile is a software library, not a trading system, and comes with no warranty — use at your own risk.