← ClaudeAtlas

aicoin-freqtradelisted

Use when user asks about Freqtrade — strategy creation, backtest, hyperopt, switching strategies / pairs / dry-run mode, querying live bot status / balance / open positions / 盈亏. Trigger words: 'write strategy', 'create strategy', 'backtest', 'switch strategy', 'switch to live', 'open positions', 'P&L', '写策略', '创建策略', '回测', '部署策略', '切策略', '切实盘', '当前持仓', '今天赚多少', '盈亏'. In CoinClaw containers (OpenClaw / Hermes / Claude Code) freqtrade is a supervisord-managed daemon on :8080 — this skill auto-detects engine + paths via lib/coinclaw-env.mjs and never spawns competing freqtrade processes. Outside CoinClaw it falls back to host mode (clone freqtrade + nohup). For prices/charts use aicoin-market. For exchange trading use aicoin-trading. For Hyperliquid use aicoin-hyperliquid.
aicoincom/coinos-skills · ★ 42 · AI & Automation · score 86
Install: claude install-skill aicoincom/coinos-skills
# AiCoin Freqtrade Freqtrade 策略 / 回测 / 部署 / 实时控制 — 跨 CoinClaw 三引擎自动适配。 ## 关键原则(读完再动手) ### 一、CoinClaw 容器里 freqtrade 是常驻 daemon OpenClaw / Hermes / Claude Code 三个引擎容器都通过 supervisord 把 freqtrade 起为常驻进程, 监听 `127.0.0.1:8080`, 默认跑 `NoOpStrategy`(空跑). **不要自己起 freqtrade 进程** — 会跟 daemon 抢端口, dashboard 立刻 offline. 正确流程是: 写策略文件 → 调 `ft-deploy.mjs deploy {"strategy":"..."}` → 脚本改 config + 重启 daemon. dashboard 会自动刷出新策略. `scripts/ft.mjs` + `scripts/ft-deploy.mjs` 内置三引擎自动识别(`lib/coinclaw-env.mjs`), 路径 / auth / supervisord socket 都自动解析, **agent 不用关心是哪个引擎**. ### 二、永远先调 freqtrade REST API, 不要"自己计算" | 用户问 | 必须先调 | |---|---| | 现在赚多少 / 总盈亏 / 今天涨了多少 | `ft.mjs profit` (`/api/v1/profit`) | | 持仓 / 现在开了哪些 | `ft.mjs trades_open` (`/api/v1/status`) | | 余额 / 资金多少 | `ft.mjs balance` (`/api/v1/balance`) | | 跑的什么策略 / 当前模式 | `ft.mjs daemon_info` 或 `config` | | 历史交易 / 已平仓 | `ft.mjs trades_history` | | 单交易对绩效 | `ft.mjs profit_per_pair` | **dashboard 数字对齐规则(关键)**: 用户问"赚了多少"必须报告**两个数字**: - **已平仓累计盈亏** = `profit_closed_coin` (USDT) — **dashboard 顶栏的累计盈亏 = 这个** - **含浮动总盈亏** = `profit_all_coin` (USDT) — 已平仓 + 当前持仓的浮动盈亏 只调 `/status` 拿持仓浮动盈亏会漏掉已平仓部分, 导致跟 dashboard 数字不一致 — 用户立刻发现, 信任度归零. ### 三、切策略 / 切实盘 / 切交易对必须走脚本 config.json 是 daemon 启动时读一次, 手动改完不会自动生效. 必须用: | 操作 | 命令 | 是否需要 daemon 重启 | |---|---|---| | 切策略 | `ft.mjs set_strategy {"strategy":"X"}` | 必须重启 (~30s) | | 切交易对 | `ft.mjs set_pairs {"pairs":[...]}` | 不重启, `reload_config` 即可 | | 切实盘/模拟 | `ft.mjs set_dry_run {"dry_run":false}` | 必须重启 | | reload 配置