Files
Grid_Trading/README.md
2026-07-08 17:34:29 +08:00

47 lines
1.1 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.

# Grid Trading
本项目是一个本地运行的 Python GUI 网格交易管理工具,第一阶段聚焦 A股/ETF 的账户、标的、手工成交、持仓成本、网格收益和回本价计算。
## 第一阶段功能
- 创建/编辑本地账户和初始资金。
- 添加 A股/ETF 标的,维护交易单位和手动估值价格。
- 配置默认网格策略模板。
- 手动录入、编辑、删除买入/卖出成交。
- 自动计算持仓数量、T+1 可用数量、持仓成本、已实现盈亏、累计网格利润、持仓回本价、账户回本价。
- 使用 SQLite 本地保存数据,默认路径为 `data/grid_trading.db`
## 开发环境
```powershell
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -e ".[dev]"
pytest
```
## 启动
```powershell
python -m grid_trading.app
```
也可以指定数据库路径:
```powershell
python -m grid_trading.app --db data/dev.db
```
## 验证
```powershell
pytest -v
python -m grid_trading.app --help
```
如果只想确认 GUI 能构造起来,不打开真实窗口,可以运行测试里的 offscreen smoke
```powershell
pytest tests/test_ui.py -v
```