jh-quant 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. jh_quant-0.1.0/.gitignore +28 -0
  2. jh_quant-0.1.0/LICENCE +26 -0
  3. jh_quant-0.1.0/PKG-INFO +104 -0
  4. jh_quant-0.1.0/README.md +72 -0
  5. jh_quant-0.1.0/jh_quant/dashboard/front_src/bt-dash/assets/index-DC2GH4b3.js +78 -0
  6. jh_quant-0.1.0/jh_quant/dashboard/front_src/bt-dash/assets/index-zumHSaa-.css +1 -0
  7. jh_quant-0.1.0/jh_quant/dashboard/front_src/bt-dash/index.html +14 -0
  8. jh_quant-0.1.0/jh_quant/dashboard/front_src/bt-dash/vite.svg +1 -0
  9. jh_quant-0.1.0/jh_quant/dashboard/front_src/factors-dash/assets/index-DOEQobD6.js +88 -0
  10. jh_quant-0.1.0/jh_quant/dashboard/front_src/factors-dash/assets/index-EgJS1Ihp.css +1 -0
  11. jh_quant-0.1.0/jh_quant/dashboard/front_src/factors-dash/index.html +14 -0
  12. jh_quant-0.1.0/jh_quant/dashboard/front_src/factors-dash/vite.svg +4 -0
  13. jh_quant-0.1.0/jh_quant/dashboard/front_src/trading-dash/assets/AppTag-Bng-5w8B.js +1 -0
  14. jh_quant-0.1.0/jh_quant/dashboard/front_src/trading-dash/assets/AppTag-Bt9TJgTS.css +1 -0
  15. jh_quant-0.1.0/jh_quant/dashboard/front_src/trading-dash/assets/DiagnosticsView-Bqu2YF9D.js +1 -0
  16. jh_quant-0.1.0/jh_quant/dashboard/front_src/trading-dash/assets/PanelCard-C9FEAmTp.js +1 -0
  17. jh_quant-0.1.0/jh_quant/dashboard/front_src/trading-dash/assets/PanelCard-r8YPHa9-.css +1 -0
  18. jh_quant-0.1.0/jh_quant/dashboard/front_src/trading-dash/assets/SessionDetailView-CiJAQi81.css +1 -0
  19. jh_quant-0.1.0/jh_quant/dashboard/front_src/trading-dash/assets/SessionDetailView-CzkxEfxZ.js +5 -0
  20. jh_quant-0.1.0/jh_quant/dashboard/front_src/trading-dash/assets/SessionsView-BJbQn5aj.js +1 -0
  21. jh_quant-0.1.0/jh_quant/dashboard/front_src/trading-dash/assets/SessionsView-ELGjUuCR.css +1 -0
  22. jh_quant-0.1.0/jh_quant/dashboard/front_src/trading-dash/assets/SettingsView-DMrhYdyG.js +1 -0
  23. jh_quant-0.1.0/jh_quant/dashboard/front_src/trading-dash/assets/index-Bs_oSEnK.js +2 -0
  24. jh_quant-0.1.0/jh_quant/dashboard/front_src/trading-dash/assets/index-CIxGc-9T.css +1 -0
  25. jh_quant-0.1.0/jh_quant/dashboard/front_src/trading-dash/assets/validators-Dr-NpwZ9.js +1 -0
  26. jh_quant-0.1.0/jh_quant/dashboard/front_src/trading-dash/assets/vendor-echarts-Bn9PLWWT.js +60 -0
  27. jh_quant-0.1.0/jh_quant/dashboard/front_src/trading-dash/assets/vendor-element-plus-DPrPCYb3.js +63 -0
  28. jh_quant-0.1.0/jh_quant/dashboard/front_src/trading-dash/assets/vendor-vue-DUUfZ5e9.js +29 -0
  29. jh_quant-0.1.0/jh_quant/dashboard/front_src/trading-dash/favicon.ico +0 -0
  30. jh_quant-0.1.0/jh_quant/dashboard/front_src/trading-dash/index.html +16 -0
  31. jh_quant-0.1.0/jh_quant/dashboard/front_src/trading-dash/jh_logo_128x128.png +0 -0
  32. jh_quant-0.1.0/jh_quant/dashboard/front_src/trading-dash/vite.svg +1 -0
  33. jh_quant-0.1.0/jh_quant/dashboard/front_src/trading-dash/xueqiu_logo.png +0 -0
  34. jh_quant-0.1.0/pyproject.toml +44 -0
