完全本地运行的多平台量化策略引擎 —— 回测 / Dry Run / 实盘。
从灵感,到规则,到实盘。
纯本地 CLI。无云端依赖、无遥测、无自动更新。密钥与数据不出你的机器。
ricow,由 5 个 crate 的 Rust workspace 构建。os/io/require/loadstring/pcall;每 tick 指令预算 100 万,内存 64 MB)。ricow.toml(明文,永不入 git;Unix 0600,Windows 仅当前用户 ACL)。# Linux / macOS
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/ailenwu2000/ricow/releases/latest/download/ricow-installer.sh | sh
# Windows (PowerShell)
powershell -ExecutionPolicy Bypass -c "irm https://github.com/ailenwu2000/ricow/releases/latest/download/ricow-installer.ps1 | iex"
想用压缩包?所有平台产物(Linux x64/arm64、macOS x64/arm64、Windows x64)与 SHA256 校验和都在
Releases 页。也可以源码构建:cargo build --release。
| 档位 | 命令 | 资金 | 前置 |
|---|---|---|---|
| 回测 | ricow backtest --strategy linear_position_grid --pair ETHUSDT --days 30 | 无 | 零配置 |
| Dry Run(本地虚拟撮合) | ricow start <名字> | 无 | 零配置 |
| demo(币安测试网真实下单) | ricow start <名字> --demo | 模拟资金 | [exchange].demo_* |
| 实盘(主网真实资金) | live_enabled = true + ricow start <名字> --live --accept-risk | 真实 | [exchange].binance_* + 首次风险确认 + Dry Run 时长门禁 |
demo 与实盘都真实调用交易所接口,差别只在域名(demo-api/demo-fapi vs 主网)与凭据,两套凭据互不回落。
策略是 Lua 脚本,通过引擎提供的接口驱动(ctx、exec.*)。推荐路径在落盘前先编译门禁 + 真实 K 线沙箱回测:
ricow create --name my_strategy --pair ETHUSDT --script my_strategy.lua # 编译门禁 + 真实 K 线沙箱回测
ricow approve # 由你在交互终端逐字确认
ricow deploy <preview_id> --token <token> # 落盘到 strategies/
内置策略: strategies/spot/linear_position_grid.lua(现货线性仓位网格),照它写即可。
完整 API 见 specs/lua-api.md。
ricow.toml(Unix 0600 / Windows 仅当前用户 ACL,已被 git 忽略);产品不代写密钥,也从不上传。live_enabled = true;命令行须 --live --accept-risk,并有首次风险确认与 Dry Run 时长门禁。| 平台 | 状态 |
|---|---|
| Linux x86_64 | 实机验证(构建、回测、demo 测试网真实下单流程) |
| Linux arm64 | 由 CI 构建并发布;尚未实机跑过交易流程 |
| Windows x86_64 | 编译与全量单元测试已由 CI 通过;尚未实机跑过交易流程 |
| macOS(x86_64 / arm64) | 由 CI 构建并发布;未实机验证 |
发布产物 ≠ 宣称支持:除 Linux x86_64 外,各平台尚未端到端跑过真实交易所流程。
问题与建议:GitHub Issues。 安全漏洞请走 SECURITY.md 的私有渠道,不要开公开 issue。