Building an FVG Trading Bot for OKX with Rejection Logic and AI Agents
说明与用途
作者为OKX构建了FVG Killer交易机器人,采用公允价值缺口策略。其核心特点包括严格的信号过滤(拒绝99%的噪音)、基于凯利公式的风险管理以及六个AI代理的共识机制。该项目包含强大的工程保障措施,如单元测试和断路器。
问题
Manual crypto futures trading is prone to emotional errors, missed entries, and catastrophic liquidations due to poor risk management and signal noise.
结果
The bot successfully filters out 99% of noisy signals using strict gates. It implements a risk management system that survives edge decay better than fixed sizing, supported by 197 unit tests and AI agent consensus.
工作流
- Clone the repository and install dependencies.
- Configure OKX API keys in config.json.
- Run the bot in paper/dry-run mode to validate logic without real funds.
- Bot scans top 100 contracts for Fair Value Gaps (3-sigma move, 5x volume).
- Apply five rejection gates: Freshness, ATR grade, Direction, Depth, and Liquidity.
- Six AI analyst agents debate the signal and reach a consensus.
- Calculate position size using rolling fractional Kelly criterion.
- Execute trade with circuit breakers and atomic state writes.
- Monitor performance and auto-withdraw profits on-chain.
证据
A naive detector spits out dozens of signals a day and 99% of them are garbage.
Rolling Kelly median drawdown 83.1%, fixed 30% sizing wipes out 100% of accounts
- 记录日期: 2026-09-05T12:48:57.964Z