@@ -0,0 +1,28 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Virtual environments
10
+ .venv
11
+
12
+ CLAUDE.md
13
+
14
+ test.py
15
+ test_*
16
+
17
+ *.db
18
+
19
+ .claude
20
+ specs
21
+
22
+ *db-shm
23
+ *db-wal
24
+
25
+
26
+ .env
27
+
28
+ *.log
jh_quant-0.1.0/LICENCE ADDED
@@ -0,0 +1,26 @@
1
+ jh_quant - 量化交易研究平台
2
+ Copyright (C) 2026 jh_quant
3
+
4
+ 本程序是自由软件:您可以在自由软件基金会发布的 GNU Affero 通用公共许可证
5
+ (AGPL)第三版或(您可选的)任何更新版本的条款下重新分发和/或修改本程序。
6
+
7
+ 分发本程序的目的是希望它有用,但没有任何担保;甚至没有对适销性或特定用途
8
+ 适用性的暗示担保。更多详细信息请参见 GNU Affero 通用公共许可证。
9
+
10
+ 您应该已随本程序收到 GNU Affero 通用公共许可证的副本。如果没有,
11
+ 请参见 <https://www.gnu.org/licenses/agpl-3.0.html>。
12
+
13
+ -----------------------------------------------------------------------
14
+
15
+ This program is free software: you can redistribute it and/or modify
16
+ it under the terms of the GNU Affero General Public License as published
17
+ by the Free Software Foundation, either version 3 of the License, or
18
+ (at your option) any later version.
19
+
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU Affero General Public License for more details.
24
+
25
+ You should have received a copy of the GNU Affero General Public License
26
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
@@ -0,0 +1,104 @@
1
+ Metadata-Version: 2.4
2
+ Name: jh-quant
3
+ Version: 0.1.0
4
+ Summary: Add your description here
5
+ License-File: LICENCE
6
+ Requires-Python: >=3.10
7
+ Requires-Dist: croniter>=1.4.0
8
+ Requires-Dist: dotenv>=0.9.9
9
+ Requires-Dist: duckdb>=1.4.4
10
+ Requires-Dist: fastapi-mcp>=0.4.0
11
+ Requires-Dist: fastapi>=0.116.1
12
+ Requires-Dist: httpx>=0.28.1
13
+ Requires-Dist: ipywidgets>=8.1.8
14
+ Requires-Dist: jinja2>=3.1.6
15
+ Requires-Dist: joblib>=1.4.0
16
+ Requires-Dist: jupyterlab>=4.5.6
17
+ Requires-Dist: matplotlib>=3.10.8
18
+ Requires-Dist: notebook>=7.5.5
19
+ Requires-Dist: pandas>=2.3.3
20
+ Requires-Dist: polars>=1.0.0
21
+ Requires-Dist: psycopg[binary]>=3.2.9
22
+ Requires-Dist: pyarrow>=23.0.1
23
+ Requires-Dist: pydantic>=2.13.3
24
+ Requires-Dist: pywebview>=6.1
25
+ Requires-Dist: quantstats>=0.0.81
26
+ Requires-Dist: rich>=14.3.2
27
+ Requires-Dist: riskfolio-lib>=7.0.1
28
+ Requires-Dist: scipy>=1.15.3
29
+ Requires-Dist: tortoise-orm>=0.25.1
30
+ Requires-Dist: uvicorn>=0.35.0
31
+ Description-Content-Type: text/markdown
32
+
33
+ # JH_QUANT
34
+
35
+ ![banner](assets/banner_sm.png)
36
+ 量化交易研究与执行平台。支持:**免费数据获取**、**回测**、**因子计算**、 **模拟交易**、**组合优化**、**可视化仪表盘**
37
+
38
+ - **官网**: https://jiuhuang.xyz
39
+ - **文档**: https://doc.jiuhuang.xyz
40
+
41
+ ## 模块
42
+
43
+ | 模块 | 说明 | 文档 |
44
+ | ------------------------------ | ---------------------------------------------------- | --------------------------------- |
45
+ | [data](docs/data.md) | 多种数据获取,兼容akshare和tushare数据类型及调用风格 | [README](docs/data/index.md) |
46
+ | [trading](docs/trading.md) | 交易运行层,模拟(实时)交易与会话编排 | [README](docs/trading/index.md) |
47
+ | [backtest](docs/backtest.md) | 回测引擎,快速策略验证,多种内置策略 | [README](docs/backtest/index.md) |
48
+ | [factors](docs/factors.md) | 因子计算,内置多种因子模型 | [README](docs/factors/index.md) |
49
+ | [dashboard](docs/dashboard.md) | PyWebView可视化仪表盘 | [README](docs/dashboard/index.md) |
50
+
51
+ ## 快速开始
52
+
53
+ ### 安装
54
+
55
+ ```bash
56
+ pip install jh_quant
57
+ ```
58
+
59
+ ### 数据获取
60
+
61
+ ```python
62
+ import os
63
+ from jh_quant.data import JHData, DataTypes
64
+
65
+ load_dotenv() # 读取.env文件, 必须设置JIUHUANG_API_KEY变量
66
+
67
+ jh = JHData(apt_key=os.getenv("JIUHUANG_API_KEY"))
68
+ stock_price = jh.get_data(
69
+ DataTypes.AK_STOCK_ZH_A_HIST_QFQ, #akshare日线前复盘数据
70
+ symbol="000001",
71
+ start="2025-01-01",
72
+ end="2025-12-10",
73
+ )
74
+ ```
75
+
76
+ **重要**
77
+
78
+ > `jh_quant` 的数据获取**并非**像 [akshare](https://github.com/akfamily/akshare) 那样需要实时抓取数据。
79
+ > `jh_quant` 仅做了对 [akshare](https://github.com/akfamily/akshare) 数据类型的兼容,数据真实来源为:[JiuHuang API](https://jiuhuang.xyz)
80
+
81
+ ### 实时模拟交易
82
+
83
+ **jh_quant**支持同时开启多个模拟交易会话,每个会话对应一个模拟账户, 下面是示例运行:
84
+
85
+ ```bash
86
+ python run_paper.py
87
+ ```
88
+ *run_paper.py*的完整代码参考本repo根目录的[run_paper.py](./run_paper.py)
89
+
90
+ 在回填模式下(可以通过`enable_backfill=False`关闭),会完成历史交易模拟,并在本地开启服务
91
+
92
+ **开启控制台仪表盘**
93
+ 开启本地服务之后, 可以通过如下代码开启控制台仪表盘
94
+ ```python
95
+ from jh_quant.dashboard import display_trading
96
+
97
+ display_trading()
98
+ ```
99
+
100
+ ![dashboard](assets/screenshots/gateway_sessions_sm.png)
101
+
102
+ ## License
103
+
104
+ This project is licensed under the AGPL-3.0 License - see the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,72 @@
1
+ # JH_QUANT
2
+
3
+ ![banner](assets/banner_sm.png)
4
+ 量化交易研究与执行平台。支持:**免费数据获取**、**回测**、**因子计算**、 **模拟交易**、**组合优化**、**可视化仪表盘**
5
+
6
+ - **官网**: https://jiuhuang.xyz
7
+ - **文档**: https://doc.jiuhuang.xyz
8
+
9
+ ## 模块
10
+
11
+ | 模块 | 说明 | 文档 |
12
+ | ------------------------------ | ---------------------------------------------------- | --------------------------------- |
13
+ | [data](docs/data.md) | 多种数据获取,兼容akshare和tushare数据类型及调用风格 | [README](docs/data/index.md) |
14
+ | [trading](docs/trading.md) | 交易运行层,模拟(实时)交易与会话编排 | [README](docs/trading/index.md) |
15
+ | [backtest](docs/backtest.md) | 回测引擎,快速策略验证,多种内置策略 | [README](docs/backtest/index.md) |
16
+ | [factors](docs/factors.md) | 因子计算,内置多种因子模型 | [README](docs/factors/index.md) |
17
+ | [dashboard](docs/dashboard.md) | PyWebView可视化仪表盘 | [README](docs/dashboard/index.md) |
18
+
19
+ ## 快速开始
20
+
21
+ ### 安装
22
+
23
+ ```bash
24
+ pip install jh_quant
25
+ ```
26
+
27
+ ### 数据获取
28
+
29
+ ```python
30
+ import os
31
+ from jh_quant.data import JHData, DataTypes
32
+
33
+ load_dotenv() # 读取.env文件, 必须设置JIUHUANG_API_KEY变量
34
+
35
+ jh = JHData(apt_key=os.getenv("JIUHUANG_API_KEY"))
36
+ stock_price = jh.get_data(
37
+ DataTypes.AK_STOCK_ZH_A_HIST_QFQ, #akshare日线前复盘数据
38
+ symbol="000001",
39
+ start="2025-01-01",
40
+ end="2025-12-10",
41
+ )
42
+ ```
43
+
44
+ **重要**
45
+
46
+ > `jh_quant` 的数据获取**并非**像 [akshare](https://github.com/akfamily/akshare) 那样需要实时抓取数据。
47
+ > `jh_quant` 仅做了对 [akshare](https://github.com/akfamily/akshare) 数据类型的兼容,数据真实来源为:[JiuHuang API](https://jiuhuang.xyz)
48
+
49
+ ### 实时模拟交易
50
+
51
+ **jh_quant**支持同时开启多个模拟交易会话,每个会话对应一个模拟账户, 下面是示例运行:
52
+
53
+ ```bash
54
+ python run_paper.py
55
+ ```
56
+ *run_paper.py*的完整代码参考本repo根目录的[run_paper.py](./run_paper.py)
57
+
58
+ 在回填模式下(可以通过`enable_backfill=False`关闭),会完成历史交易模拟,并在本地开启服务
59
+
60
+ **开启控制台仪表盘**
61
+ 开启本地服务之后, 可以通过如下代码开启控制台仪表盘
62
+ ```python
63
+ from jh_quant.dashboard import display_trading
64
+
65
+ display_trading()
66
+ ```
67
+
68
+ ![dashboard](assets/screenshots/gateway_sessions_sm.png)
69
+
70
+ ## License
71
+
72
+ This project is licensed under the AGPL-3.0 License - see the [LICENSE](LICENSE) file for details.