独立自治交易

独立 AI 全托管控制台

这里只看独立自治系统自己的状态、持仓、保护、动作时间线,不混入旧系统的策略工作台。
{{ runtime.healthy ? '运行健康' : '待确认' }} 阶段 {{ runtime.snapshot?.state_title || '-' }} 动作 {{ formatRuntimeAction(runtime.snapshot?.current_action) }} 目标 {{ runtime.snapshot?.active_inst_id || '-' }} 心跳 {{ runtime.heartbeat_age_seconds != null ? runtime.heartbeat_age_seconds + ' 秒前' : '-' }}
今日净值 {{ formatAmount(status.today_pnl?.display_net, '0.00') }}
当前阶段
{{ runtime.snapshot?.state_title || '-' }}
{{ runtime.snapshot?.state_reason || '-' }}
当前动作
{{ formatRuntimeAction(runtime.snapshot?.current_action) }}
下一步:{{ formatRuntimeHint(runtime.snapshot?.next_action_hint) }}
自治持仓
{{ runtime.open_positions_count ?? 0 }}
待处理事件 {{ (runtime.snapshot?.queued_events || []).length }} / 任务 {{ (runtime.tasks || []).length }}
账户摘要
{{ formatAmount(accountTotalEquity, '0.00') }}
可用权益 {{ formatAmount(accountAvailEquity, '0.00') }}

🤖 模型配置

配置本地 AI Gateway 连接,替代 OpenClaw 提供模型调用服务。支持为主备模型分别配置不同的网关地址和密钥。

主模型地址 (Primary URL)
备用模型地址 (Fallback URL)
主模型 API Key
备用模型 API Key
主模型名称 (Primary Model)
系统首选调用的核心模型
备用模型名称 (Fallback Model)
主模型失效时的备选模型
📡 当前配置状态
主模型:{{ aiGatewayConfig.primary_model || '-' }} (✅ 连通: {{ aiGatewayStatus.primary_latency }}ms) (❌ 失败: {{ aiGatewayStatus.primary_error }})
备用模型:{{ aiGatewayConfig.fallback_model || '-' }} (✅ 连通: {{ aiGatewayStatus.fallback_latency }}ms) (❌ 失败: {{ aiGatewayStatus.fallback_error }})
正在向网关发送测试请求,请稍候...
配置来源:手动指定 Local AI Gateway

📊 今日 AI 调用统计

主模型 ({{ aiGatewayConfig.primary_model || '未配置' }})
{{ status.ai_stats?.primary?.calls || 0 }} 次
成功: {{ status.ai_stats?.primary?.success || 0 }} | 失败: {{ status.ai_stats?.primary?.failures || 0 }} | 成功率: {{ ((status.ai_stats?.primary?.success || 0) / Math.max(status.ai_stats?.primary?.calls || 1, 1) * 100).toFixed(1) }}%
备用模型 ({{ aiGatewayConfig.fallback_model || '未配置' }})
{{ status.ai_stats?.fallback?.calls || 0 }} 次
成功: {{ status.ai_stats?.fallback?.success || 0 }} | 失败: {{ status.ai_stats?.fallback?.failures || 0 }} | 成功率: {{ ((status.ai_stats?.fallback?.success || 0) / Math.max(status.ai_stats?.fallback?.calls || 1, 1) * 100).toFixed(1) }}%

📡 量化情报雷达 (Radar)

雷达已暂停。
大盘趋势 (BTC 15m)
{{ (status.radar && status.radar.btc_trend) ? status.radar.btc_trend : '等待雷达...' }}
更新时间
{{ (status.radar && status.radar.last_update) ? new Date(status.radar.last_update * 1000).toLocaleTimeString() : '等待雷达...' }}
状态
✅ 在线

猎犬追踪榜单 (Top Coins)

标的资金费率盘口
{{ inst }}{{ (rate * 100).toFixed(4) }}% 强买盘 (Buy Wall) 强抛压 (Sell Wall) 势均力敌 (Balanced)

🛠️ AI 运维监工 (Watchdog)

监工已暂停。
监工状态
{{ status.watchdog && status.watchdog.status === 'alert' ? '🚨 异常' : '✅ 正常' }}
巡检时间
{{ (status.watchdog && status.watchdog.last_check) ? new Date(status.watchdog.last_check * 1000).toLocaleTimeString() : '等待...' }}

近期诊断

[{{ new Date(log.time * 1000).toLocaleTimeString() }}] {{ log.error }}
建议:{{ log.diagnosis }}

自治运行摘要

从 `autonomous_trader.db` 读取运行态快照和长期记忆,方便判断 AI 现在在做什么、为什么这么做。

运行时
最近计划:{{ formatRuntimePlan(runtime.snapshot?.memory_summary?.last_plan) }}
活动目标:{{ runtime.snapshot?.active_inst_id || '-' }}
公共行情:{{ runtime.public_feed?.event?.inst_id || '-' }} / {{ formatAmount(runtime.public_feed?.event?.price) }}
更新时间:{{ formatTime(runtime.snapshot?.heartbeat_ts) }}
长期记忆
时间线条数:{{ (runtime.memory?.timeline || []).length }}
活跃目标:{{ formatRuntimeObjective(runtime.memory?.active_objective) }}
最近计划时间:{{ formatTime(runtime.snapshot?.memory_summary?.last_plan?.ts) }}
保护计划
{{ instId }}
仓位占用 {{ Math.round((plan.capital_ratio || 0) * 100) }}% / 止损 {{ formatPercent(plan.sl_pct) }} / 移盈 {{ formatPercent(plan.trailing_pct) }}
保护激活 {{ formatPercent(plan.trail_activation_pct) }} / 计划数量 {{ formatAmount(plan.qty) }}
暂无保护计划

当前持仓

这是自治账号当前的真实仓位,不依赖旧系统页面。

标的 方向 数量 开仓均价 未实现盈亏
{{ item.instId }} {{ formatPositionSide(item.posSide) }} {{ formatAmount(item.pos) }} {{ formatAmount(item.avgPx) }} {{ formatAmount(item.upl) }}
当前无自治持仓

保护挂单

直接读取自治账号当前在交易所存活的保护单。

标的 类型 状态 触发 / 激活价
{{ item.instId || '-' }} {{ formatAlgoType(item.ordType) }} {{ formatAlgoState(item.state) }} {{ formatAlgoPrice(item) }}
当前无自治保护挂单

自治任务

这是控制器在内部维持的运行任务,不和旧系统任务列表混用。

{{ item.title || '-' }}
状态 {{ formatTaskStatus(item.status) }} · 标的 {{ item.inst_id || '-' }}
{{ item.detail || '-' }}
{{ formatTime(item.updated_ts) }}
暂无自治任务

最近自治事件

按时间线看 AI 最近在计划什么、执行了什么、为什么切冷却或重挂保护。

{{ formatRuntimeEvent(item) }}
{{ formatRuntimeDetail(item) }}
{{ formatTime(item.ts) }}
暂无自治事件

最近订单

时间 标的 方向 数量 状态
{{ formatTime(item.ts) }} {{ item.inst_id || '-' }} {{ formatOrderSide(item.side) }} {{ formatAmount(item.qty) }} {{ formatOrderStatus(item.status) }}
暂无自治订单记录

最近告警

{{ formatAlertLevel(item.level) }} · {{ formatAlertCategory(item.category) }}
{{ item.message || '-' }}
{{ formatTime(item.ts) }}
暂无自治告警