Skip to main content

一个功能完整的福纹量化交易系统,支持多交易所连接、策略回测与实盘交易

Project description

FWQuant

一个从 0 到 1 完全自建的量化交易平台。

📋 项目概述:FWQuant 是一款企业级量化交易系统,支持 CTP 期货网关和 OKX 数字资产交易,提供策略开发、回测验证、实盘交易、风险管理的完整链路。采用事件驱动架构,内置多种经典策略模板,支持单/多策略并行回测,具备完善的风控体系。

fuwen

快速开始

脚本安装(带全套环境,PYTHON,UV,PIP,NPM,NODE,FWQUANT,OKX_SKILLS,OPENCLAW 等等):

ubuntu 安装

curl -fsSL https://www.yaluo.com/install/fwquant/install/fw_install.sh | tr -d '\r'  | bash -s 
其它安装

windows 安装

powershell -c "irm https://www.yaluo.com/install/fwquant/install/fw_install.ps1 | iex"
手动启动命令(脚本安装后自动启动,此为手动重启/调试参考)

独立包安装(仅fwquant):

uv pip install fwquant -U
清华镜像
uv pip install fwquant -U -i https://pypi.tuna.tsinghua.edu.cn/simple/ 

启动服务

ubuntu 启动服务
nohup fwquant web run &
windows 启动服务
start /b fwquant web run >web.log 2>&1

⚡ 核心功能

模块类别 核心能力 说明
交易网关 CTP / OKX 支持期货、数字资产实盘交易
策略引擎 CTA策略框架 内置6+经典策略模板
回测系统 单/多策略并行 支持历史数据回测验证
风险管理 实时风控引擎 仓位/止损/熔断管理
数据管理 REST/WebSocket 实时行情与历史数据

📖 文档入口

类别 文档名称 路径
用户指南 📦 安装指南 docs/用户安装.md
🚀 运行服务 docs/运行服务.md
💡 帮助文档 docs/help.md
程序开发 📦 上传打包 docs/上传打包_pypi.md
📝 开发日志 docs/开发日志.md
📚 模块文档 docs/module_docs/
综合运维 🔧 运维手册 docs/运维手册.md

📦 内置策略(点击展开)
  • 趋势策略: Dual Thrust、Double MA、King Keltner
  • 震荡策略: ATR-RSI、Boll Channel
  • 组合策略: 七福策略(多规则融合)
🛠️ 技术架构(点击展开)

核心语言与基础框架

  • 语言: Python 3.12+
  • Web框架: FastAPI、Flask、Django
  • GUI框架: PySide6、PyQt5、pyqtgraph
  • 异步引擎: Asyncio、aiohttp

数据与计算核心

  • 数据处理: Pandas、NumPy、Numba
  • 量化分析: TA-Lib、QuantStats、backtrader
  • AI/机器学习: PyTorch、LightGBM、DEAP

交易网关

  • 数字资产: OKX API、ccxt、composio_crewai
  • 期货: CTP、TQSDK
  • 证券: Futu API、TuShare、AKShare

数据库与存储

  • 关系型: SQLite、SQLAlchemy、aiosqlite
  • 缓存: Redis
  • 文档存储: YAML、TOML

任务调度与队列

  • 任务队列: Celery、django-celery-beat
  • 定时任务: APScheduler、django-crontab

可视化与界面

  • 图表: Matplotlib、Plotly、Seaborn
  • 样式: qdarkstyle、QtPy

AI智能体与LLM

  • 智能体框架: CrewAI、OpenClaw、Agents
  • LLM集成: LangChain、LiteLLM、langchain-openai

开发环境与工具

  • IDE: PyCharm
  • 包管理: Conda、pip、uv
  • 前端工具: npm、Node.js
  • 日志: Loguru
  • 配置: python-dotenv、PyYAML
  • 测试: pytest、pytest-html
  • 代码规范: Black、Flake8、isort、mypy

版本控制与分发

  • 版本控制: Git、GitHub
  • 包分发: PyPI

操作系统支持

  • Windows: Windows 10/11
  • Linux: Ubuntu、Debian
📚 参考工具(点击展开)
  • VN.PY: 量化交易框架设计灵感来源
  • backtrader: 量化回测框架参考
  • crewAI: AI 智能体协作框架
  • LangChain: 大语言模型应用框架
  • ccxt: 交易网关库

工具库
python fw_tools/tools_menu.py

查看当前端口服务:

lsof -i:15881    

netstat -ano | findstr :15881

tasklist | findstr 15881

taskkill /F /PID 15881
开发小资料

开发源码,下载与环境安装

清华镜像 PYPI: https://pypi.tuna.tsinghua.edu.cn/simple/ #设置永久镜像ubuntu

符号连接(win,cmd,选择 命令提示符,右键选择管理员): cmd /c mklink /D "D:\git\github\fwquant\fwquant.fwquant" "%USERPROFILE%.fwquant"

cmd /c mklink /D "D:\git\github\fwquant\fwquant.openclaw" "%USERPROFILE%.openclaw"

cmd /c mklink /D "D:\git\github\fwquant\fwquant.marscode" "%USERPROFILE%.marscode"

cmd /c mklink /D "D:\git\github\fwquant\fwquant.agents" "%USERPROFILE%.agents"

cmd /c mklink /D "D:\git\github\fwquant\fwquant.okx" "%USERPROFILE%.okx"

cmd /c mklink "D:\git\github\fwquant\fwquant\开发日志.md" "D:\git\github\fwquant\fwquant\fw_config\fwquant_defaults\docs\开发日志.md"

硬拉取代码:

git reset --hard origin/develop && git pull

卸载:

ubuntu 卸载

curl -fsSL https://www.yaluo.com/install/fwquant/install/fw_uninstall.sh | tr -d '\r' | bash -s -- -f
其它卸载 windows 卸载
powershell -c "irm https://www.yaluo.com/install/fwquant/install/fw_uninstall.ps1 | iex"

致谢:感谢 VN.PY、backtrader、crewAI、LangChain 及所有开源社区的贡献!

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fwquant-1.0.124.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fwquant-1.0.124-py3-none-any.whl (1.5 MB view details)

Uploaded Python 3

File details

Details for the file fwquant-1.0.124.tar.gz.

File metadata

  • Download URL: fwquant-1.0.124.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for fwquant-1.0.124.tar.gz
Algorithm Hash digest
SHA256 d206b193597cdc0c0bf60bf978f981f07ae9b3a452e3e1c0588a6198cb9035ca
MD5 ee51f2e89fdf6ccc4565c22846639b4c
BLAKE2b-256 9bb1fd944a532113097c557eb50068e800321c55b7d4c26f49c7672f2a1130e1

See more details on using hashes here.

File details

Details for the file fwquant-1.0.124-py3-none-any.whl.

File metadata

  • Download URL: fwquant-1.0.124-py3-none-any.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for fwquant-1.0.124-py3-none-any.whl
Algorithm Hash digest
SHA256 6eee744049df9176541ad7282c616f9db0657cf45a10ff5763b9ed23ff346df9
MD5 916369979735f31143b176a568bc9427
BLAKE2b-256 cfb9ba0dbf65415cfd6fbee2e055ac45e372daf05e11fc9895de265608cb03a0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page