stock-monitor/README.md

76 lines
2.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 三层交易系统
## 架构概览
```
┌─────────────────────────────────────┐
│ 🧠 决策层 (Hermes Agent + 规则引擎) │
│ • 状态机管理:空仓/持仓/止盈/止损 │
│ • T+1逻辑注入买入日T0卖出日T+1 │
│ • 多条件共振:价格+量能+资金+情绪 │
└────────────┬────────────────────────┘
┌────────────▼────────────────────────┐
│ 🔄 执行层 (Hermes Workflow + 券商) │
│ • 触发器:价格/时间/事件驱动 │
│ • 执行器:条件单/限价单/市价单 │
│ • 兜底机制:券商原生止损单优先 │
└────────────┬────────────────────────┘
┌────────────▼────────────────────────┐
│ 📊 数据层 (AkShare / 券商API / 缓存)│
│ • 实时行情Tick级价格/量比/资金 │
│ • 持仓状态:成本/浮盈/持有天数 │
│ • 风控阈值:仓位/回撤/黑名单 │
└─────────────────────────────────────┘
```
## 快速开始
```bash
# 安装依赖
pip install -r requirements.txt
# 启动系统
python main.py
# 运行测试
pytest tests/
```
## 技术栈
- **Python 3.9+**
- **AkShare**: 实时行情数据
- **APScheduler**: 定时任务调度
- **Redis**: 数据缓存
- **Loguru**: 日志管理
## 核心功能
### 1. 数据层
- 实时行情获取
- 持仓状态管理
- 风控阈值监控
### 2. 决策层
- 状态机管理
- T+1交易逻辑
- 多条件策略引擎
### 3. 执行层
- 智能触发器
- 多种订单类型
- 风险兜底机制
## 配置说明
配置文件位于 `config/config.yaml`,包含:
- 券商API配置
- 风控参数设置
- 策略参数调整
- 日志和监控配置
## 许可证
MIT License