hikyuu 2.6.6__py3-none-win_amd64.whl → 2.6.8__py3-none-win_amd64.whl

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 (175) hide show
  1. hikyuu/__init__.py +16 -2
  2. hikyuu/__init__.pyi +658 -627
  3. hikyuu/analysis/__init__.pyi +563 -519
  4. hikyuu/analysis/analysis.pyi +583 -541
  5. hikyuu/core.pyi +565 -521
  6. hikyuu/cpp/__init__.pyi +2 -2
  7. hikyuu/cpp/concrt140.dll +0 -0
  8. hikyuu/cpp/core310.pyd +0 -0
  9. hikyuu/cpp/core310.pyi +1424 -865
  10. hikyuu/cpp/core311.pyd +0 -0
  11. hikyuu/cpp/core311.pyi +1424 -865
  12. hikyuu/cpp/core312.pyd +0 -0
  13. hikyuu/cpp/core312.pyi +1424 -865
  14. hikyuu/cpp/core313.pyd +0 -0
  15. hikyuu/cpp/core313.pyi +1424 -863
  16. hikyuu/cpp/core39.pyd +0 -0
  17. hikyuu/cpp/core39.pyi +1424 -865
  18. hikyuu/cpp/hikyuu.dll +0 -0
  19. hikyuu/cpp/hikyuu.lib +0 -0
  20. hikyuu/cpp/hku_hdf5.dll +0 -0
  21. hikyuu/cpp/hku_hdf5_cpp.dll +0 -0
  22. hikyuu/cpp/hku_hdf5_hl.dll +0 -0
  23. hikyuu/cpp/hku_hdf5_hl_cpp.dll +0 -0
  24. hikyuu/cpp/i18n/zh_CN/__init__.py +0 -0
  25. hikyuu/cpp/i18n/zh_CN/hikyuu.mo +0 -0
  26. hikyuu/cpp/msvcp140.dll +0 -0
  27. hikyuu/cpp/msvcp140_1.dll +0 -0
  28. hikyuu/cpp/msvcp140_2.dll +0 -0
  29. hikyuu/cpp/msvcp140_atomic_wait.dll +0 -0
  30. hikyuu/cpp/msvcp140_codecvt_ids.dll +0 -0
  31. hikyuu/cpp/sqlite3.dll +0 -0
  32. hikyuu/cpp/vcruntime140.dll +0 -0
  33. hikyuu/cpp/vcruntime140_1.dll +0 -0
  34. hikyuu/data/common_clickhouse.py +0 -47
  35. hikyuu/data/tdx_to_h5.py +1 -1
  36. hikyuu/draw/drawplot/__init__.pyi +32 -37
  37. hikyuu/draw/drawplot/bokeh_draw.pyi +651 -632
  38. hikyuu/draw/drawplot/common.pyi +3 -4
  39. hikyuu/draw/drawplot/echarts_draw.py +9 -8
  40. hikyuu/draw/drawplot/echarts_draw.pyi +598 -567
  41. hikyuu/draw/drawplot/matplotlib_draw.py +3 -3
  42. hikyuu/draw/drawplot/matplotlib_draw.pyi +872 -874
  43. hikyuu/draw/elder.pyi +19 -20
  44. hikyuu/draw/kaufman.py +1 -1
  45. hikyuu/draw/kaufman.pyi +18 -18
  46. hikyuu/draw/volume.pyi +10 -10
  47. hikyuu/examples/notebook/000-Index.ipynb +1 -1
  48. hikyuu/examples/notebook/001-overview.ipynb +78 -63
  49. hikyuu/examples/notebook/002-HowToGetStock.ipynb +259 -40
  50. hikyuu/examples/notebook/003-HowToGetKDataAndDraw.ipynb +49 -41
  51. hikyuu/examples/notebook/004-IndicatorOverview.ipynb +29 -29
  52. hikyuu/examples/notebook/005-Drawplot.ipynb +66 -37
  53. hikyuu/examples/notebook/006-TradeManager.ipynb +808 -61
  54. hikyuu/examples/notebook/007-SystemDetails.ipynb +23 -23
  55. hikyuu/examples/notebook/009-RealData.ipynb +3 -3
  56. hikyuu/examples/notebook/010-Portfolio.ipynb +761 -122
  57. hikyuu/extend.py +32 -98
  58. hikyuu/extend.pyi +597 -593
  59. hikyuu/gui/HikyuuTDX.py +2 -4
  60. hikyuu/gui/data/MainWindow.py +185 -174
  61. hikyuu/hub.pyi +69 -67
  62. hikyuu/include/hikyuu/DataType.h +3 -12
  63. hikyuu/include/hikyuu/KData.h +83 -25
  64. hikyuu/include/hikyuu/KDataImp.h +31 -46
  65. hikyuu/include/hikyuu/KDataPrivatedBufferImp.h +73 -0
  66. hikyuu/include/hikyuu/KDataSharedBufferImp.h +69 -0
  67. hikyuu/include/hikyuu/KQuery.h +38 -32
  68. hikyuu/include/hikyuu/KRecord.h +4 -1
  69. hikyuu/include/hikyuu/MarketInfo.h +1 -1
  70. hikyuu/include/hikyuu/Stock.h +24 -6
  71. hikyuu/include/hikyuu/StockManager.h +15 -6
  72. hikyuu/include/hikyuu/StockTypeInfo.h +6 -0
  73. hikyuu/include/hikyuu/TransRecord.h +2 -8
  74. hikyuu/include/hikyuu/data_driver/KDataDriver.h +5 -0
  75. hikyuu/include/hikyuu/doc.h +4 -0
  76. hikyuu/include/hikyuu/global/GlobalSpotAgent.h +8 -0
  77. hikyuu/include/hikyuu/global/agent/SpotAgent.h +12 -7
  78. hikyuu/include/hikyuu/indicator/Indicator.h +48 -0
  79. hikyuu/include/hikyuu/indicator/Indicator2InImp.h +9 -0
  80. hikyuu/include/hikyuu/indicator/IndicatorImp.h +83 -15
  81. hikyuu/include/hikyuu/indicator/build_in.h +1 -0
  82. hikyuu/include/hikyuu/indicator/crt/AMA.h +2 -1
  83. hikyuu/include/hikyuu/indicator/crt/ATR.h +1 -1
  84. hikyuu/include/hikyuu/indicator/crt/CONTEXT.h +2 -0
  85. hikyuu/include/hikyuu/indicator/crt/CYCLE.h +3 -0
  86. hikyuu/include/hikyuu/indicator/crt/DMA.h +1 -1
  87. hikyuu/include/hikyuu/indicator/crt/IC.h +14 -6
  88. hikyuu/include/hikyuu/indicator/crt/ICIR.h +8 -4
  89. hikyuu/include/hikyuu/indicator/crt/INSUM.h +2 -0
  90. hikyuu/include/hikyuu/indicator/crt/PRICELIST.h +2 -0
  91. hikyuu/include/hikyuu/indicator/crt/REFX.h +25 -0
  92. hikyuu/include/hikyuu/indicator/crt/SLICE.h +4 -4
  93. hikyuu/include/hikyuu/indicator/crt/SPEARMAN.h +3 -2
  94. hikyuu/include/hikyuu/indicator/imp/IContext.h +5 -0
  95. hikyuu/include/hikyuu/indicator/imp/ICval.h +6 -0
  96. hikyuu/include/hikyuu/indicator/imp/IDropna.h +9 -0
  97. hikyuu/include/hikyuu/indicator/imp/IIc.h +2 -1
  98. hikyuu/include/hikyuu/indicator/imp/IPriceList.h +1 -0
  99. hikyuu/include/hikyuu/indicator/imp/IRefX.h +23 -0
  100. hikyuu/include/hikyuu/lang.h +27 -0
  101. hikyuu/include/hikyuu/plugin/KDataToHdf5Importer.h +6 -1
  102. hikyuu/include/hikyuu/plugin/backtest.h +2 -0
  103. hikyuu/include/hikyuu/plugin/extind.h +45 -0
  104. hikyuu/include/hikyuu/plugin/hkuextra.h +77 -0
  105. hikyuu/include/hikyuu/plugin/interface/HkuExtraPluginInterface.h +54 -0
  106. hikyuu/include/hikyuu/plugin/interface/ImportKDataToHdf5PluginInterface.h +10 -1
  107. hikyuu/include/hikyuu/plugin/interface/TMReportPluginInterface.h +1 -0
  108. hikyuu/include/hikyuu/plugin/interface/plugins.h +2 -0
  109. hikyuu/include/hikyuu/python/pybind_utils.h +28 -11
  110. hikyuu/include/hikyuu/trade_manage/Performance.h +0 -1
  111. hikyuu/include/hikyuu/trade_manage/TradeCostBase.h +5 -0
  112. hikyuu/include/hikyuu/trade_manage/TradeManager.h +4 -0
  113. hikyuu/include/hikyuu/trade_manage/TradeManagerBase.h +10 -1
  114. hikyuu/include/hikyuu/trade_manage/TradeRecord.h +1 -1
  115. hikyuu/include/hikyuu/trade_sys/allocatefunds/AllocateFundsBase.h +5 -0
  116. hikyuu/include/hikyuu/trade_sys/condition/ConditionBase.h +5 -0
  117. hikyuu/include/hikyuu/trade_sys/environment/EnvironmentBase.h +5 -0
  118. hikyuu/include/hikyuu/trade_sys/moneymanager/MoneyManagerBase.h +5 -0
  119. hikyuu/include/hikyuu/trade_sys/multifactor/MultiFactorBase.h +6 -3
  120. hikyuu/include/hikyuu/trade_sys/portfolio/Portfolio.h +4 -0
  121. hikyuu/include/hikyuu/trade_sys/profitgoal/ProfitGoalBase.h +5 -0
  122. hikyuu/include/hikyuu/trade_sys/selector/SelectorBase.h +5 -2
  123. hikyuu/include/hikyuu/trade_sys/signal/SignalBase.h +5 -0
  124. hikyuu/include/hikyuu/trade_sys/slippage/SlippageBase.h +5 -0
  125. hikyuu/include/hikyuu/trade_sys/stoploss/StoplossBase.h +6 -1
  126. hikyuu/include/hikyuu/trade_sys/system/System.h +5 -0
  127. hikyuu/include/hikyuu/utilities/config.h +0 -2
  128. hikyuu/include/hikyuu/utilities/datetime/Datetime.h +2 -2
  129. hikyuu/include/hikyuu/utilities/os.h +7 -0
  130. hikyuu/include/hikyuu/utilities/plugin/PluginLoader.h +2 -1
  131. hikyuu/include/hikyuu/utilities/thread/GlobalMQStealThreadPool.h +1 -1
  132. hikyuu/include/hikyuu/utilities/thread/GlobalMQThreadPool.h +1 -1
  133. hikyuu/include/hikyuu/utilities/thread/GlobalThreadPool.h +1 -1
  134. hikyuu/include/hikyuu/utilities/thread/MQThreadPool.h +1 -1
  135. hikyuu/include/hikyuu/version.h +4 -4
  136. hikyuu/include/hikyuu/views/arrow_common.h +38 -0
  137. hikyuu/include/hikyuu/views/arrow_views.h +117 -0
  138. hikyuu/indicator/__init__.py +0 -1
  139. hikyuu/indicator/indicator.py +17 -57
  140. hikyuu/plugin/backtest.dll +0 -0
  141. hikyuu/plugin/clickhousedriver.dll +0 -0
  142. hikyuu/plugin/dataserver.dll +0 -0
  143. hikyuu/plugin/device.dll +0 -0
  144. hikyuu/plugin/extind.dll +0 -0
  145. hikyuu/plugin/hkuextra.dll +0 -0
  146. hikyuu/plugin/import2hdf5.dll +0 -0
  147. hikyuu/plugin/tmreport.dll +0 -0
  148. hikyuu/strategy/strategy_demo1.py +1 -1
  149. hikyuu/test/test_init.py +73 -14
  150. hikyuu/test/test_real_tdx_import.py +336 -0
  151. hikyuu/test/test_tdx_import.py +315 -0
  152. hikyuu/test/test_tdx_real_data_import.py +281 -0
  153. hikyuu/trade_manage/__init__.pyi +583 -553
  154. hikyuu/trade_manage/broker.pyi +19 -18
  155. hikyuu/trade_manage/broker_easytrader.pyi +6 -4
  156. hikyuu/trade_manage/broker_mail.pyi +22 -24
  157. hikyuu/trade_manage/trade.py +10 -65
  158. hikyuu/trade_manage/trade.pyi +583 -565
  159. hikyuu/trade_sys/__init__.py +15 -0
  160. hikyuu/util/__init__.pyi +0 -1
  161. hikyuu/util/check.pyi +17 -15
  162. hikyuu/util/mylog.pyi +8 -7
  163. hikyuu/util/notebook.pyi +9 -11
  164. hikyuu/util/singleton.pyi +8 -6
  165. {hikyuu-2.6.6.dist-info → hikyuu-2.6.8.dist-info}/METADATA +8 -4
  166. {hikyuu-2.6.6.dist-info → hikyuu-2.6.8.dist-info}/RECORD +172 -160
  167. {hikyuu-2.6.6.dist-info → hikyuu-2.6.8.dist-info}/top_level.txt +2 -1
  168. hikyuu/cpp/i18n/zh_CN.mo +0 -0
  169. hikyuu/include/hikyuu/utilities/mo/mo.h +0 -64
  170. hikyuu/indicator/talib_wrap.py +0 -1273
  171. /hikyuu/include/hikyuu/utilities/{mo/moFileReader.h → moFileReader.h} +0 -0
  172. /hikyuu/include/hikyuu/{utilities/mo → views}/__init__.py +0 -0
  173. {hikyuu-2.6.6.dist-info → hikyuu-2.6.8.dist-info}/LICENSE +0 -0
  174. {hikyuu-2.6.6.dist-info → hikyuu-2.6.8.dist-info}/WHEEL +0 -0
  175. {hikyuu-2.6.6.dist-info → hikyuu-2.6.8.dist-info}/entry_points.txt +0 -0
