Skip to content

nofxai/nofx

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

🤖 NOFX - AI Trading System

AI-powered algorithmic trading system with multi-agent decision making.

✨ 本版本特点 (This Fork's Features)

🎯 专注于 AI 计算和决策的正确性,以提高胜率为第一目标

本版本在原项目基础上进行了深度优化,核心理念是通过改进 AI 的推理能力和决策质量来提升交易胜率。

⚠️ 风险提示 / Risk Warning

交易有风险,投资需谨慎。请注意资金安全!

本系统为 AI 自动交易工具,使用前请注意:

  • 📉 AI 交易可能导致资金损失,请充分了解风险
  • 💰 建议先用小额资金测试,不要投入无法承受损失的资金
  • 🛡️ 务必设置止损,合理控制仓位
  • 🔍 定期检查系统运行状态,及时发现异常

Trading involves risks. Please pay attention to fund safety!

This is an AI automated trading tool. Before use, please note:

  • 📉 AI trading may result in capital loss, understand the risks fully
  • 💰 Test with small amounts first, don't invest funds you can't afford to lose
  • 🛡️ Always set stop-loss, control position size reasonably
  • 🔍 Monitor system status regularly, detect anomalies timely

本分支专注于

  • 🎯 AI 计算和决策的正确性
  • 🐛 核心交易逻辑的 bug 修复
  • 📊 数据准确性(费用、P&L 等)
  • 🔄 系统稳定性(WebSocket、持久化等)
  • 🛠️ 系统易用性(工具优化、开发体验等)

This branch focuses on:

  • 🎯 AI calculation and decision accuracy
  • 🐛 Core trading logic bug fixes
  • 📊 Data accuracy (fees, P&L, etc.)
  • 🔄 System stability (WebSocket, persistence, etc.)
  • 🛠️ System usability (tool optimization, developer experience, etc.)

🔧 额外的 Bug 修复(个人维护版本)

此分支包含一些额外的 bug 修复和改进,主要供个人使用。包括但不限于:

  • 数据准确性修复(交易费用计算、P&L 统计等)
  • 系统稳定性改进(WebSocket 重连、数据持久化等)
  • AI 决策逻辑优化

这些修复已提交至官方仓库,部分仍在等待合并。如果你也遇到类似问题,欢迎使用此分支。

主要改进包括

  • 增强的 Prompt 工程: 优化 AI 输入提示词,提供更清晰的市场数据结构和决策框架
  • 改进的风险评估: 加强止损止盈逻辑,确保 AI 做出更理性的风险管理决策
  • 精细化的数据分析: 为 AI 提供更准确的技术指标和市场信号解读
  • 决策质量优先: 宁可少交易,也要确保每次决策的正确性和可靠性

🎯 Focus on AI Reasoning Accuracy to Maximize Win Rate

This fork is deeply optimized from the original project, with the core philosophy of improving trading win rate through enhanced AI reasoning and decision quality.

🔧 Additional Bug Fixes (Personal Maintenance Version)

This branch contains additional bug fixes and improvements, primarily for personal use. Including but not limited to:

  • Data accuracy fixes (trading fee calculation, P&L statistics, etc.)
  • System stability improvements (WebSocket reconnection, data persistence, etc.)
  • AI decision logic optimization

These fixes have been submitted to the official repository, some are still pending merge. If you encounter similar issues, feel free to use this branch.

Key improvements include:

  • Enhanced Prompt Engineering: Optimized AI input prompts with clearer market data structure and decision framework
  • Improved Risk Assessment: Strengthened stop-loss/take-profit logic for more rational risk management
  • Refined Data Analysis: Providing AI with more accurate technical indicators and market signal interpretation
  • Quality Over Quantity: Prioritizing decision accuracy over trading frequency

🔐 安全加固 (Security Hardening)

  • CORS 白名单、JWT 密钥校验、静态文件隔离、前端嵌入二进制

🚀 编译运行 (Build & Run)

前置要求 (Prerequisites)

一键编译 (One-Click Build)

# 克隆仓库
git clone https://github.com/nofxai/nofx.git
cd nofx

# 一键编译(前端 + 测试 + 后端)
./build.sh

# 准备配置并运行
cp config.json.example config.json
# 编辑 config.json,设置 jwt_secret(必须!)
./nofx

build.sh 选项:

./build.sh                    # 完整编译(前端 + 测试 + 后端)
./build.sh --skip-frontend    # 跳过前端编译(使用已有 web/dist)
./build.sh --skip-test        # 跳过测试
./build.sh --output nofx-arm  # 指定输出文件名
./build.sh --help             # 查看帮助

手动编译步骤 (Manual Build Steps)

# 1. 克隆仓库
git clone https://github.com/nofxai/nofx.git
cd nofx

# 2. 编译前端(会嵌入到二进制中)
cd web && npm install && npm run build && cd ..

# 3. 编译后端
go build -o nofx .

# 4. 准备配置文件
cp config.json.example config.json

# 5. 生成安全的 JWT 密钥(必须!否则无法启动)
openssl rand -base64 64
# 将生成的密钥复制到 config.json 的 jwt_secret 字段

# 6. 运行(prompts/ 目录已包含默认提示词)
./nofx

# 7. 访问 http://localhost:3000

Windows 部署 (Windows Deployment)

编译后只需以下文件即可运行:

nofx.exe           # 可执行文件(已内置前端)
config.json        # 配置文件(必须)
prompts/           # 提示词目录(必须)
  └── default.txt  # 默认提示词
secrets/           # 首次运行自动生成
decision_logs/     # 运行时自动创建
config.db          # 运行时自动创建

Docker 部署 (Docker Deployment)

docker compose up -d

配置说明 (Configuration)

config.json 关键配置项:

{
  "jwt_secret": "your-secure-random-secret-at-least-32-chars",
  "cors_allowed_origins": [
    "http://localhost:3000",
    "https://your-domain.com"
  ],
  "api_server_port": 3000
}

📚 Documentation


📬 Contact

  • Twitter: @xqliu
  • Telegram: @xqliu

📄 License

This project is licensed under AGPL-3.0. See LICENSE for details.

Original Project: NOFX by nofxai

Releases

No releases published

Packages

No packages published

Languages

  • Go 56.8%
  • TypeScript 38.2%
  • Shell 4.2%
  • Other 0.8%