auto_trade_sys/recommendations-viewer/README.md
2026-01-15 20:21:10 +08:00

80 lines
1.9 KiB
Markdown
Raw 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.

# 交易推荐查看器
一个独立的React前端应用用于查看实时交易推荐。
## 功能特点
- ✅ 实时查看交易推荐(基于当前行情数据)
- ✅ 每10秒自动刷新价格
- ✅ 支持按方向过滤(做多/做空)
- ✅ 显示详细的推荐信息(价格、止损、止盈、仓位、杠杆等)
- ✅ 显示技术指标详情
- ✅ 响应式设计,支持移动端
## 安装和运行
### 1. 安装依赖
```bash
cd recommendations-viewer
npm install
```
### 2. 配置API地址可选
如果需要修改API地址可以
- 在项目根目录创建 `.env` 文件:
```
VITE_API_URL=http://your-api-url.com
```
- 或者修改 `vite.config.js` 中的代理配置
### 3. 启动开发服务器
```bash
npm run dev
```
应用将在 `http://localhost:3001` 启动
### 4. 构建生产版本
```bash
npm run build
```
构建后的文件在 `dist` 目录中
## 项目结构
```
recommendations-viewer/
├── src/
│ ├── components/
│ │ ├── RecommendationsViewer.jsx # 主组件
│ │ └── RecommendationsViewer.css # 样式文件
│ ├── services/
│ │ └── api.js # API服务
│ ├── main.jsx # 应用入口
│ └── index.css # 全局样式
├── index.html # HTML模板
├── package.json # 项目配置
├── vite.config.js # Vite配置
└── README.md # 说明文档
```
## API接口
应用使用以下API接口
- `GET /api/recommendations?type=realtime&direction=BUY&limit=50&min_signal_strength=5`
- 获取实时推荐列表
## 注意事项
- 这是一个只读应用,不包含任何操作功能(如标记、执行、取消等)
- 推荐数据每10秒自动刷新确保价格信息实时更新
- 如果API服务不可用会显示错误信息