@@ -9,30 +9,32 @@
9
9
  "name": "stderr",
10
10
  "output_type": "stream",
11
11
  "text": [
12
- "2024-08-20 16:00:57,364 [INFO] hikyuu version: 2.1.1_202408182226_RELEASE_windows_x64 [<module>] (D:\\workspace\\hikyuu\\hikyuu\\__init__.py:97) [hikyuu::hku_info]\n"
12
+ "2025-08-11 23:22:45,331 [INFO] runing in interactive session [<module>] (D:\\workspace\\hikyuu\\hikyuu\\__init__.py:109) [hikyuu::hku_info]\n",
13
+ "2025-08-11 23:22:45,331 [INFO] running in jupyter [<module>] (D:\\workspace\\hikyuu\\hikyuu\\__init__.py:116) [hikyuu::hku_info]\n"
13
14
  ]
14
15
  },
15
16
  {
16
17
  "name": "stdout",
17
18
  "output_type": "stream",
18
19
  "text": [
19
- "2024-08-20 16:00:57.865 [HKU-I] - Using MYSQL BaseInfoDriver (BaseInfoDriver.cpp:58)\n",
20
- "2024-08-20 16:00:57.883 [HKU-I] - Loading market information... (StockManager.cpp:481)\n",
21
- "2024-08-20 16:00:57.890 [HKU-I] - Loading stock type information... (StockManager.cpp:494)\n",
22
- "2024-08-20 16:00:57.897 [HKU-I] - Loading stock information... (StockManager.cpp:409)\n",
23
- "2024-08-20 16:00:58.045 [HKU-I] - Loading stock weight... (StockManager.cpp:511)\n",
24
- "2024-08-20 16:00:59.275 [HKU-I] - Loading KData... (StockManager.cpp:134)\n",
25
- "2024-08-20 16:01:00.831 [HKU-I] - Preloading all day kdata to buffer! (StockManager.cpp:179)\n",
26
- "2024-08-20 16:01:00.832 [HKU-I] - Preloading all week kdata to buffer! (StockManager.cpp:179)\n",
27
- "2024-08-20 16:01:00.832 [HKU-I] - Preloading all month kdata to buffer! (StockManager.cpp:179)\n",
28
- "2024-08-20 16:01:00.902 [HKU-I] - 1.63s Loaded Data. (StockManager.cpp:159)\n",
29
- "CPU times: total: 625 ms\n",
30
- "Wall time: 4.01 s\n"
20
+ "current plugin path: D:\\workspace\\hikyuu\\hikyuu\\plugin\n",
21
+ "2025-08-11 23:22:45.391 [HKU-I] - Using MYSQL BaseInfoDriver (BaseInfoDriver.cpp:57)\n",
22
+ "2025-08-11 23:22:45.415 [HKU-I] - 加载市场信息…… (StockManager.cpp:572)\n",
23
+ "2025-08-11 23:22:45.422 [HKU-I] - 加载证券类型信息…… (StockManager.cpp:590)\n",
24
+ "2025-08-11 23:22:45.429 [HKU-I] - 加载证券信息…… (StockManager.cpp:476)\n",
25
+ "2025-08-11 23:22:45.540 [HKU-I] - 加载权息数据…… (StockManager.cpp:608)\n",
26
+ "2025-08-11 23:22:46.589 [HKU-I] - 加载板块信息…… (StockManager.cpp:181)\n",
27
+ "2025-08-11 23:22:47.718 [HKU-I] - 加载K线数据…… (StockManager.cpp:185)\n",
28
+ "2025-08-11 23:22:47.718 [HKU-I] - 预加载 day K线数据至缓存 (最大数量: 100000)! (StockManager.cpp:229)\n",
29
+ "2025-08-11 23:22:47.719 [HKU-I] - 2.32 秒数据加载完毕. (StockManager.cpp:191)\n",
30
+ "2025-08-11 23:22:47.719 [HKU-I] - 启动行情接收. (SpotAgent.cpp:39)\n",
31
+ "CPU times: total: 1.52 s\n",
32
+ "Wall time: 3.43 s\n"
31
33
  ]
32
34
  }
