codex strategy · scoring rules
Codex 计分规则
当前规则来自 score-strategy-candidates.ts,用于生成 strong / observe 两档正式候选;40+ 只用于页面排查。
0. 输入数据与运行节奏
strategy-score 每小时 :05 / :35 生成扫描结果
| 数据 | 频率 | 用途 |
|---|---|---|
| market_snapshots | 每小时 :02 / :32 | 原始行情、盘口、成交量、funding、24h 波动 |
| cross_exchange_features | 跟随 market | 跨所 gap、exec gap、量比、rolling 1/2/4h 涨幅 |
| binance-24h-gainers | 每 10 分钟 | Binance 涨幅榜;入榜币可绕过 1/2/4h 全正、2h>0.5%、4h>0.8% 硬过滤 |
| coin_opportunity_samples | 每小时 :05 | 历史 future 1h PnL 标签,用于提炼 rule_fit_score |
| strategy_deltas | 每 5 分钟 | 真实策略 PnL delta,用于样本参考 |
`strategy-score` 使用最新一轮 cross features 评分;auto-ops 每 5 分钟检查加仓,并在 :07 / :37 使用最新评分处理新币入池。
A. 总分公式
候选币最终 score
分数 clamp 到 0-100。future 1h PnL 是历史标签,用来总结规则适配形态;当前币不需要有历史 PnL 才能进入强推,历史 PnL 也不参与总分。 当前 1/2/4h 动量来自 codex-data market 快照中最接近 now-Nh 的 Binance last_price。
当前 gap、exec gap、量比、spread、波动率是否像历史赚钱形态
Binance 1h / 2h / 4h 涨幅和连续上涨结构
双边成交量、盘口成本、波动和资金费风险
B. 分层门槛
先过滤,再按 strong / observe 收集;40+ 仅调试显示
C. rule_fit_score(权重 30%)
历史 future 1h PnL 标签总结出的赚钱形态匹配度
| 指标 | 甜点区 | 分 | 说明 |
|---|---|---|---|
| abs_gap_bps | 20 - 100 bps | 20 | Gate 价差甜点区 |
| executable_gap_bps | 8 - 30 bps | 25 | 可成交价差越大越好 |
| vol_ratio | 3% - 25% | 20 | Gate / Binance 量比适配 |
| main_vol_24h | 10M - 300M | 10 | 主腿成交量 |
| main_volatility_24h | 0.2 - 1.2 | 10 | 主腿波动足够但不过热 |
| spread cost | 越窄越好 | 15 | main spread 8-60 / hedge spread 5-40 线性扣分 |
| 指标 | 甜点区 | 分 | 说明 |
|---|---|---|---|
| abs_gap_bps | 6 - 18 bps | 20 | KuCoin 小价差更稳,但过滤过小偏离 |
| executable_gap_bps | 3 - 14 bps | 25 | 可成交价差不能过大也不能为负太多 |
| vol_ratio | 5% - 12% | 20 | KuCoin / Binance 量比适配 |
| main_vol_24h | 5M - 100M | 10 | 主腿成交量 |
| main_volatility_24h | 0.10 - 0.40 | 10 | 稳定波动区 |
| spread cost | 越窄越好 | 15 | main spread 2-10 / hedge spread 1.5-6 线性扣分 |
D. bn_momentum_score(权重 50%)
Binance 1h / 2h / 4h 涨幅和连续上涨结构
| 指标 | 计分区间 | 权重分 |
|---|---|---|
| Binance 1h 涨幅 | 0.2% -> 4% 线性加分 | 25 |
| Binance 2h 涨幅 | 0.5% -> 8% 线性加分 | 30 |
| Binance 4h 涨幅 | 1% -> 15% 线性加分 | 25 |
| Binance 连续上涨 | 现价 > now-1h 参考价 > now-2h 参考价 > now-4h 参考价 | 20 |
由 market 快照计算当前 Binance futures last_price 相对最接近 now-1h / now-2h / now-4h 的涨幅。
Binance 24h 涨幅榜内币种只绕过 1/2/4h 全正、2h>0.5%、4h>0.8% 动量硬过滤;spread、盘口成本、成交量等严重风险仍然拦截。
现价 > 1h 参考价 > 2h 参考价 > 4h 参考价会给 20 分,但不是必须条件。
E. current_market_score(权重 20%)
当前盘口与交易环境是否健康
| 指标 | 计分区间 | 权重分 |
|---|---|---|
| 主所成交量 | 1M -> 300M 线性加分 | 25 |
| Binance 成交量 | 30M -> 3B 线性加分 | 25 |
| 盘口成本 | main spread 5-40 / hedge spread 3-30,越窄越好 | 25 |
| 主腿波动 | 0.08 -> 1.2 线性加分 | 15 |
| 资金费差 | |funding_diff| 越小越好,0.3%-2% 线性扣分 | 10 |
F. 输出与调参入口
生成文件和常见参数
- · 输出文件:
codex-data/data/state/codex-strategy-candidates.json - · 扫描脚本:
npm run codex-data:strategy-score,默认每小时 :05 / :35 跑两次。 - · 默认每档上限:strong 8、observe 16、40+ 50;可用
CODEX_DATA_STRATEGY_*_LIMIT调整。 - · 历史快照:保留 48h,用于页面切换和对比过去的 Codex 扫描结果。