33
35
  ],
34
36
  "source": [
35
- "%matplotlib inline\n",
37
+ "#%matplotlib inline\n",
36
38
  "%time from hikyuu.interactive import *"
37
39
  ]
38
40
  },
@@ -78,7 +80,7 @@
78
80
  " current borrow_cash: 0.00,\n",
79
81
  " current borrow_asset: 0.00,\n",
80
82
  " Position: \n",
81
- " SZ000001 平安银行 2017-01-03 00:00:00 1854 100.00 911.00 1029.00 118.00 12.95% 0.12%\n",
83
+ " SZ000001 平安银行 2017-01-03 00:00:00 2090 100.00 911.00 1230.00 319.00 35.02% 0.32%\n",
82
84
  " Short Position: \n",
83
85
  " Borrow Stock: \n",
84
86
  "}\n"
@@ -122,47 +124,56 @@
122
124
  " <thead>\n",
123
125
  " <tr style=\"text-align: right;\">\n",
124
126
  " <th></th>\n",
127
+ " <th>证券代码</th>\n",
125
128
  " <th>证券名称</th>\n",
126
- " <th>买入日期</th>\n",
127
- " <th>已持仓天数</th>\n",
129
+ " <th>买入时间</th>\n",
130
+ " <th>持仓天数</th>\n",
128
131
  " <th>持仓数量</th>\n",
129
132
  " <th>投入金额</th>\n",
130
133
  " <th>当前市值</th>\n",
131
134
  " <th>盈亏金额</th>\n",
132
- " <th>盈亏比例</th>\n",
133
- " </tr>\n",
134
- " <tr>\n",
135
- " <th>证券代码</th>\n",
136
- " <th></th>\n",
137
- " <th></th>\n",
138
- " <th></th>\n",
139
- " <th></th>\n",
140
- " <th></th>\n",
141
- " <th></th>\n",
142
- " <th></th>\n",
143
- " <th></th>\n",
135
+ " <th>盈亏百分比</th>\n",
136
+ " <th>止损价</th>\n",
137
+ " <th>目标价</th>\n",
138
+ " <th>清仓时间</th>\n",
139
+ " <th>累计持有数量</th>\n",
140
+ " <th>累计成本</th>\n",
141
+ " <th>累计风险</th>\n",
142
+ " <th>累计买入金额</th>\n",
143
+ " <th>累计卖出金额</th>\n",
144
144
  " </tr>\n",
145
145
  " </thead>\n",
146
146
  " <tbody>\n",
147
147
  " <tr>\n",
148
- " <th>SZ000001</th>\n",
148
+ " <th>0</th>\n",
149
+ " <td>SZ000001</td>\n",
149
150
  " <td>平安银行</td>\n",
150
151
  " <td>2017-01-03</td>\n",
151
- " <td>1854</td>\n",
152
- " <td>100</td>\n",
152
+ " <td>3142</td>\n",
153
+ " <td>100.0</td>\n",
154
+ " <td>911.0</td>\n",
155
+ " <td>1230.0</td>\n",
156
+ " <td>319.0</td>\n",
157
+ " <td>35.02</td>\n",
158
+ " <td>0.0</td>\n",
159
+ " <td>0.0</td>\n",
160
+ " <td>NaT</td>\n",
161
+ " <td>100.0</td>\n",
162
+ " <td>0.0</td>\n",
153
163
  " <td>911.0</td>\n",
154
- " <td>1029.0</td>\n",
155
- " <td>118.0</td>\n",
156
- " <td>12.952799</td>\n",
164
+ " <td>911.0</td>\n",
165
+ " <td>0.0</td>\n",
157
166
  " </tr>\n",
158
167
  " </tbody>\n",
159
168
  "</table>\n",
160
169
  "</div>"
161
170
  ],
162
171
  "text/plain": [
163
- " 证券名称 买入日期 已持仓天数 持仓数量 投入金额 当前市值 盈亏金额 盈亏比例\n",
164
- "证券代码 \n",
165
- "SZ000001 平安银行 2017-01-03 1854 100 911.0 1029.0 118.0 12.952799"
172
+ " 证券代码 证券名称 买入时间 持仓天数 持仓数量 投入金额 当前市值 盈亏金额 盈亏百分比 止损价 \\\n",
173
+ "0 SZ000001 平安银行 2017-01-03 3142 100.0 911.0 1230.0 319.0 35.02 0.0 \n",
174
+ "\n",
175
+ " 目标价 清仓时间 累计持有数量 累计成本 累计风险 累计买入金额 累计卖出金额 \n",
176
+ "0 0.0 NaT 100.0 0.0 911.0 911.0 0.0 "
166
177
  ]
167
178
  },
168
179
  "execution_count": 3,
@@ -180,6 +191,115 @@
180
191
  "cell_type": "code",
181
192
  "execution_count": 4,
182
193
  "metadata": {},
194
+ "outputs": [
195
+ {
196
+ "data": {
197
+ "text/html": [
198
+ "<div>\n",
199
+ "<style scoped>\n",
200
+ " .dataframe tbody tr th:only-of-type {\n",
201
+ " vertical-align: middle;\n",
202
+ " }\n",
203
+ "\n",
204
+ " .dataframe tbody tr th {\n",
205
+ " vertical-align: top;\n",
206
+ " }\n",
207
+ "\n",
208
+ " .dataframe thead th {\n",
209
+ " text-align: right;\n",
210
+ " }\n",
211
+ "</style>\n",
212
+ "<table border=\"1\" class=\"dataframe\">\n",
213
+ " <thead>\n",
214
+ " <tr style=\"text-align: right;\">\n",
215
+ " <th></th>\n",
216
+ " <th>证券代码</th>\n",
217
+ " <th>证券名称</th>\n",
218
+ " <th>交易时间</th>\n",
219
+ " <th>业务名称</th>\n",
220
+ " <th>计划交易价格</th>\n",
221
+ " <th>实际成交价格</th>\n",
222
+ " <th>目标价格</th>\n",
223
+ " <th>交易数量</th>\n",
224
+ " <th>止损价</th>\n",
225
+ " <th>现金余额</th>\n",
226
+ " <th>交易总成本</th>\n",
227
+ " <th>佣金</th>\n",
228
+ " <th>印花税</th>\n",
229
+ " <th>过户费</th>\n",
230
+ " <th>其它成本</th>\n",
231
+ " <th>信号来源</th>\n",
232
+ " <th>备注</th>\n",
233
+ " </tr>\n",
234
+ " </thead>\n",
235
+ " <tbody>\n",
236
+ " <tr>\n",
237
+ " <th>0</th>\n",
238
+ " <td></td>\n",
239
+ " <td></td>\n",
240
+ " <td>2017-01-01</td>\n",
241
+ " <td>INIT</td>\n",
242
+ " <td>100000.0</td>\n",
243
+ " <td>100000.00</td>\n",
244
+ " <td>0.0</td>\n",
245
+ " <td>0.0</td>\n",
246
+ " <td>0.0</td>\n",
247
+ " <td>100000.0</td>\n",
248
+ " <td>0.0</td>\n",
249
+ " <td>0.0</td>\n",
250
+ " <td>0.0</td>\n",
251
+ " <td>0.0</td>\n",
252
+ " <td>0.0</td>\n",
253
+ " <td>--</td>\n",
254
+ " <td></td>\n",
255
+ " </tr>\n",
256
+ " <tr>\n",
257
+ " <th>1</th>\n",
258
+ " <td>SZ000001</td>\n",
259
+ " <td>平安银行</td>\n",
260
+ " <td>2017-01-03</td>\n",
261
+ " <td>BUY</td>\n",
262
+ " <td>0.0</td>\n",
263
+ " <td>9.11</td>\n",
264
+ " <td>0.0</td>\n",
265
+ " <td>100.0</td>\n",
266
+ " <td>0.0</td>\n",
267
+ " <td>99089.0</td>\n",
268
+ " <td>0.0</td>\n",
269
+ " <td>0.0</td>\n",
270
+ " <td>0.0</td>\n",
271
+ " <td>0.0</td>\n",
272
+ " <td>0.0</td>\n",
273
+ " <td>--</td>\n",
274
+ " <td></td>\n",
275
+ " </tr>\n",
276
+ " </tbody>\n",
277
+ "</table>\n",
278
+ "</div>"
279
+ ],
280
+ "text/plain": [
281
+ " 证券代码 证券名称 交易时间 业务名称 计划交易价格 实际成交价格 目标价格 交易数量 止损价 \\\n",
282
+ "0 2017-01-01 INIT 100000.0 100000.00 0.0 0.0 0.0 \n",
283
+ "1 SZ000001 平安银行 2017-01-03 BUY 0.0 9.11 0.0 100.0 0.0 \n",
284
+ "\n",
285
+ " 现金余额 交易总成本 佣金 印花税 过户费 其它成本 信号来源 备注 \n",
286
+ "0 100000.0 0.0 0.0 0.0 0.0 0.0 -- \n",
287
+ "1 99089.0 0.0 0.0 0.0 0.0 0.0 -- "
288
+ ]
289
+ },
290
+ "execution_count": 4,
291
+ "metadata": {},
292
+ "output_type": "execute_result"
293
+ }
294
+ ],
295
+ "source": [
296
+ "my_tm.get_trade_list().to_df()"
297
+ ]
298
+ },
299
+ {
300
+ "cell_type": "code",
301
+ "execution_count": 5,
302
+ "metadata": {},
183
303
  "outputs": [
184
304
  {
185
305
  "data": {
@@ -206,7 +326,7 @@
206
326
  "}"
207
327
  ]
208
328
  },
209
- "execution_count": 4,
329
+ "execution_count": 5,
210
330
  "metadata": {},
211
331
  "output_type": "execute_result"
212
332
  }
@@ -233,7 +353,7 @@
233
353
  },
234
354
  {
235
355
  "cell_type": "code",
236
- "execution_count": 5,
356
+ "execution_count": 6,
237
357
  "metadata": {},
238
358
  "outputs": [],
239
359
  "source": [
@@ -259,7 +379,7 @@
259
379
  },
260
380
  {
261
381
  "cell_type": "code",
262
- "execution_count": 6,
382
+ "execution_count": 7,
263
383
  "metadata": {},
264
384
  "outputs": [],
265
385
  "source": [
@@ -271,7 +391,7 @@
271
391
  },
272
392
  {
273
393
  "cell_type": "code",
274
- "execution_count": 7,
394
+ "execution_count": 8,
275
395
  "metadata": {},
276
396
  "outputs": [],
277
397
  "source": [
@@ -298,30 +418,25 @@
298
418
  },
299
419
  {
300
420
  "cell_type": "code",
301
- "execution_count": 8,
421
+ "execution_count": 9,
302
422
  "metadata": {},
303
423
  "outputs": [
304
424
  {
305
425
  "name": "stdout",
306
426
  "output_type": "stream",
307
427
  "text": [
308
- "买入:SZ000001, 价格: 9.33, 数量: 1000.0 预期止损价: 0.0, 预期目标价: nan, 信号来源: SystemPart.SIGNAL\n",
309
- "卖出:SZ000001, 价格: 9.16, 数量: 1000.0, 信号来源: SystemPart.SIGNAL\n",
310
- "买入:SZ000001, 价格: 9.33, 数量: 1000.0 预期止损价: 0.0, 预期目标价: nan, 信号来源: SystemPart.SIGNAL\n",
311
- "卖出:SZ000001, 价格: 10.55, 数量: 1000.0, 信号来源: SystemPart.SIGNAL\n",
312
- "买入:SZ000001, 价格: 10.56, 数量: 1000.0 预期止损价: 0.0, 预期目标价: nan, 信号来源: SystemPart.SIGNAL\n",
313
- "卖出:SZ000001, 价格: 10.35, 数量: 1000.0, 信号来源: SystemPart.SIGNAL\n",
314
- "买入:SZ000001, 价格: 10.56, 数量: 1000.0 预期止损价: 0.0, 预期目标价: nan, 信号来源: SystemPart.SIGNAL\n",
315
- "卖出:SZ000001, 价格: 10.43, 数量: 1000.0, 信号来源: SystemPart.SIGNAL\n",
316
- "买入:SZ000001, 价格: 10.58, 数量: 1000.0 预期止损价: 0.0, 预期目标价: nan, 信号来源: SystemPart.SIGNAL\n",
317
- "卖出:SZ000001, 价格: 11.12, 数量: 1000.0, 信号来源: SystemPart.SIGNAL\n",
318
- "买入:SZ000001, 价格: 10.4, 数量: 1000.0 预期止损价: 0.0, 预期目标价: nan, 信号来源: SystemPart.SIGNAL\n",
319
- "卖出:SZ000001, 价格: 9.94, 数量: 1000.0, 信号来源: SystemPart.SIGNAL\n",
320
- "买入:SZ000001, 价格: 10.31, 数量: 1000.0 预期止损价: 0.0, 预期目标价: nan, 信号来源: SystemPart.SIGNAL\n",
321
- "卖出:SZ000001, 价格: 10.12, 数量: 1000.0, 信号来源: SystemPart.SIGNAL\n",
322
- "买入:SZ000001, 价格: 10.22, 数量: 1000.0 预期止损价: 0.0, 预期目标价: nan, 信号来源: SystemPart.SIGNAL\n",
323
- "卖出:SZ000001, 价格: 10.11, 数量: 1000.0, 信号来源: SystemPart.SIGNAL\n",
324
- "买入:SZ000001, 价格: 10.13, 数量: 1000.0 预期止损价: 0.0, 预期目标价: nan, 信号来源: SystemPart.SIGNAL\n"
428
+ "买入:SZ000001, 价格: 11.4, 数量: 1000.0 预期止损价: 0.0, 预期目标价: nan, 信号来源: SystemPart.SIGNAL, 备注: \n",
429
+ "卖出:SZ000001, 价格: 11.53, 数量: 1000.0, 信号来源: SystemPart.SIGNAL, 备注: \n",
430
+ "买入:SZ000001, 价格: 11.58, 数量: 1000.0 预期止损价: 0.0, 预期目标价: nan, 信号来源: SystemPart.SIGNAL, 备注: \n",
431
+ "卖出:SZ000001, 价格: 11.52, 数量: 1000.0, 信号来源: SystemPart.SIGNAL, 备注: \n",
432
+ "买入:SZ000001, 价格: 11.69, 数量: 1000.0 预期止损价: 0.0, 预期目标价: nan, 信号来源: SystemPart.SIGNAL, 备注: \n",
433
+ "卖出:SZ000001, 价格: 11.48, 数量: 1000.0, 信号来源: SystemPart.SIGNAL, 备注: \n",
434
+ "买入:SZ000001, 价格: 11.0, 数量: 1000.0 预期止损价: 0.0, 预期目标价: nan, 信号来源: SystemPart.SIGNAL, 备注: \n",
435
+ "卖出:SZ000001, 价格: 11.0, 数量: 1000.0, 信号来源: SystemPart.SIGNAL, 备注: \n",
436
+ "买入:SZ000001, 价格: 11.07, 数量: 1000.0 预期止损价: 0.0, 预期目标价: nan, 信号来源: SystemPart.SIGNAL, 备注: \n",
437
+ "卖出:SZ000001, 价格: 12.46, 数量: 1000.0, 信号来源: SystemPart.SIGNAL, 备注: \n",
438
+ "买入:SZ000001, 价格: 12.48, 数量: 1000.0 预期止损价: 0.0, 预期目标价: nan, 信号来源: SystemPart.SIGNAL, 备注: \n",
439
+ "卖出:SZ000001, 价格: 12.4, 数量: 1000.0, 信号来源: SystemPart.SIGNAL, 备注: \n"
325
440
  ]
326
441
  }
327
442
  ],
@@ -349,6 +464,638 @@
349
464
  "sys.run(sm['sz000001'], Query(-150))"
350
465
  ]
351
466
  },
467
+ {
468
+ "cell_type": "code",
469
+ "execution_count": 10,
470
+ "metadata": {},
471
+ "outputs": [
472
+ {
473
+ "data": {
474
+ "text/html": [
475
+ "<div>\n",
476
+ "<style scoped>\n",
477
+ " .dataframe tbody tr th:only-of-type {\n",
478
+ " vertical-align: middle;\n",
479
+ " }\n",
480
+ "\n",
481
+ " .dataframe tbody tr th {\n",
482
+ " vertical-align: top;\n",
483
+ " }\n",
484
+ "\n",
485
+ " .dataframe thead th {\n",
486
+ " text-align: right;\n",
487
+ " }\n",
488
+ "</style>\n",
489
+ "<table border=\"1\" class=\"dataframe\">\n",
490
+ " <thead>\n",
491
+ " <tr style=\"text-align: right;\">\n",
492
+ " <th></th>\n",
493
+ " <th>证券代码</th>\n",
494
+ " <th>证券名称</th>\n",
495
+ " <th>交易时间</th>\n",
496
+ " <th>业务名称</th>\n",
497
+ " <th>计划交易价格</th>\n",
498
+ " <th>实际成交价格</th>\n",
499
+ " <th>目标价格</th>\n",
500
+ " <th>交易数量</th>\n",
501
+ " <th>止损价</th>\n",
502
+ " <th>现金余额</th>\n",
503
+ " <th>交易总成本</th>\n",
504
+ " <th>佣金</th>\n",
505
+ " <th>印花税</th>\n",
506
+ " <th>过户费</th>\n",
507
+ " <th>其它成本</th>\n",
508
+ " <th>信号来源</th>\n",
509
+ " <th>备注</th>\n",
510
+ " </tr>\n",
511
+ " </thead>\n",
512
+ " <tbody>\n",
513
+ " <tr>\n",
514
+ " <th>0</th>\n",
515
+ " <td></td>\n",
516
+ " <td></td>\n",
517
+ " <td>2017-01-01</td>\n",
518
+ " <td>INIT</td>\n",
519
+ " <td>300000.00</td>\n",
520
+ " <td>300000.00</td>\n",
521
+ " <td>0.0</td>\n",
522
+ " <td>0.0</td>\n",
523
+ " <td>0.0</td>\n",
524
+ " <td>300000.0</td>\n",
525
+ " <td>0.0</td>\n",
526
+ " <td>0.0</td>\n",
527
+ " <td>0.0</td>\n",
528
+ " <td>0.0</td>\n",
529
+ " <td>0.0</td>\n",
530
+ " <td>--</td>\n",
531
+ " <td></td>\n",
532
+ " </tr>\n",
533
+ " <tr>\n",
534
+ " <th>1</th>\n",
535
+ " <td>SZ000001</td>\n",
536
+ " <td>平安银行</td>\n",
537
+ " <td>2025-02-11</td>\n",
538
+ " <td>BUY</td>\n",
539
+ " <td>11.40</td>\n",
540
+ " <td>11.40</td>\n",
541
+ " <td>NaN</td>\n",
542
+ " <td>1000.0</td>\n",
543
+ " <td>0.0</td>\n",
544
+ " <td>288600.0</td>\n",
545
+ " <td>0.0</td>\n",
546
+ " <td>0.0</td>\n",
547
+ " <td>0.0</td>\n",
548
+ " <td>0.0</td>\n",
549
+ " <td>0.0</td>\n",
550
+ " <td>SG</td>\n",
551
+ " <td></td>\n",
552
+ " </tr>\n",
553
+ " <tr>\n",
554
+ " <th>2</th>\n",
555
+ " <td>SZ000001</td>\n",
556
+ " <td>平安银行</td>\n",
557
+ " <td>2025-02-27</td>\n",
558
+ " <td>SELL</td>\n",
559
+ " <td>11.53</td>\n",
560
+ " <td>11.53</td>\n",
561
+ " <td>NaN</td>\n",
562
+ " <td>1000.0</td>\n",
563
+ " <td>0.0</td>\n",
564
+ " <td>300130.0</td>\n",
565
+ " <td>0.0</td>\n",
566
+ " <td>0.0</td>\n",
567
+ " <td>0.0</td>\n",
568
+ " <td>0.0</td>\n",
569
+ " <td>0.0</td>\n",
570
+ " <td>SG</td>\n",
571
+ " <td></td>\n",
572
+ " </tr>\n",
573
+ " <tr>\n",
574
+ " <th>3</th>\n",
575
+ " <td>SZ000001</td>\n",
576
+ " <td>平安银行</td>\n",
577
+ " <td>2025-02-28</td>\n",
578
+ " <td>BUY</td>\n",
579
+ " <td>11.58</td>\n",
580
+ " <td>11.58</td>\n",
581
+ " <td>NaN</td>\n",
582
+ " <td>1000.0</td>\n",
583
+ " <td>0.0</td>\n",
584
+ " <td>288550.0</td>\n",
585
+ " <td>0.0</td>\n",
586
+ " <td>0.0</td>\n",
587
+ " <td>0.0</td>\n",
588
+ " <td>0.0</td>\n",
589
+ " <td>0.0</td>\n",
590
+ " <td>SG</td>\n",
591
+ " <td></td>\n",
592
+ " </tr>\n",
593
+ " <tr>\n",
594
+ " <th>4</th>\n",
595
+ " <td>SZ000001</td>\n",
596
+ " <td>平安银行</td>\n",
597
+ " <td>2025-03-03</td>\n",
598
+ " <td>SELL</td>\n",
599
+ " <td>11.52</td>\n",
600
+ " <td>11.52</td>\n",
601
+ " <td>NaN</td>\n",
602
+ " <td>1000.0</td>\n",
603
+ " <td>0.0</td>\n",
604
+ " <td>300070.0</td>\n",
605
+ " <td>0.0</td>\n",
606
+ " <td>0.0</td>\n",
607
+ " <td>0.0</td>\n",
608
+ " <td>0.0</td>\n",
609
+ " <td>0.0</td>\n",
610
+ " <td>SG</td>\n",
611
+ " <td></td>\n",
612
+ " </tr>\n",
613
+ " <tr>\n",
614
+ " <th>5</th>\n",
615
+ " <td>SZ000001</td>\n",
616
+ " <td>平安银行</td>\n",
617
+ " <td>2025-03-06</td>\n",
618
+ " <td>BUY</td>\n",
619
+ " <td>11.69</td>\n",
620
+ " <td>11.69</td>\n",
621
+ " <td>NaN</td>\n",
622
+ " <td>1000.0</td>\n",
623
+ " <td>0.0</td>\n",
624
+ " <td>288380.0</td>\n",
625
+ " <td>0.0</td>\n",
626
+ " <td>0.0</td>\n",
627
+ " <td>0.0</td>\n",
628
+ " <td>0.0</td>\n",
629
+ " <td>0.0</td>\n",
630
+ " <td>SG</td>\n",
631
+ " <td></td>\n",
632
+ " </tr>\n",
633
+ " <tr>\n",
634
+ " <th>6</th>\n",
635
+ " <td>SZ000001</td>\n",
636
+ " <td>平安银行</td>\n",
637
+ " <td>2025-03-19</td>\n",
638
+ " <td>SELL</td>\n",
639
+ " <td>11.48</td>\n",
640
+ " <td>11.48</td>\n",
641
+ " <td>NaN</td>\n",
642
+ " <td>1000.0</td>\n",
643
+ " <td>0.0</td>\n",
644
+ " <td>299860.0</td>\n",
645
+ " <td>0.0</td>\n",
646
+ " <td>0.0</td>\n",
647
+ " <td>0.0</td>\n",
648
+ " <td>0.0</td>\n",
649
+ " <td>0.0</td>\n",
650
+ " <td>SG</td>\n",
651
+ " <td></td>\n",
652
+ " </tr>\n",
653
+ " <tr>\n",
654
+ " <th>7</th>\n",
655
+ " <td>SZ000001</td>\n",
656
+ " <td>平安银行</td>\n",
657
+ " <td>2025-04-21</td>\n",
658
+ " <td>BUY</td>\n",
659
+ " <td>11.00</td>\n",
660
+ " <td>11.00</td>\n",
661
+ " <td>NaN</td>\n",
662
+ " <td>1000.0</td>\n",
663
+ " <td>0.0</td>\n",
664
+ " <td>288860.0</td>\n",
665
+ " <td>0.0</td>\n",
666
+ " <td>0.0</td>\n",
667
+ " <td>0.0</td>\n",
668
+ " <td>0.0</td>\n",
669
+ " <td>0.0</td>\n",
670
+ " <td>SG</td>\n",
671
+ " <td></td>\n",
672
+ " </tr>\n",
673
+ " <tr>\n",
674
+ " <th>8</th>\n",
675
+ " <td>SZ000001</td>\n",
676
+ " <td>平安银行</td>\n",
677
+ " <td>2025-04-24</td>\n",
678
+ " <td>SELL</td>\n",
679
+ " <td>11.00</td>\n",
680
+ " <td>11.00</td>\n",
681
+ " <td>NaN</td>\n",
682
+ " <td>1000.0</td>\n",
683
+ " <td>0.0</td>\n",
684
+ " <td>299860.0</td>\n",
685
+ " <td>0.0</td>\n",
686
+ " <td>0.0</td>\n",
687
+ " <td>0.0</td>\n",
688
+ " <td>0.0</td>\n",
689
+ " <td>0.0</td>\n",
690
+ " <td>SG</td>\n",
691
+ " <td></td>\n",
692
+ " </tr>\n",
693
+ " <tr>\n",
694
+ " <th>9</th>\n",
695
+ " <td>SZ000001</td>\n",
696
+ " <td>平安银行</td>\n",
697
+ " <td>2025-05-09</td>\n",
698
+ " <td>BUY</td>\n",
699
+ " <td>11.07</td>\n",
700
+ " <td>11.07</td>\n",
701
+ " <td>NaN</td>\n",
702
+ " <td>1000.0</td>\n",
703
+ " <td>0.0</td>\n",
704
+ " <td>288790.0</td>\n",
705
+ " <td>0.0</td>\n",
706
+ " <td>0.0</td>\n",
707
+ " <td>0.0</td>\n",
708
+ " <td>0.0</td>\n",
709
+ " <td>0.0</td>\n",
710
+ " <td>SG</td>\n",
711
+ " <td></td>\n",
712
+ " </tr>\n",
713
+ " <tr>\n",
714
+ " <th>10</th>\n",
715
+ " <td>SZ000001</td>\n",
716
+ " <td>平安银行</td>\n",
717
+ " <td>2025-06-12</td>\n",
718
+ " <td>BONUS</td>\n",
719
+ " <td>362.00</td>\n",
720
+ " <td>362.00</td>\n",
721
+ " <td>0.0</td>\n",
722
+ " <td>0.0</td>\n",
723
+ " <td>0.0</td>\n",
724
+ " <td>289514.0</td>\n",
725
+ " <td>0.0</td>\n",
726
+ " <td>0.0</td>\n",
727
+ " <td>0.0</td>\n",
728
+ " <td>0.0</td>\n",
729
+ " <td>0.0</td>\n",
730
+ " <td>--</td>\n",
731
+ " <td></td>\n",
732
+ " </tr>\n",
733
+ " <tr>\n",
734
+ " <th>11</th>\n",
735
+ " <td>SZ000001</td>\n",
736
+ " <td>平安银行</td>\n",
737
+ " <td>2025-07-23</td>\n",
738
+ " <td>SELL</td>\n",
739
+ " <td>12.46</td>\n",
740
+ " <td>12.46</td>\n",
741
+ " <td>NaN</td>\n",
742
+ " <td>1000.0</td>\n",
743
+ " <td>0.0</td>\n",
744
+ " <td>301612.0</td>\n",
745
+ " <td>0.0</td>\n",
746
+ " <td>0.0</td>\n",
747
+ " <td>0.0</td>\n",
748
+ " <td>0.0</td>\n",
749
+ " <td>0.0</td>\n",
750
+ " <td>SG</td>\n",
751
+ " <td></td>\n",
752
+ " </tr>\n",
753
+ " <tr>\n",
754
+ " <th>12</th>\n",
755
+ " <td>SZ000001</td>\n",
756
+ " <td>平安银行</td>\n",
757
+ " <td>2025-08-08</td>\n",
758
+ " <td>BUY</td>\n",
759
+ " <td>12.48</td>\n",
760
+ " <td>12.48</td>\n",
761
+ " <td>NaN</td>\n",
762
+ " <td>1000.0</td>\n",
763
+ " <td>0.0</td>\n",
764
+ " <td>289132.0</td>\n",
765
+ " <td>0.0</td>\n",
766
+ " <td>0.0</td>\n",
767
+ " <td>0.0</td>\n",
768
+ " <td>0.0</td>\n",
769
+ " <td>0.0</td>\n",
770
+ " <td>SG</td>\n",
771
+ " <td></td>\n",
772
+ " </tr>\n",
773
+ " <tr>\n",
774
+ " <th>13</th>\n",
775
+ " <td>SZ000001</td>\n",
776
+ " <td>平安银行</td>\n",
777
+ " <td>2025-08-11</td>\n",
778
+ " <td>SELL</td>\n",
779
+ " <td>12.40</td>\n",
780
+ " <td>12.40</td>\n",
781
+ " <td>NaN</td>\n",
782
+ " <td>1000.0</td>\n",
783
+ " <td>0.0</td>\n",
784
+ " <td>301532.0</td>\n",
785
+ " <td>0.0</td>\n",
786
+ " <td>0.0</td>\n",
787
+ " <td>0.0</td>\n",
788
+ " <td>0.0</td>\n",
789
+ " <td>0.0</td>\n",
790
+ " <td>SG</td>\n",
791
+ " <td></td>\n",
792
+ " </tr>\n",
793
+ " </tbody>\n",
794
+ "</table>\n",
795
+ "</div>"
796
+ ],
797
+ "text/plain": [
798
+ " 证券代码 证券名称 交易时间 业务名称 计划交易价格 实际成交价格 目标价格 交易数量 止损价 \\\n",
799
+ "0 2017-01-01 INIT 300000.00 300000.00 0.0 0.0 0.0 \n",
800
+ "1 SZ000001 平安银行 2025-02-11 BUY 11.40 11.40 NaN 1000.0 0.0 \n",
801
+ "2 SZ000001 平安银行 2025-02-27 SELL 11.53 11.53 NaN 1000.0 0.0 \n",
802
+ "3 SZ000001 平安银行 2025-02-28 BUY 11.58 11.58 NaN 1000.0 0.0 \n",
803
+ "4 SZ000001 平安银行 2025-03-03 SELL 11.52 11.52 NaN 1000.0 0.0 \n",
804
+ "5 SZ000001 平安银行 2025-03-06 BUY 11.69 11.69 NaN 1000.0 0.0 \n",
805
+ "6 SZ000001 平安银行 2025-03-19 SELL 11.48 11.48 NaN 1000.0 0.0 \n",
806
+ "7 SZ000001 平安银行 2025-04-21 BUY 11.00 11.00 NaN 1000.0 0.0 \n",
807
+ "8 SZ000001 平安银行 2025-04-24 SELL 11.00 11.00 NaN 1000.0 0.0 \n",
808
+ "9 SZ000001 平安银行 2025-05-09 BUY 11.07 11.07 NaN 1000.0 0.0 \n",
809
+ "10 SZ000001 平安银行 2025-06-12 BONUS 362.00 362.00 0.0 0.0 0.0 \n",
810
+ "11 SZ000001 平安银行 2025-07-23 SELL 12.46 12.46 NaN 1000.0 0.0 \n",
811
+ "12 SZ000001 平安银行 2025-08-08 BUY 12.48 12.48 NaN 1000.0 0.0 \n",
812
+ "13 SZ000001 平安银行 2025-08-11 SELL 12.40 12.40 NaN 1000.0 0.0 \n",
813
+ "\n",
814
+ " 现金余额 交易总成本 佣金 印花税 过户费 其它成本 信号来源 备注 \n",
815
+ "0 300000.0 0.0 0.0 0.0 0.0 0.0 -- \n",
816
+ "1 288600.0 0.0 0.0 0.0 0.0 0.0 SG \n",
817
+ "2 300130.0 0.0 0.0 0.0 0.0 0.0 SG \n",
818
+ "3 288550.0 0.0 0.0 0.0 0.0 0.0 SG \n",
819
+ "4 300070.0 0.0 0.0 0.0 0.0 0.0 SG \n",
820
+ "5 288380.0 0.0 0.0 0.0 0.0 0.0 SG \n",
821
+ "6 299860.0 0.0 0.0 0.0 0.0 0.0 SG \n",
822
+ "7 288860.0 0.0 0.0 0.0 0.0 0.0 SG \n",
823
+ "8 299860.0 0.0 0.0 0.0 0.0 0.0 SG \n",
824
+ "9 288790.0 0.0 0.0 0.0 0.0 0.0 SG \n",
825
+ "10 289514.0 0.0 0.0 0.0 0.0 0.0 -- \n",
826
+ "11 301612.0 0.0 0.0 0.0 0.0 0.0 SG \n",
827
+ "12 289132.0 0.0 0.0 0.0 0.0 0.0 SG \n",
828
+ "13 301532.0 0.0 0.0 0.0 0.0 0.0 SG "
829
+ ]
830
+ },
831
+ "execution_count": 10,
832
+ "metadata": {},
833
+ "output_type": "execute_result"
834
+ }
835
+ ],
836
+ "source": [
837
+ "my_tm.get_trade_list().to_df()"
838
+ ]
839
+ },
840
+ {
841
+ "cell_type": "code",
842
+ "execution_count": 11,
843
+ "metadata": {
844
+ "scrolled": true
845
+ },
846
+ "outputs": [
847
+ {
848
+ "data": {
849
+ "text/plain": [
850
+ "array([('', '', '2017-01-01T00:00:00.000000000', 'INIT', 3.000e+05, 3.000e+05, 0., 0., 0., 300000., 0., 0., 0., 0., 0., '--', ''),\n",
851
+ " ('SZ000001', '平安银行', '2025-02-11T00:00:00.000000000', 'BUY', 1.140e+01, 1.140e+01, nan, 1000., 0., 288600., 0., 0., 0., 0., 0., 'SG', ''),\n",
852
+ " ('SZ000001', '平安银行', '2025-02-27T00:00:00.000000000', 'SELL', 1.153e+01, 1.153e+01, nan, 1000., 0., 300130., 0., 0., 0., 0., 0., 'SG', ''),\n",
853
+ " ('SZ000001', '平安银行', '2025-02-28T00:00:00.000000000', 'BUY', 1.158e+01, 1.158e+01, nan, 1000., 0., 288550., 0., 0., 0., 0., 0., 'SG', ''),\n",
854
+ " ('SZ000001', '平安银行', '2025-03-03T00:00:00.000000000', 'SELL', 1.152e+01, 1.152e+01, nan, 1000., 0., 300070., 0., 0., 0., 0., 0., 'SG', ''),\n",
855
+ " ('SZ000001', '平安银行', '2025-03-06T00:00:00.000000000', 'BUY', 1.169e+01, 1.169e+01, nan, 1000., 0., 288380., 0., 0., 0., 0., 0., 'SG', ''),\n",
856
+ " ('SZ000001', '平安银行', '2025-03-19T00:00:00.000000000', 'SELL', 1.148e+01, 1.148e+01, nan, 1000., 0., 299860., 0., 0., 0., 0., 0., 'SG', ''),\n",
857
+ " ('SZ000001', '平安银行', '2025-04-21T00:00:00.000000000', 'BUY', 1.100e+01, 1.100e+01, nan, 1000., 0., 288860., 0., 0., 0., 0., 0., 'SG', ''),\n",
858
+ " ('SZ000001', '平安银行', '2025-04-24T00:00:00.000000000', 'SELL', 1.100e+01, 1.100e+01, nan, 1000., 0., 299860., 0., 0., 0., 0., 0., 'SG', ''),\n",
859
+ " ('SZ000001', '平安银行', '2025-05-09T00:00:00.000000000', 'BUY', 1.107e+01, 1.107e+01, nan, 1000., 0., 288790., 0., 0., 0., 0., 0., 'SG', ''),\n",
860
+ " ('SZ000001', '平安银行', '2025-06-12T00:00:00.000000000', 'BONUS', 3.620e+02, 3.620e+02, 0., 0., 0., 289514., 0., 0., 0., 0., 0., '--', ''),\n",
861
+ " ('SZ000001', '平安银行', '2025-07-23T00:00:00.000000000', 'SELL', 1.246e+01, 1.246e+01, nan, 1000., 0., 301612., 0., 0., 0., 0., 0., 'SG', ''),\n",
862
+ " ('SZ000001', '平安银行', '2025-08-08T00:00:00.000000000', 'BUY', 1.248e+01, 1.248e+01, nan, 1000., 0., 289132., 0., 0., 0., 0., 0., 'SG', ''),\n",
863
+ " ('SZ000001', '平安银行', '2025-08-11T00:00:00.000000000', 'SELL', 1.240e+01, 1.240e+01, nan, 1000., 0., 301532., 0., 0., 0., 0., 0., 'SG', '')],\n",
864
+ " dtype=[('证券代码', '<U10'), ('证券名称', '<U20'), ('交易时间', '<M8[ns]'), ('业务名称', '<U20'), ('计划交易价格', '<f8'), ('实际成交价格', '<f8'), ('目标价格', '<f8'), ('交易数量', '<f8'), ('止损价', '<f8'), ('现金余额', '<f8'), ('交易总成本', '<f8'), ('佣金', '<f8'), ('印花税', '<f8'), ('过户费', '<f8'), ('其它成本', '<f8'), ('信号来源', '<U20'), ('备注', '<U100')])"
865
+ ]
866
+ },
867
+ "execution_count": 11,
868
+ "metadata": {},
869
+ "output_type": "execute_result"
870
+ }
871
+ ],
872
+ "source": [
873
+ "my_tm.get_trade_list().to_np()"
874
+ ]
875
+ },
876
+ {
877
+ "cell_type": "code",
878
+ "execution_count": 12,
879
+ "metadata": {},
880
+ "outputs": [
881
+ {
882
+ "data": {
883
+ "text/html": [
884
+ "<div>\n",
885
+ "<style scoped>\n",
886
+ " .dataframe tbody tr th:only-of-type {\n",
887
+ " vertical-align: middle;\n",
888
+ " }\n",
889
+ "\n",
890
+ " .dataframe tbody tr th {\n",
891
+ " vertical-align: top;\n",
892
+ " }\n",
893
+ "\n",
894
+ " .dataframe thead th {\n",
895
+ " text-align: right;\n",
896
+ " }\n",
897
+ "</style>\n",
898
+ "<table border=\"1\" class=\"dataframe\">\n",
899
+ " <thead>\n",
900
+ " <tr style=\"text-align: right;\">\n",
901
+ " <th></th>\n",
902
+ " <th>证券代码</th>\n",
903
+ " <th>证券名称</th>\n",
904
+ " <th>买入时间</th>\n",
905
+ " <th>持仓天数</th>\n",
906
+ " <th>持仓数量</th>\n",
907
+ " <th>投入金额</th>\n",
908
+ " <th>当前市值</th>\n",
909
+ " <th>盈亏金额</th>\n",
910
+ " <th>盈亏百分比</th>\n",
911
+ " <th>止损价</th>\n",
912
+ " <th>目标价</th>\n",
913
+ " <th>清仓时间</th>\n",
914
+ " <th>累计持有数量</th>\n",
915
+ " <th>累计成本</th>\n",
916
+ " <th>累计风险</th>\n",
917
+ " <th>累计买入金额</th>\n",
918
+ " <th>累计卖出金额</th>\n",
919
+ " </tr>\n",
920
+ " </thead>\n",
921
+ " <tbody>\n",
922
+ " <tr>\n",
923
+ " <th>0</th>\n",
924
+ " <td>SZ000001</td>\n",
925
+ " <td>平安银行</td>\n",
926
+ " <td>2025-02-11</td>\n",
927
+ " <td>16</td>\n",
928
+ " <td>0.0</td>\n",
929
+ " <td>-130.0</td>\n",
930
+ " <td>0.0</td>\n",
931
+ " <td>130.0</td>\n",
932
+ " <td>-100.0</td>\n",
933
+ " <td>0.0</td>\n",
934
+ " <td>NaN</td>\n",
935
+ " <td>2025-02-27</td>\n",
936
+ " <td>1000.0</td>\n",
937
+ " <td>0.0</td>\n",
938
+ " <td>11400.0</td>\n",
939
+ " <td>11400.0</td>\n",
940
+ " <td>11530.0</td>\n",
941
+ " </tr>\n",
942
+ " <tr>\n",
943
+ " <th>1</th>\n",
944
+ " <td>SZ000001</td>\n",
945
+ " <td>平安银行</td>\n",
946
+ " <td>2025-02-28</td>\n",
947
+ " <td>3</td>\n",
948
+ " <td>0.0</td>\n",
949
+ " <td>60.0</td>\n",
950
+ " <td>0.0</td>\n",
951
+ " <td>-60.0</td>\n",
952
+ " <td>-100.0</td>\n",
953
+ " <td>0.0</td>\n",
954
+ " <td>NaN</td>\n",
955
+ " <td>2025-03-03</td>\n",
956
+ " <td>1000.0</td>\n",
957
+ " <td>0.0</td>\n",
958
+ " <td>11580.0</td>\n",
959
+ " <td>11580.0</td>\n",
960
+ " <td>11520.0</td>\n",
961
+ " </tr>\n",
962
+ " <tr>\n",
963
+ " <th>2</th>\n",
964
+ " <td>SZ000001</td>\n",
965
+ " <td>平安银行</td>\n",
966
+ " <td>2025-03-06</td>\n",
967
+ " <td>13</td>\n",
968
+ " <td>0.0</td>\n",
969
+ " <td>210.0</td>\n",
970
+ " <td>0.0</td>\n",
971
+ " <td>-210.0</td>\n",
972
+ " <td>-100.0</td>\n",
973
+ " <td>0.0</td>\n",
974
+ " <td>NaN</td>\n",
975
+ " <td>2025-03-19</td>\n",
976
+ " <td>1000.0</td>\n",
977
+ " <td>0.0</td>\n",
978
+ " <td>11690.0</td>\n",
979
+ " <td>11690.0</td>\n",
980
+ " <td>11480.0</td>\n",
981
+ " </tr>\n",
982
+ " <tr>\n",
983
+ " <th>3</th>\n",
984
+ " <td>SZ000001</td>\n",
985
+ " <td>平安银行</td>\n",
986
+ " <td>2025-04-21</td>\n",
987
+ " <td>3</td>\n",
988
+ " <td>0.0</td>\n",
989
+ " <td>0.0</td>\n",
990
+ " <td>0.0</td>\n",
991
+ " <td>0.0</td>\n",
992
+ " <td>0.0</td>\n",
993
+ " <td>0.0</td>\n",
994
+ " <td>NaN</td>\n",
995
+ " <td>2025-04-24</td>\n",
996
+ " <td>1000.0</td>\n",
997
+ " <td>0.0</td>\n",
998
+ " <td>11000.0</td>\n",
999
+ " <td>11000.0</td>\n",
1000
+ " <td>11000.0</td>\n",
1001
+ " </tr>\n",
1002
+ " <tr>\n",
1003
+ " <th>4</th>\n",
1004
+ " <td>SZ000001</td>\n",
1005
+ " <td>平安银行</td>\n",
1006
+ " <td>2025-05-09</td>\n",
1007
+ " <td>75</td>\n",
1008
+ " <td>0.0</td>\n",
1009
+ " <td>-1752.0</td>\n",
1010
+ " <td>0.0</td>\n",
1011
+ " <td>1752.0</td>\n",
1012
+ " <td>-100.0</td>\n",
1013
+ " <td>0.0</td>\n",
1014
+ " <td>NaN</td>\n",
1015
+ " <td>2025-07-23</td>\n",
1016
+ " <td>1000.0</td>\n",
1017
+ " <td>0.0</td>\n",
1018
+ " <td>11070.0</td>\n",
1019
+ " <td>11070.0</td>\n",
1020
+ " <td>12822.0</td>\n",
1021
+ " </tr>\n",
1022
+ " <tr>\n",
1023
+ " <th>5</th>\n",
1024
+ " <td>SZ000001</td>\n",
1025
+ " <td>平安银行</td>\n",
1026
+ " <td>2025-08-08</td>\n",
1027
+ " <td>3</td>\n",
1028
+ " <td>0.0</td>\n",
1029
+ " <td>80.0</td>\n",
1030
+ " <td>0.0</td>\n",
1031
+ " <td>-80.0</td>\n",
1032
+ " <td>-100.0</td>\n",
1033
+ " <td>0.0</td>\n",
1034
+ " <td>NaN</td>\n",
1035
+ " <td>2025-08-11</td>\n",
1036
+ " <td>1000.0</td>\n",
1037
+ " <td>0.0</td>\n",
1038
+ " <td>12480.0</td>\n",
1039
+ " <td>12480.0</td>\n",
1040
+ " <td>12400.0</td>\n",
1041
+ " </tr>\n",
1042
+ " </tbody>\n",
1043
+ "</table>\n",
1044
+ "</div>"
1045
+ ],
1046
+ "text/plain": [
1047
+ " 证券代码 证券名称 买入时间 持仓天数 持仓数量 投入金额 当前市值 盈亏金额 盈亏百分比 止损价 \\\n",
1048
+ "0 SZ000001 平安银行 2025-02-11 16 0.0 -130.0 0.0 130.0 -100.0 0.0 \n",
1049
+ "1 SZ000001 平安银行 2025-02-28 3 0.0 60.0 0.0 -60.0 -100.0 0.0 \n",
1050
+ "2 SZ000001 平安银行 2025-03-06 13 0.0 210.0 0.0 -210.0 -100.0 0.0 \n",
1051
+ "3 SZ000001 平安银行 2025-04-21 3 0.0 0.0 0.0 0.0 0.0 0.0 \n",
1052
+ "4 SZ000001 平安银行 2025-05-09 75 0.0 -1752.0 0.0 1752.0 -100.0 0.0 \n",
1053
+ "5 SZ000001 平安银行 2025-08-08 3 0.0 80.0 0.0 -80.0 -100.0 0.0 \n",
1054
+ "\n",
1055
+ " 目标价 清仓时间 累计持有数量 累计成本 累计风险 累计买入金额 累计卖出金额 \n",
1056
+ "0 NaN 2025-02-27 1000.0 0.0 11400.0 11400.0 11530.0 \n",
1057
+ "1 NaN 2025-03-03 1000.0 0.0 11580.0 11580.0 11520.0 \n",
1058
+ "2 NaN 2025-03-19 1000.0 0.0 11690.0 11690.0 11480.0 \n",
1059
+ "3 NaN 2025-04-24 1000.0 0.0 11000.0 11000.0 11000.0 \n",
1060
+ "4 NaN 2025-07-23 1000.0 0.0 11070.0 11070.0 12822.0 \n",
1061
+ "5 NaN 2025-08-11 1000.0 0.0 12480.0 12480.0 12400.0 "
1062
+ ]
1063
+ },
1064
+ "execution_count": 12,
1065
+ "metadata": {},
1066
+ "output_type": "execute_result"
1067
+ }
1068
+ ],
1069
+ "source": [
1070
+ "my_tm.get_history_position_list().to_df()"
1071
+ ]
1072
+ },
1073
+ {
1074
+ "cell_type": "code",
1075
+ "execution_count": 13,
1076
+ "metadata": {},
1077
+ "outputs": [
1078
+ {
1079
+ "data": {
1080
+ "text/plain": [
1081
+ "array([('SZ000001', '平安银行', '2025-02-11T00:00:00.000000000', 16, 0., -130., 0., 130., -100., 0., nan, '2025-02-27T00:00:00.000000000', 1000., 0., 11400., 11400., 11530.),\n",
1082
+ " ('SZ000001', '平安银行', '2025-02-28T00:00:00.000000000', 3, 0., 60., 0., -60., -100., 0., nan, '2025-03-03T00:00:00.000000000', 1000., 0., 11580., 11580., 11520.),\n",
1083
+ " ('SZ000001', '平安银行', '2025-03-06T00:00:00.000000000', 13, 0., 210., 0., -210., -100., 0., nan, '2025-03-19T00:00:00.000000000', 1000., 0., 11690., 11690., 11480.),\n",
1084
+ " ('SZ000001', '平安银行', '2025-04-21T00:00:00.000000000', 3, 0., 0., 0., 0., 0., 0., nan, '2025-04-24T00:00:00.000000000', 1000., 0., 11000., 11000., 11000.),\n",
1085
+ " ('SZ000001', '平安银行', '2025-05-09T00:00:00.000000000', 75, 0., -1752., 0., 1752., -100., 0., nan, '2025-07-23T00:00:00.000000000', 1000., 0., 11070., 11070., 12822.),\n",
1086
+ " ('SZ000001', '平安银行', '2025-08-08T00:00:00.000000000', 3, 0., 80., 0., -80., -100., 0., nan, '2025-08-11T00:00:00.000000000', 1000., 0., 12480., 12480., 12400.)],\n",
1087
+ " dtype=[('证券代码', '<U10'), ('证券名称', '<U20'), ('买入时间', '<M8[ns]'), ('持仓天数', '<i8'), ('持仓数量', '<f8'), ('投入金额', '<f8'), ('当前市值', '<f8'), ('盈亏金额', '<f8'), ('盈亏百分比', '<f8'), ('止损价', '<f8'), ('目标价', '<f8'), ('清仓时间', '<M8[ns]'), ('累计持有数量', '<f8'), ('累计成本', '<f8'), ('累计风险', '<f8'), ('累计买入金额', '<f8'), ('累计卖出金额', '<f8')])"
1088
+ ]
1089
+ },
1090
+ "execution_count": 13,
1091
+ "metadata": {},
1092
+ "output_type": "execute_result"
1093
+ }
1094
+ ],
1095
+ "source": [
1096
+ "my_tm.get_history_position_list().to_np()"
1097
+ ]
1098
+ },
352
1099
  {
353
1100
  "cell_type": "code",
354
1101
  "execution_count": null,
@@ -373,7 +1120,7 @@
373
1120
  "name": "python",
374
1121
  "nbconvert_exporter": "python",
375
1122
  "pygments_lexer": "ipython3",
376
- "version": "3.11.7"
1123
+ "version": "3.12.9"
377
1124
  }
378
1125
  },
379
1126
  "nbformat": 4,