hikyuu 2.7.3__py3-none-win_amd64.whl → 2.7.6__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 (217) hide show
  1. hikyuu/__init__.py +3 -1
  2. hikyuu/__init__.pyi +11 -10
  3. hikyuu/analysis/__init__.pyi +1 -0
  4. hikyuu/analysis/analysis.pyi +2 -1
  5. hikyuu/core.pyi +3 -2
  6. hikyuu/cpp/core310.pyd +0 -0
  7. hikyuu/cpp/core310.pyi +80 -46
  8. hikyuu/cpp/core311.pyd +0 -0
  9. hikyuu/cpp/core311.pyi +80 -46
  10. hikyuu/cpp/core312.pyd +0 -0
  11. hikyuu/cpp/core312.pyi +80 -46
  12. hikyuu/cpp/core313.pyd +0 -0
  13. hikyuu/cpp/core313.pyi +80 -46
  14. hikyuu/cpp/hikyuu.dll +0 -0
  15. hikyuu/cpp/hikyuu.lib +0 -0
  16. hikyuu/cpp/mimalloc-redirect.dll +0 -0
  17. hikyuu/cpp/mimalloc.dll +0 -0
  18. hikyuu/data/clickhouse_upgrade/0002.sql +9 -0
  19. hikyuu/data/common_mysql.py +1 -1
  20. hikyuu/data/em_block_to_mysql.py +16 -4
  21. hikyuu/data/em_block_to_sqlite.py +16 -4
  22. hikyuu/data/hku_config_template.py +1 -1
  23. hikyuu/data/mysql_upgrade/0030.sql +3 -0
  24. hikyuu/data/pytdx_to_h5.py +2 -2
  25. hikyuu/data/pytdx_to_mysql.py +5 -5
  26. hikyuu/data/sqlite_upgrade/0030.sql +5 -0
  27. hikyuu/draw/__init__.pyi +1 -1
  28. hikyuu/draw/drawplot/__init__.pyi +1 -1
  29. hikyuu/draw/drawplot/bokeh_draw.pyi +6 -5
  30. hikyuu/draw/drawplot/echarts_draw.pyi +6 -5
  31. hikyuu/draw/drawplot/matplotlib_draw.py +19 -11
  32. hikyuu/draw/drawplot/matplotlib_draw.pyi +6 -5
  33. hikyuu/examples/notebook/001-overview.ipynb +112 -78
  34. hikyuu/examples/notebook/004-IndicatorOverview.ipynb +52 -65
  35. hikyuu/examples/notebook/006-TradeManager.ipynb +402 -291
  36. hikyuu/examples/notebook/008-Pickle.ipynb +25 -17
  37. hikyuu/examples/notebook/009-RealData.ipynb +36 -38
  38. hikyuu/examples/notebook/Demo/Demo2.ipynb +146 -116
  39. hikyuu/extend.pyi +3 -2
  40. hikyuu/gui/data/UseTdxImportToH5Thread.py +4 -2
  41. hikyuu/gui/start_qmt.py +1 -1
  42. hikyuu/hub.pyi +6 -6
  43. hikyuu/include/hikyuu/Block.h +9 -9
  44. hikyuu/include/hikyuu/HistoryFinanceInfo.h +3 -3
  45. hikyuu/include/hikyuu/KData.h +51 -28
  46. hikyuu/include/hikyuu/KDataImp.h +12 -7
  47. hikyuu/include/hikyuu/KDataPrivatedBufferImp.h +13 -7
  48. hikyuu/include/hikyuu/KDataSharedBufferImp.h +8 -6
  49. hikyuu/include/hikyuu/KQuery.h +11 -11
  50. hikyuu/include/hikyuu/KRecord.h +1 -1
  51. hikyuu/include/hikyuu/MarketInfo.h +10 -10
  52. hikyuu/include/hikyuu/Stock.h +30 -30
  53. hikyuu/include/hikyuu/StockManager.h +11 -10
  54. hikyuu/include/hikyuu/StockTypeInfo.h +9 -9
  55. hikyuu/include/hikyuu/StockWeight.h +9 -9
  56. hikyuu/include/hikyuu/TimeLineRecord.h +1 -1
  57. hikyuu/include/hikyuu/TransRecord.h +1 -1
  58. hikyuu/include/hikyuu/data_driver/BlockInfoDriver.h +6 -0
  59. hikyuu/include/hikyuu/data_driver/KDataDriver.h +4 -3
  60. hikyuu/include/hikyuu/indicator/IndParam.h +1 -1
  61. hikyuu/include/hikyuu/indicator/Indicator.h +56 -27
  62. hikyuu/include/hikyuu/indicator/Indicator2InImp.h +0 -4
  63. hikyuu/include/hikyuu/indicator/IndicatorImp.h +146 -73
  64. hikyuu/include/hikyuu/indicator/crt/CONTEXT.h +11 -1
  65. hikyuu/include/hikyuu/indicator/crt/IC.h +19 -14
  66. hikyuu/include/hikyuu/indicator/crt/ICIR.h +4 -7
  67. hikyuu/include/hikyuu/indicator/imp/IAbs.h +1 -0
  68. hikyuu/include/hikyuu/indicator/imp/IAcos.h +1 -0
  69. hikyuu/include/hikyuu/indicator/imp/IAd.h +0 -2
  70. hikyuu/include/hikyuu/indicator/imp/IAdvance.h +3 -0
  71. hikyuu/include/hikyuu/indicator/imp/IAma.h +3 -0
  72. hikyuu/include/hikyuu/indicator/imp/IAsin.h +1 -0
  73. hikyuu/include/hikyuu/indicator/imp/IAtan.h +1 -0
  74. hikyuu/include/hikyuu/indicator/imp/IAtr.h +2 -3
  75. hikyuu/include/hikyuu/indicator/imp/IBackset.h +2 -4
  76. hikyuu/include/hikyuu/indicator/imp/IBlockSetNum.h +3 -0
  77. hikyuu/include/hikyuu/indicator/imp/ICeil.h +1 -0
  78. hikyuu/include/hikyuu/indicator/imp/IContext.h +0 -3
  79. hikyuu/include/hikyuu/indicator/imp/ICorr.h +3 -0
  80. hikyuu/include/hikyuu/indicator/imp/ICos.h +1 -0
  81. hikyuu/include/hikyuu/indicator/imp/ICost.h +0 -2
  82. hikyuu/include/hikyuu/indicator/imp/ICount.h +2 -1
  83. hikyuu/include/hikyuu/indicator/imp/ICval.h +1 -4
  84. hikyuu/include/hikyuu/indicator/imp/ICycle.h +0 -2
  85. hikyuu/include/hikyuu/indicator/imp/IDecline.h +3 -0
  86. hikyuu/include/hikyuu/indicator/imp/IDevsq.h +4 -1
  87. hikyuu/include/hikyuu/indicator/imp/IDiff.h +1 -0
  88. hikyuu/include/hikyuu/indicator/imp/IDma.h +2 -0
  89. hikyuu/include/hikyuu/indicator/imp/IDropna.h +0 -4
  90. hikyuu/include/hikyuu/indicator/imp/IEma.h +3 -1
  91. hikyuu/include/hikyuu/indicator/imp/IEvery.h +5 -1
  92. hikyuu/include/hikyuu/indicator/imp/IExist.h +5 -1
  93. hikyuu/include/hikyuu/indicator/imp/IExp.h +1 -0
  94. hikyuu/include/hikyuu/indicator/imp/IFilter.h +4 -5
  95. hikyuu/include/hikyuu/indicator/imp/IFinance.h +1 -2
  96. hikyuu/include/hikyuu/indicator/imp/IFloor.h +1 -0
  97. hikyuu/include/hikyuu/indicator/imp/IHhvbars.h +5 -1
  98. hikyuu/include/hikyuu/indicator/imp/IHighLine.h +5 -1
  99. hikyuu/include/hikyuu/indicator/imp/IHsl.h +0 -2
  100. hikyuu/include/hikyuu/indicator/imp/IIc.h +3 -6
  101. hikyuu/include/hikyuu/indicator/imp/IInBlock.h +1 -2
  102. hikyuu/include/hikyuu/indicator/imp/IIntpart.h +1 -0
  103. hikyuu/include/hikyuu/indicator/imp/IIsInf.h +1 -0
  104. hikyuu/include/hikyuu/indicator/imp/IIsInfa.h +1 -0
  105. hikyuu/include/hikyuu/indicator/imp/IIsLastBar.h +0 -1
  106. hikyuu/include/hikyuu/indicator/imp/IIsNa.h +1 -0
  107. hikyuu/include/hikyuu/indicator/imp/IJumpDown.h +1 -0
  108. hikyuu/include/hikyuu/indicator/imp/IJumpUp.h +1 -0
  109. hikyuu/include/hikyuu/indicator/imp/IKData.h +1 -2
  110. hikyuu/include/hikyuu/indicator/imp/ILiuTongPan.h +0 -2
  111. hikyuu/include/hikyuu/indicator/imp/ILn.h +1 -0
  112. hikyuu/include/hikyuu/indicator/imp/ILog.h +1 -0
  113. hikyuu/include/hikyuu/indicator/imp/ILowLine.h +5 -1
  114. hikyuu/include/hikyuu/indicator/imp/ILowLineBars.h +5 -1
  115. hikyuu/include/hikyuu/indicator/imp/IMa.h +6 -1
  116. hikyuu/include/hikyuu/indicator/imp/IMacd.h +2 -0
  117. hikyuu/include/hikyuu/indicator/imp/INot.h +1 -0
  118. hikyuu/include/hikyuu/indicator/imp/IPow.h +3 -1
  119. hikyuu/include/hikyuu/indicator/imp/IQuantileTrunc.h +1 -0
  120. hikyuu/include/hikyuu/indicator/imp/IRecover.h +3 -0
  121. hikyuu/include/hikyuu/indicator/imp/IRef.h +3 -1
  122. hikyuu/include/hikyuu/indicator/imp/IResult.h +1 -0
  123. hikyuu/include/hikyuu/indicator/imp/IReverse.h +1 -0
  124. hikyuu/include/hikyuu/indicator/imp/IRoc.h +6 -1
  125. hikyuu/include/hikyuu/indicator/imp/IRocp.h +5 -1
  126. hikyuu/include/hikyuu/indicator/imp/IRocr.h +5 -1
  127. hikyuu/include/hikyuu/indicator/imp/IRocr100.h +5 -1
  128. hikyuu/include/hikyuu/indicator/imp/IRound.h +1 -0
  129. hikyuu/include/hikyuu/indicator/imp/IRoundDown.h +1 -0
  130. hikyuu/include/hikyuu/indicator/imp/IRoundUp.h +1 -0
  131. hikyuu/include/hikyuu/indicator/imp/ISaftyLoss.h +1 -0
  132. hikyuu/include/hikyuu/indicator/imp/ISign.h +1 -0
  133. hikyuu/include/hikyuu/indicator/imp/ISin.h +1 -0
  134. hikyuu/include/hikyuu/indicator/imp/ISlope.h +5 -1
  135. hikyuu/include/hikyuu/indicator/imp/ISma.h +2 -0
  136. hikyuu/include/hikyuu/indicator/imp/ISpearman.h +3 -0
  137. hikyuu/include/hikyuu/indicator/imp/ISqrt.h +1 -0
  138. hikyuu/include/hikyuu/indicator/imp/IStdev.h +5 -1
  139. hikyuu/include/hikyuu/indicator/imp/IStdp.h +5 -1
  140. hikyuu/include/hikyuu/indicator/imp/ISum.h +6 -1
  141. hikyuu/include/hikyuu/indicator/imp/ITan.h +1 -0
  142. hikyuu/include/hikyuu/indicator/imp/ITime.h +1 -2
  143. hikyuu/include/hikyuu/indicator/imp/ITimeLine.h +0 -2
  144. hikyuu/include/hikyuu/indicator/imp/ITr.h +1 -2
  145. hikyuu/include/hikyuu/indicator/imp/IVar.h +5 -1
  146. hikyuu/include/hikyuu/indicator/imp/IVarp.h +5 -1
  147. hikyuu/include/hikyuu/indicator/imp/IVigor.h +0 -2
  148. hikyuu/include/hikyuu/indicator/imp/IWma.h +5 -1
  149. hikyuu/include/hikyuu/indicator/imp/IZongGuBen.h +1 -2
  150. hikyuu/include/hikyuu/indicator_talib/imp/TaAdosc.h +0 -2
  151. hikyuu/include/hikyuu/indicator_talib/imp/TaSar.h +0 -2
  152. hikyuu/include/hikyuu/indicator_talib/imp/TaSarext.h +0 -4
  153. hikyuu/include/hikyuu/indicator_talib/imp/TaStoch.h +0 -3
  154. hikyuu/include/hikyuu/indicator_talib/imp/TaStochf.h +0 -2
  155. hikyuu/include/hikyuu/indicator_talib/imp/TaUltosc.h +0 -2
  156. hikyuu/include/hikyuu/indicator_talib/imp/ta_defines.h +2 -4
  157. hikyuu/include/hikyuu/indicator_talib/imp/ta_imp.h +70 -90
  158. hikyuu/include/hikyuu/plugin/hkuextra.h +2 -0
  159. hikyuu/include/hikyuu/plugin/interface/HkuExtraPluginInterface.h +2 -0
  160. hikyuu/include/hikyuu/python/pybind_utils.h +22 -5
  161. hikyuu/include/hikyuu/trade_manage/TradeCostBase.h +5 -3
  162. hikyuu/include/hikyuu/trade_manage/TradeManagerBase.h +9 -2
  163. hikyuu/include/hikyuu/trade_sys/allocatefunds/AllocateFundsBase.h +8 -3
  164. hikyuu/include/hikyuu/trade_sys/condition/ConditionBase.h +5 -2
  165. hikyuu/include/hikyuu/trade_sys/environment/EnvironmentBase.h +6 -2
  166. hikyuu/include/hikyuu/trade_sys/moneymanager/MoneyManagerBase.h +5 -2
  167. hikyuu/include/hikyuu/trade_sys/multifactor/MultiFactorBase.h +23 -19
  168. hikyuu/include/hikyuu/trade_sys/multifactor/NormalizeBase.h +6 -3
  169. hikyuu/include/hikyuu/trade_sys/multifactor/ScoresFilterBase.h +5 -2
  170. hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_EqualWeight.h +3 -3
  171. hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_ICIRWeight.h +4 -4
  172. hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_ICWeight.h +4 -4
  173. hikyuu/include/hikyuu/trade_sys/multifactor/crt/MF_Weight.h +4 -4
  174. hikyuu/include/hikyuu/trade_sys/portfolio/Portfolio.h +5 -2
  175. hikyuu/include/hikyuu/trade_sys/profitgoal/ProfitGoalBase.h +4 -2
  176. hikyuu/include/hikyuu/trade_sys/selector/SelectorBase.h +12 -2
  177. hikyuu/include/hikyuu/trade_sys/selector/crt/SE_MultiFactor.h +1 -1
  178. hikyuu/include/hikyuu/trade_sys/selector/crt/SE_MultiFactor2.h +1 -1
  179. hikyuu/include/hikyuu/trade_sys/selector/imp/MultiFactorSelector.h +1 -0
  180. hikyuu/include/hikyuu/trade_sys/selector/imp/MultiFactorSelector2.h +1 -0
  181. hikyuu/include/hikyuu/trade_sys/selector/imp/optimal/OptimalSelectorBase.h +0 -2
  182. hikyuu/include/hikyuu/trade_sys/selector/imp/optimal/PerformanceOptimalSelector.h +0 -4
  183. hikyuu/include/hikyuu/trade_sys/signal/SignalBase.h +5 -2
  184. hikyuu/include/hikyuu/trade_sys/slippage/SlippageBase.h +5 -2
  185. hikyuu/include/hikyuu/trade_sys/stoploss/StoplossBase.h +5 -2
  186. hikyuu/include/hikyuu/trade_sys/system/System.h +5 -2
  187. hikyuu/include/hikyuu/utilities/LruCache.h +299 -0
  188. hikyuu/include/hikyuu/utilities/arithmetic.h +2 -2
  189. hikyuu/include/hikyuu/utilities/omp_macro.h +25 -0
  190. hikyuu/include/hikyuu/utilities/plugin/PluginManager.h +5 -0
  191. hikyuu/include/hikyuu/utilities/thread/GlobalStealThreadPool.h +72 -19
  192. hikyuu/include/hikyuu/utilities/thread/GlobalThreadPool.h +0 -4
  193. hikyuu/include/hikyuu/utilities/thread/ThreadPool.h +0 -4
  194. hikyuu/include/hikyuu/utilities/thread/algorithm.h +286 -0
  195. hikyuu/include/hikyuu/version.h +4 -4
  196. hikyuu/plugin/backtest.dll +0 -0
  197. hikyuu/plugin/checkdata.dll +0 -0
  198. hikyuu/plugin/clickhousedriver.dll +0 -0
  199. hikyuu/plugin/dataserver.dll +0 -0
  200. hikyuu/plugin/dataserver_parquet.dll +0 -0
  201. hikyuu/plugin/device.dll +0 -0
  202. hikyuu/plugin/extind.dll +0 -0
  203. hikyuu/plugin/hkuextra.dll +0 -0
  204. hikyuu/plugin/import2ch.dll +0 -0
  205. hikyuu/plugin/import2hdf5.dll +0 -0
  206. hikyuu/plugin/import2mysql.dll +0 -0
  207. hikyuu/plugin/tmreport.dll +0 -0
  208. hikyuu/test/Indicator.py +1 -2
  209. hikyuu/trade_manage/__init__.pyi +6 -5
  210. hikyuu/trade_manage/trade.pyi +6 -5
  211. hikyuu/util/__init__.pyi +1 -1
  212. hikyuu/util/singleton.pyi +1 -1
  213. {hikyuu-2.7.3.dist-info → hikyuu-2.7.6.dist-info}/METADATA +1 -1
  214. {hikyuu-2.7.3.dist-info → hikyuu-2.7.6.dist-info}/RECORD +217 -210
  215. {hikyuu-2.7.3.dist-info → hikyuu-2.7.6.dist-info}/WHEEL +0 -0
  216. {hikyuu-2.7.3.dist-info → hikyuu-2.7.6.dist-info}/entry_points.txt +0 -0
  217. {hikyuu-2.7.3.dist-info → hikyuu-2.7.6.dist-info}/top_level.txt +0 -0
@@ -2,34 +2,15 @@
2
2
  "cells": [
3
3
  {
4
4
  "cell_type": "code",
5
- "execution_count": 1,
5
+ "execution_count": 9,
6
6
  "metadata": {},
7
7
  "outputs": [
8
- {
9
- "name": "stderr",
10
- "output_type": "stream",
11
- "text": [
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"
14
- ]
15
- },
16
8
  {
17
9
  "name": "stdout",
18
10
  "output_type": "stream",
19
11
  "text": [
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"
12
+ "CPU times: user 119 μs, sys: 477 μs, total: 596 μs\n",
13
+ "Wall time: 623 μs\n"
33
14
  ]
34
15
  }
35
16
  ],
@@ -56,7 +37,7 @@
56
37
  },
57
38
  {
58
39
  "cell_type": "code",
59
- "execution_count": 2,
40
+ "execution_count": 10,
60
41
  "metadata": {},
61
42
  "outputs": [
62
43
  {
@@ -80,7 +61,7 @@
80
61
  " current borrow_cash: 0.00,\n",
81
62
  " current borrow_asset: 0.00,\n",
82
63
  " Position: \n",
83
- " SZ000001 平安银行 2017-01-03 00:00:00 2090 100.00 911.00 1230.00 319.00 35.02% 0.32%\n",
64
+ " SZ000001 平安银行 2017-01-03 00:00:00 2200 100.00 911.00 1106.90 195.90 21.50% 0.20%\n",
84
65
  " Short Position: \n",
85
66
  " Borrow Stock: \n",
86
67
  "}\n"
@@ -100,7 +81,7 @@
100
81
  },
101
82
  {
102
83
  "cell_type": "code",
103
- "execution_count": 3,
84
+ "execution_count": 11,
104
85
  "metadata": {},
105
86
  "outputs": [
106
87
  {
@@ -126,21 +107,21 @@
126
107
  " <th></th>\n",
127
108
  " <th>证券代码</th>\n",
128
109
  " <th>证券名称</th>\n",
129
- " <th>买入时间</th>\n",
130
- " <th>持仓天数</th>\n",
110
+ " <th>开仓时间</th>\n",
111
+ " <th>持有天数</th>\n",
131
112
  " <th>持仓数量</th>\n",
132
- " <th>投入金额</th>\n",
133
- " <th>当前市值</th>\n",
134
- " <th>盈亏金额</th>\n",
135
- " <th>盈亏百分比</th>\n",
136
- " <th>止损价</th>\n",
137
- " <th>目标价</th>\n",
113
+ " <th>总投入资金</th>\n",
114
+ " <th>市值</th>\n",
115
+ " <th>收益</th>\n",
116
+ " <th>收益百分比</th>\n",
117
+ " <th>止损</th>\n",
118
+ " <th>目标价格</th>\n",
138
119
  " <th>清仓时间</th>\n",
139
- " <th>累计持有数量</th>\n",
120
+ " <th>累计持仓数量</th>\n",
140
121
  " <th>累计成本</th>\n",
141
122
  " <th>累计风险</th>\n",
142
- " <th>累计买入金额</th>\n",
143
- " <th>累计卖出金额</th>\n",
123
+ " <th>累计买入资金</th>\n",
124
+ " <th>累计卖出资金</th>\n",
144
125
  " </tr>\n",
145
126
  " </thead>\n",
146
127
  " <tbody>\n",
@@ -149,12 +130,12 @@
149
130
  " <td>SZ000001</td>\n",
150
131
  " <td>平安银行</td>\n",
151
132
  " <td>2017-01-03</td>\n",
152
- " <td>3142</td>\n",
133
+ " <td>3307</td>\n",
153
134
  " <td>100.0</td>\n",
154
135
  " <td>911.0</td>\n",
155
- " <td>1230.0</td>\n",
156
- " <td>319.0</td>\n",
157
- " <td>35.02</td>\n",
136
+ " <td>1106.9</td>\n",
137
+ " <td>195.9</td>\n",
138
+ " <td>21.5</td>\n",
158
139
  " <td>0.0</td>\n",
159
140
  " <td>0.0</td>\n",
160
141
  " <td>NaT</td>\n",
@@ -169,14 +150,17 @@
169
150
  "</div>"
170
151
  ],
171
152
  "text/plain": [
172
- " 证券代码 证券名称 买入时间 持仓天数 持仓数量 投入金额 当前市值 盈亏金额 盈亏百分比 止损价 \\\n",
173
- "0 SZ000001 平安银行 2017-01-03 3142 100.0 911.0 1230.0 319.0 35.02 0.0 \n",
153
+ " 证券代码 证券名称 开仓时间 持有天数 持仓数量 总投入资金 市值 \\\n",
154
+ "0 SZ000001 平安银行 2017-01-03 3307 100.0 911.0 1106.9 \n",
174
155
  "\n",
175
- " 目标价 清仓时间 累计持有数量 累计成本 累计风险 累计买入金额 累计卖出金额 \n",
176
- "0 0.0 NaT 100.0 0.0 911.0 911.0 0.0 "
156
+ " 收益 收益百分比 止损 目标价格 清仓时间 累计持仓数量 累计成本 \\\n",
157
+ "0 195.9 21.5 0.0 0.0 NaT 100.0 0.0 \n",
158
+ "\n",
159
+ " 累计风险 累计买入资金 累计卖出资金 \n",
160
+ "0 911.0 911.0 0.0 "
177
161
  ]
178
162
  },
179
- "execution_count": 3,
163
+ "execution_count": 11,
180
164
  "metadata": {},
181
165
  "output_type": "execute_result"
182
166
  }
@@ -189,7 +173,7 @@
189
173
  },
190
174
  {
191
175
  "cell_type": "code",
192
- "execution_count": 4,
176
+ "execution_count": 12,
193
177
  "metadata": {},
194
178
  "outputs": [
195
179
  {
@@ -215,20 +199,20 @@
215
199
  " <th></th>\n",
216
200
  " <th>证券代码</th>\n",
217
201
  " <th>证券名称</th>\n",
218
- " <th>交易时间</th>\n",
219
- " <th>业务名称</th>\n",
220
- " <th>计划交易价格</th>\n",
221
- " <th>实际成交价格</th>\n",
202
+ " <th>日期</th>\n",
203
+ " <th>交易操作</th>\n",
204
+ " <th>计划价格</th>\n",
205
+ " <th>实际价格</th>\n",
222
206
  " <th>目标价格</th>\n",
223
- " <th>交易数量</th>\n",
224
- " <th>止损价</th>\n",
225
- " <th>现金余额</th>\n",
226
- " <th>交易总成本</th>\n",
207
+ " <th>数量</th>\n",
208
+ " <th>止损</th>\n",
209
+ " <th>现金</th>\n",
210
+ " <th>总成本</th>\n",
227
211
  " <th>佣金</th>\n",
228
212
  " <th>印花税</th>\n",
229
213
  " <th>过户费</th>\n",
230
214
  " <th>其它成本</th>\n",
231
- " <th>信号来源</th>\n",
215
+ " <th>来源</th>\n",
232
216
  " <th>备注</th>\n",
233
217
  " </tr>\n",
234
218
  " </thead>\n",
@@ -278,16 +262,16 @@
278
262
  "</div>"
279
263
  ],
280
264
  "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",
265
+ " 证券代码 证券名称 日期 交易操作 计划价格 实际价格 目标价格 \\\n",
266
+ "0 2017-01-01 INIT 100000.0 100000.00 0.0 \n",
267
+ "1 SZ000001 平安银行 2017-01-03 BUY 0.0 9.11 0.0 \n",
284
268
  "\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 -- "
269
+ " 数量 止损 现金 总成本 佣金 印花税 过户费 其它成本 来源 备注 \n",
270
+ "0 0.0 0.0 100000.0 0.0 0.0 0.0 0.0 0.0 -- \n",
271
+ "1 100.0 0.0 99089.0 0.0 0.0 0.0 0.0 0.0 -- "
288
272
  ]
289
273
  },
290
- "execution_count": 4,
274
+ "execution_count": 12,
291
275
  "metadata": {},
292
276
  "output_type": "execute_result"
293
277
  }
@@ -298,7 +282,7 @@
298
282
  },
299
283
  {
300
284
  "cell_type": "code",
301
- "execution_count": 5,
285
+ "execution_count": 13,
302
286
  "metadata": {},
303
287
  "outputs": [
304
288
  {
@@ -326,7 +310,7 @@
326
310
  "}"
327
311
  ]
328
312
  },
329
- "execution_count": 5,
313
+ "execution_count": 13,
330
314
  "metadata": {},
331
315
  "output_type": "execute_result"
332
316
  }
@@ -353,9 +337,17 @@
353
337
  },
354
338
  {
355
339
  "cell_type": "code",
356
- "execution_count": 6,
340
+ "execution_count": 14,
357
341
  "metadata": {},
358
- "outputs": [],
342
+ "outputs": [
343
+ {
344
+ "name": "stdout",
345
+ "output_type": "stream",
346
+ "text": [
347
+ "2026-01-23 01:29:42.637 [HKU-E] - Can't create file d:/stock/SYS_交易记录.csv! (TradeManager.cpp:1640)\n"
348
+ ]
349
+ }
350
+ ],
359
351
  "source": [
360
352
  "#在 hikyuu_XXX.ini 文件中配置的临时路径中输出\n",
361
353
  "my_tm.tocsv(sm.tmpdir())"
@@ -379,36 +371,26 @@
379
371
  },
380
372
  {
381
373
  "cell_type": "code",
382
- "execution_count": 7,
374
+ "execution_count": null,
383
375
  "metadata": {},
384
376
  "outputs": [],
385
377
  "source": [
386
378
  "#保存至指定文件\n",
387
379
  "from datetime import date\n",
388
- "filename = \"{}/my_trade/my_trade_record_{}.xml\".format(sm.tmpdir(), date.today());\n",
380
+ "filename = \"my_trade_record_{}.pkl\".format(date.today())\n",
389
381
  "hku_save(my_tm, filename)"
390
382
  ]
391
383
  },
392
384
  {
393
385
  "cell_type": "code",
394
- "execution_count": 8,
386
+ "execution_count": null,
395
387
  "metadata": {},
396
388
  "outputs": [],
397
389
  "source": [
398
390
  "#载入已保存的TM对象\n",
399
- "#filename = \"{}/my_trade/my_trade_record_{}.xml\".format(sm.tmpdir(), date.today())\n",
400
391
  "new_my_tm = hku_load(filename)"
401
392
  ]
402
393
  },
403
- {
404
- "cell_type": "markdown",
405
- "metadata": {},
406
- "source": [
407
- "使用 hku_save 保存的对象,其格式为XML文件,可直接使用 XML 工具或浏览器查看:\n",
408
- "\n",
409
- "<img src=\"images/008_03_pickle.png\" align=\"left\">"
410
- ]
411
- },
412
394
  {
413
395
  "cell_type": "markdown",
414
396
  "metadata": {},
@@ -418,25 +400,29 @@
418
400
  },
419
401
  {
420
402
  "cell_type": "code",
421
- "execution_count": 9,
403
+ "execution_count": 17,
422
404
  "metadata": {},
423
405
  "outputs": [
424
406
  {
425
407
  "name": "stdout",
426
408
  "output_type": "stream",
427
409
  "text": [
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",
410
+ "买入:SZ000001, 价格: 11.81, 数量: 1000.0 预期止损价: 0.0, 预期目标价: nan, 信号来源: SystemPart.SIGNAL, 备注: \n",
437
411
  "卖出:SZ000001, 价格: 12.46, 数量: 1000.0, 信号来源: SystemPart.SIGNAL, 备注: \n",
438
412
  "买入:SZ000001, 价格: 12.48, 数量: 1000.0 预期止损价: 0.0, 预期目标价: nan, 信号来源: SystemPart.SIGNAL, 备注: \n",
439
- "卖出:SZ000001, 价格: 12.4, 数量: 1000.0, 信号来源: SystemPart.SIGNAL, 备注: \n"
413
+ "卖出:SZ000001, 价格: 12.4, 数量: 1000.0, 信号来源: SystemPart.SIGNAL, 备注: \n",
414
+ "买入:SZ000001, 价格: 12.450000000000001, 数量: 1000.0 预期止损价: 0.0, 预期目标价: nan, 信号来源: SystemPart.SIGNAL, 备注: \n",
415
+ "卖出:SZ000001, 价格: 12.09, 数量: 1000.0, 信号来源: SystemPart.SIGNAL, 备注: \n",
416
+ "买入:SZ000001, 价格: 11.5, 数量: 1000.0 预期止损价: 0.0, 预期目标价: nan, 信号来源: SystemPart.SIGNAL, 备注: \n",
417
+ "卖出:SZ000001, 价格: 11.41, 数量: 1000.0, 信号来源: SystemPart.SIGNAL, 备注: \n",
418
+ "买入:SZ000001, 价格: 11.52, 数量: 1000.0 预期止损价: 0.0, 预期目标价: nan, 信号来源: SystemPart.SIGNAL, 备注: \n",
419
+ "卖出:SZ000001, 价格: 11.38, 数量: 1000.0, 信号来源: SystemPart.SIGNAL, 备注: \n",
420
+ "买入:SZ000001, 价格: 11.59, 数量: 1000.0 预期止损价: 0.0, 预期目标价: nan, 信号来源: SystemPart.SIGNAL, 备注: \n",
421
+ "卖出:SZ000001, 价格: 11.6, 数量: 1000.0, 信号来源: SystemPart.SIGNAL, 备注: \n",
422
+ "买入:SZ000001, 价格: 11.63, 数量: 1000.0 预期止损价: 0.0, 预期目标价: nan, 信号来源: SystemPart.SIGNAL, 备注: \n",
423
+ "卖出:SZ000001, 价格: 11.479000000000001, 数量: 1000.0, 信号来源: SystemPart.SIGNAL, 备注: \n",
424
+ "买入:SZ000001, 价格: 11.659, 数量: 1000.0 预期止损价: 0.0, 预期目标价: nan, 信号来源: SystemPart.SIGNAL, 备注: \n",
425
+ "卖出:SZ000001, 价格: 11.449, 数量: 1000.0, 信号来源: SystemPart.SIGNAL, 备注: \n"
440
426
  ]
441
427
  }
442
428
  ],
@@ -466,7 +452,7 @@
466
452
  },
467
453
  {
468
454
  "cell_type": "code",
469
- "execution_count": 10,
455
+ "execution_count": 18,
470
456
  "metadata": {},
471
457
  "outputs": [
472
458
  {
@@ -492,20 +478,20 @@
492
478
  " <th></th>\n",
493
479
  " <th>证券代码</th>\n",
494
480
  " <th>证券名称</th>\n",
495
- " <th>交易时间</th>\n",
496
- " <th>业务名称</th>\n",
497
- " <th>计划交易价格</th>\n",
498
- " <th>实际成交价格</th>\n",
481
+ " <th>日期</th>\n",
482
+ " <th>交易操作</th>\n",
483
+ " <th>计划价格</th>\n",
484
+ " <th>实际价格</th>\n",
499
485
  " <th>目标价格</th>\n",
500
- " <th>交易数量</th>\n",
501
- " <th>止损价</th>\n",
502
- " <th>现金余额</th>\n",
503
- " <th>交易总成本</th>\n",
486
+ " <th>数量</th>\n",
487
+ " <th>止损</th>\n",
488
+ " <th>现金</th>\n",
489
+ " <th>总成本</th>\n",
504
490
  " <th>佣金</th>\n",
505
491
  " <th>印花税</th>\n",
506
492
  " <th>过户费</th>\n",
507
493
  " <th>其它成本</th>\n",
508
- " <th>信号来源</th>\n",
494
+ " <th>来源</th>\n",
509
495
  " <th>备注</th>\n",
510
496
  " </tr>\n",
511
497
  " </thead>\n",
@@ -516,8 +502,8 @@
516
502
  " <td></td>\n",
517
503
  " <td>2017-01-01</td>\n",
518
504
  " <td>INIT</td>\n",
519
- " <td>300000.00</td>\n",
520
- " <td>300000.00</td>\n",
505
+ " <td>300000.000</td>\n",
506
+ " <td>300000.000</td>\n",
521
507
  " <td>0.0</td>\n",
522
508
  " <td>0.0</td>\n",
523
509
  " <td>0.0</td>\n",
@@ -534,14 +520,14 @@
534
520
  " <th>1</th>\n",
535
521
  " <td>SZ000001</td>\n",
536
522
  " <td>平安银行</td>\n",
537
- " <td>2025-02-11</td>\n",
523
+ " <td>2025-06-23</td>\n",
538
524
  " <td>BUY</td>\n",
539
- " <td>11.40</td>\n",
540
- " <td>11.40</td>\n",
525
+ " <td>11.810</td>\n",
526
+ " <td>11.810</td>\n",
541
527
  " <td>NaN</td>\n",
542
528
  " <td>1000.0</td>\n",
543
529
  " <td>0.0</td>\n",
544
- " <td>288600.0</td>\n",
530
+ " <td>288190.0</td>\n",
545
531
  " <td>0.0</td>\n",
546
532
  " <td>0.0</td>\n",
547
533
  " <td>0.0</td>\n",
@@ -554,14 +540,14 @@
554
540
  " <th>2</th>\n",
555
541
  " <td>SZ000001</td>\n",
556
542
  " <td>平安银行</td>\n",
557
- " <td>2025-02-27</td>\n",
543
+ " <td>2025-07-23</td>\n",
558
544
  " <td>SELL</td>\n",
559
- " <td>11.53</td>\n",
560
- " <td>11.53</td>\n",
545
+ " <td>12.460</td>\n",
546
+ " <td>12.460</td>\n",
561
547
  " <td>NaN</td>\n",
562
548
  " <td>1000.0</td>\n",
563
549
  " <td>0.0</td>\n",
564
- " <td>300130.0</td>\n",
550
+ " <td>300650.0</td>\n",
565
551
  " <td>0.0</td>\n",
566
552
  " <td>0.0</td>\n",
567
553
  " <td>0.0</td>\n",
@@ -574,14 +560,14 @@
574
560
  " <th>3</th>\n",
575
561
  " <td>SZ000001</td>\n",
576
562
  " <td>平安银行</td>\n",
577
- " <td>2025-02-28</td>\n",
563
+ " <td>2025-08-08</td>\n",
578
564
  " <td>BUY</td>\n",
579
- " <td>11.58</td>\n",
580
- " <td>11.58</td>\n",
565
+ " <td>12.480</td>\n",
566
+ " <td>12.480</td>\n",
581
567
  " <td>NaN</td>\n",
582
568
  " <td>1000.0</td>\n",
583
569
  " <td>0.0</td>\n",
584
- " <td>288550.0</td>\n",
570
+ " <td>288170.0</td>\n",
585
571
  " <td>0.0</td>\n",
586
572
  " <td>0.0</td>\n",
587
573
  " <td>0.0</td>\n",
@@ -594,14 +580,14 @@
594
580
  " <th>4</th>\n",
595
581
  " <td>SZ000001</td>\n",
596
582
  " <td>平安银行</td>\n",
597
- " <td>2025-03-03</td>\n",
583
+ " <td>2025-08-11</td>\n",
598
584
  " <td>SELL</td>\n",
599
- " <td>11.52</td>\n",
600
- " <td>11.52</td>\n",
585
+ " <td>12.400</td>\n",
586
+ " <td>12.400</td>\n",
601
587
  " <td>NaN</td>\n",
602
588
  " <td>1000.0</td>\n",
603
589
  " <td>0.0</td>\n",
604
- " <td>300070.0</td>\n",
590
+ " <td>300570.0</td>\n",
605
591
  " <td>0.0</td>\n",
606
592
  " <td>0.0</td>\n",
607
593
  " <td>0.0</td>\n",
@@ -614,14 +600,14 @@
614
600
  " <th>5</th>\n",
615
601
  " <td>SZ000001</td>\n",
616
602
  " <td>平安银行</td>\n",
617
- " <td>2025-03-06</td>\n",
603
+ " <td>2025-08-26</td>\n",
618
604
  " <td>BUY</td>\n",
619
- " <td>11.69</td>\n",
620
- " <td>11.69</td>\n",
605
+ " <td>12.450</td>\n",
606
+ " <td>12.450</td>\n",
621
607
  " <td>NaN</td>\n",
622
608
  " <td>1000.0</td>\n",
623
609
  " <td>0.0</td>\n",
624
- " <td>288380.0</td>\n",
610
+ " <td>288120.0</td>\n",
625
611
  " <td>0.0</td>\n",
626
612
  " <td>0.0</td>\n",
627
613
  " <td>0.0</td>\n",
@@ -634,14 +620,14 @@
634
620
  " <th>6</th>\n",
635
621
  " <td>SZ000001</td>\n",
636
622
  " <td>平安银行</td>\n",
637
- " <td>2025-03-19</td>\n",
623
+ " <td>2025-08-28</td>\n",
638
624
  " <td>SELL</td>\n",
639
- " <td>11.48</td>\n",
640
- " <td>11.48</td>\n",
625
+ " <td>12.090</td>\n",
626
+ " <td>12.090</td>\n",
641
627
  " <td>NaN</td>\n",
642
628
  " <td>1000.0</td>\n",
643
629
  " <td>0.0</td>\n",
644
- " <td>299860.0</td>\n",
630
+ " <td>300210.0</td>\n",
645
631
  " <td>0.0</td>\n",
646
632
  " <td>0.0</td>\n",
647
633
  " <td>0.0</td>\n",
@@ -654,14 +640,14 @@
654
640
  " <th>7</th>\n",
655
641
  " <td>SZ000001</td>\n",
656
642
  " <td>平安银行</td>\n",
657
- " <td>2025-04-21</td>\n",
643
+ " <td>2025-10-17</td>\n",
658
644
  " <td>BUY</td>\n",
659
- " <td>11.00</td>\n",
660
- " <td>11.00</td>\n",
645
+ " <td>11.500</td>\n",
646
+ " <td>11.500</td>\n",
661
647
  " <td>NaN</td>\n",
662
648
  " <td>1000.0</td>\n",
663
649
  " <td>0.0</td>\n",
664
- " <td>288860.0</td>\n",
650
+ " <td>288710.0</td>\n",
665
651
  " <td>0.0</td>\n",
666
652
  " <td>0.0</td>\n",
667
653
  " <td>0.0</td>\n",
@@ -674,14 +660,14 @@
674
660
  " <th>8</th>\n",
675
661
  " <td>SZ000001</td>\n",
676
662
  " <td>平安银行</td>\n",
677
- " <td>2025-04-24</td>\n",
663
+ " <td>2025-10-20</td>\n",
678
664
  " <td>SELL</td>\n",
679
- " <td>11.00</td>\n",
680
- " <td>11.00</td>\n",
665
+ " <td>11.410</td>\n",
666
+ " <td>11.410</td>\n",
681
667
  " <td>NaN</td>\n",
682
668
  " <td>1000.0</td>\n",
683
669
  " <td>0.0</td>\n",
684
- " <td>299860.0</td>\n",
670
+ " <td>300120.0</td>\n",
685
671
  " <td>0.0</td>\n",
686
672
  " <td>0.0</td>\n",
687
673
  " <td>0.0</td>\n",
@@ -694,14 +680,14 @@
694
680
  " <th>9</th>\n",
695
681
  " <td>SZ000001</td>\n",
696
682
  " <td>平安银行</td>\n",
697
- " <td>2025-05-09</td>\n",
683
+ " <td>2025-10-23</td>\n",
698
684
  " <td>BUY</td>\n",
699
- " <td>11.07</td>\n",
700
- " <td>11.07</td>\n",
685
+ " <td>11.520</td>\n",
686
+ " <td>11.520</td>\n",
701
687
  " <td>NaN</td>\n",
702
688
  " <td>1000.0</td>\n",
703
689
  " <td>0.0</td>\n",
704
- " <td>288790.0</td>\n",
690
+ " <td>288600.0</td>\n",
705
691
  " <td>0.0</td>\n",
706
692
  " <td>0.0</td>\n",
707
693
  " <td>0.0</td>\n",
@@ -714,34 +700,54 @@
714
700
  " <th>10</th>\n",
715
701
  " <td>SZ000001</td>\n",
716
702
  " <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",
703
+ " <td>2025-10-30</td>\n",
704
+ " <td>SELL</td>\n",
705
+ " <td>11.380</td>\n",
706
+ " <td>11.380</td>\n",
707
+ " <td>NaN</td>\n",
708
+ " <td>1000.0</td>\n",
721
709
  " <td>0.0</td>\n",
710
+ " <td>299980.0</td>\n",
722
711
  " <td>0.0</td>\n",
723
712
  " <td>0.0</td>\n",
724
- " <td>289514.0</td>\n",
725
713
  " <td>0.0</td>\n",
726
714
  " <td>0.0</td>\n",
727
715
  " <td>0.0</td>\n",
716
+ " <td>SG</td>\n",
717
+ " <td></td>\n",
718
+ " </tr>\n",
719
+ " <tr>\n",
720
+ " <th>11</th>\n",
721
+ " <td>SZ000001</td>\n",
722
+ " <td>平安银行</td>\n",
723
+ " <td>2025-11-05</td>\n",
724
+ " <td>BUY</td>\n",
725
+ " <td>11.590</td>\n",
726
+ " <td>11.590</td>\n",
727
+ " <td>NaN</td>\n",
728
+ " <td>1000.0</td>\n",
728
729
  " <td>0.0</td>\n",
730
+ " <td>288390.0</td>\n",
729
731
  " <td>0.0</td>\n",
730
- " <td>--</td>\n",
732
+ " <td>0.0</td>\n",
733
+ " <td>0.0</td>\n",
734
+ " <td>0.0</td>\n",
735
+ " <td>0.0</td>\n",
736
+ " <td>SG</td>\n",
731
737
  " <td></td>\n",
732
738
  " </tr>\n",
733
739
  " <tr>\n",
734
- " <th>11</th>\n",
740
+ " <th>12</th>\n",
735
741
  " <td>SZ000001</td>\n",
736
742
  " <td>平安银行</td>\n",
737
- " <td>2025-07-23</td>\n",
743
+ " <td>2025-12-01</td>\n",
738
744
  " <td>SELL</td>\n",
739
- " <td>12.46</td>\n",
740
- " <td>12.46</td>\n",
745
+ " <td>11.600</td>\n",
746
+ " <td>11.600</td>\n",
741
747
  " <td>NaN</td>\n",
742
748
  " <td>1000.0</td>\n",
743
749
  " <td>0.0</td>\n",
744
- " <td>301612.0</td>\n",
750
+ " <td>299990.0</td>\n",
745
751
  " <td>0.0</td>\n",
746
752
  " <td>0.0</td>\n",
747
753
  " <td>0.0</td>\n",
@@ -751,17 +757,17 @@
751
757
  " <td></td>\n",
752
758
  " </tr>\n",
753
759
  " <tr>\n",
754
- " <th>12</th>\n",
760
+ " <th>13</th>\n",
755
761
  " <td>SZ000001</td>\n",
756
762
  " <td>平安银行</td>\n",
757
- " <td>2025-08-08</td>\n",
763
+ " <td>2025-12-19</td>\n",
758
764
  " <td>BUY</td>\n",
759
- " <td>12.48</td>\n",
760
- " <td>12.48</td>\n",
765
+ " <td>11.630</td>\n",
766
+ " <td>11.630</td>\n",
761
767
  " <td>NaN</td>\n",
762
768
  " <td>1000.0</td>\n",
763
769
  " <td>0.0</td>\n",
764
- " <td>289132.0</td>\n",
770
+ " <td>288360.0</td>\n",
765
771
  " <td>0.0</td>\n",
766
772
  " <td>0.0</td>\n",
767
773
  " <td>0.0</td>\n",
@@ -771,17 +777,57 @@
771
777
  " <td></td>\n",
772
778
  " </tr>\n",
773
779
  " <tr>\n",
774
- " <th>13</th>\n",
780
+ " <th>14</th>\n",
775
781
  " <td>SZ000001</td>\n",
776
782
  " <td>平安银行</td>\n",
777
- " <td>2025-08-11</td>\n",
783
+ " <td>2025-12-31</td>\n",
784
+ " <td>SELL</td>\n",
785
+ " <td>11.479</td>\n",
786
+ " <td>11.479</td>\n",
787
+ " <td>NaN</td>\n",
788
+ " <td>1000.0</td>\n",
789
+ " <td>0.0</td>\n",
790
+ " <td>299839.0</td>\n",
791
+ " <td>0.0</td>\n",
792
+ " <td>0.0</td>\n",
793
+ " <td>0.0</td>\n",
794
+ " <td>0.0</td>\n",
795
+ " <td>0.0</td>\n",
796
+ " <td>SG</td>\n",
797
+ " <td></td>\n",
798
+ " </tr>\n",
799
+ " <tr>\n",
800
+ " <th>15</th>\n",
801
+ " <td>SZ000001</td>\n",
802
+ " <td>平安银行</td>\n",
803
+ " <td>2026-01-07</td>\n",
804
+ " <td>BUY</td>\n",
805
+ " <td>11.659</td>\n",
806
+ " <td>11.659</td>\n",
807
+ " <td>NaN</td>\n",
808
+ " <td>1000.0</td>\n",
809
+ " <td>0.0</td>\n",
810
+ " <td>288180.0</td>\n",
811
+ " <td>0.0</td>\n",
812
+ " <td>0.0</td>\n",
813
+ " <td>0.0</td>\n",
814
+ " <td>0.0</td>\n",
815
+ " <td>0.0</td>\n",
816
+ " <td>SG</td>\n",
817
+ " <td></td>\n",
818
+ " </tr>\n",
819
+ " <tr>\n",
820
+ " <th>16</th>\n",
821
+ " <td>SZ000001</td>\n",
822
+ " <td>平安银行</td>\n",
823
+ " <td>2026-01-12</td>\n",
778
824
  " <td>SELL</td>\n",
779
- " <td>12.40</td>\n",
780
- " <td>12.40</td>\n",
825
+ " <td>11.449</td>\n",
826
+ " <td>11.449</td>\n",
781
827
  " <td>NaN</td>\n",
782
828
  " <td>1000.0</td>\n",
783
829
  " <td>0.0</td>\n",
784
- " <td>301532.0</td>\n",
830
+ " <td>299629.0</td>\n",
785
831
  " <td>0.0</td>\n",
786
832
  " <td>0.0</td>\n",
787
833
  " <td>0.0</td>\n",
@@ -795,40 +841,46 @@
795
841
  "</div>"
796
842
  ],
797
843
  "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",
844
+ " 证券代码 证券名称 日期 交易操作 计划价格 实际价格 目标价格 \\\n",
845
+ "0 2017-01-01 INIT 300000.000 300000.000 0.0 \n",
846
+ "1 SZ000001 平安银行 2025-06-23 BUY 11.810 11.810 NaN \n",
847
+ "2 SZ000001 平安银行 2025-07-23 SELL 12.460 12.460 NaN \n",
848
+ "3 SZ000001 平安银行 2025-08-08 BUY 12.480 12.480 NaN \n",
849
+ "4 SZ000001 平安银行 2025-08-11 SELL 12.400 12.400 NaN \n",
850
+ "5 SZ000001 平安银行 2025-08-26 BUY 12.450 12.450 NaN \n",
851
+ "6 SZ000001 平安银行 2025-08-28 SELL 12.090 12.090 NaN \n",
852
+ "7 SZ000001 平安银行 2025-10-17 BUY 11.500 11.500 NaN \n",
853
+ "8 SZ000001 平安银行 2025-10-20 SELL 11.410 11.410 NaN \n",
854
+ "9 SZ000001 平安银行 2025-10-23 BUY 11.520 11.520 NaN \n",
855
+ "10 SZ000001 平安银行 2025-10-30 SELL 11.380 11.380 NaN \n",
856
+ "11 SZ000001 平安银行 2025-11-05 BUY 11.590 11.590 NaN \n",
857
+ "12 SZ000001 平安银行 2025-12-01 SELL 11.600 11.600 NaN \n",
858
+ "13 SZ000001 平安银行 2025-12-19 BUY 11.630 11.630 NaN \n",
859
+ "14 SZ000001 平安银行 2025-12-31 SELL 11.479 11.479 NaN \n",
860
+ "15 SZ000001 平安银行 2026-01-07 BUY 11.659 11.659 NaN \n",
861
+ "16 SZ000001 平安银行 2026-01-12 SELL 11.449 11.449 NaN \n",
813
862
  "\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 "
863
+ " 数量 止损 现金 总成本 佣金 印花税 过户费 其它成本 来源 备注 \n",
864
+ "0 0.0 0.0 300000.0 0.0 0.0 0.0 0.0 0.0 -- \n",
865
+ "1 1000.0 0.0 288190.0 0.0 0.0 0.0 0.0 0.0 SG \n",
866
+ "2 1000.0 0.0 300650.0 0.0 0.0 0.0 0.0 0.0 SG \n",
867
+ "3 1000.0 0.0 288170.0 0.0 0.0 0.0 0.0 0.0 SG \n",
868
+ "4 1000.0 0.0 300570.0 0.0 0.0 0.0 0.0 0.0 SG \n",
869
+ "5 1000.0 0.0 288120.0 0.0 0.0 0.0 0.0 0.0 SG \n",
870
+ "6 1000.0 0.0 300210.0 0.0 0.0 0.0 0.0 0.0 SG \n",
871
+ "7 1000.0 0.0 288710.0 0.0 0.0 0.0 0.0 0.0 SG \n",
872
+ "8 1000.0 0.0 300120.0 0.0 0.0 0.0 0.0 0.0 SG \n",
873
+ "9 1000.0 0.0 288600.0 0.0 0.0 0.0 0.0 0.0 SG \n",
874
+ "10 1000.0 0.0 299980.0 0.0 0.0 0.0 0.0 0.0 SG \n",
875
+ "11 1000.0 0.0 288390.0 0.0 0.0 0.0 0.0 0.0 SG \n",
876
+ "12 1000.0 0.0 299990.0 0.0 0.0 0.0 0.0 0.0 SG \n",
877
+ "13 1000.0 0.0 288360.0 0.0 0.0 0.0 0.0 0.0 SG \n",
878
+ "14 1000.0 0.0 299839.0 0.0 0.0 0.0 0.0 0.0 SG \n",
879
+ "15 1000.0 0.0 288180.0 0.0 0.0 0.0 0.0 0.0 SG \n",
880
+ "16 1000.0 0.0 299629.0 0.0 0.0 0.0 0.0 0.0 SG "
829
881
  ]
830
882
  },
831
- "execution_count": 10,
883
+ "execution_count": 18,
832
884
  "metadata": {},
833
885
  "output_type": "execute_result"
834
886
  }
@@ -839,7 +891,7 @@
839
891
  },
840
892
  {
841
893
  "cell_type": "code",
842
- "execution_count": 11,
894
+ "execution_count": 19,
843
895
  "metadata": {
844
896
  "scrolled": true
845
897
  },
@@ -847,24 +899,27 @@
847
899
  {
848
900
  "data": {
849
901
  "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')])"
902
+ "array([('', '', '2017-01-01T00:00:00.000000000', 'INIT', 3.0000e+05, 3.0000e+05, 0., 0., 0., 300000., 0., 0., 0., 0., 0., '--', ''),\n",
903
+ " ('SZ000001', '平安银行', '2025-06-23T00:00:00.000000000', 'BUY', 1.1810e+01, 1.1810e+01, nan, 1000., 0., 288190., 0., 0., 0., 0., 0., 'SG', ''),\n",
904
+ " ('SZ000001', '平安银行', '2025-07-23T00:00:00.000000000', 'SELL', 1.2460e+01, 1.2460e+01, nan, 1000., 0., 300650., 0., 0., 0., 0., 0., 'SG', ''),\n",
905
+ " ('SZ000001', '平安银行', '2025-08-08T00:00:00.000000000', 'BUY', 1.2480e+01, 1.2480e+01, nan, 1000., 0., 288170., 0., 0., 0., 0., 0., 'SG', ''),\n",
906
+ " ('SZ000001', '平安银行', '2025-08-11T00:00:00.000000000', 'SELL', 1.2400e+01, 1.2400e+01, nan, 1000., 0., 300570., 0., 0., 0., 0., 0., 'SG', ''),\n",
907
+ " ('SZ000001', '平安银行', '2025-08-26T00:00:00.000000000', 'BUY', 1.2450e+01, 1.2450e+01, nan, 1000., 0., 288120., 0., 0., 0., 0., 0., 'SG', ''),\n",
908
+ " ('SZ000001', '平安银行', '2025-08-28T00:00:00.000000000', 'SELL', 1.2090e+01, 1.2090e+01, nan, 1000., 0., 300210., 0., 0., 0., 0., 0., 'SG', ''),\n",
909
+ " ('SZ000001', '平安银行', '2025-10-17T00:00:00.000000000', 'BUY', 1.1500e+01, 1.1500e+01, nan, 1000., 0., 288710., 0., 0., 0., 0., 0., 'SG', ''),\n",
910
+ " ('SZ000001', '平安银行', '2025-10-20T00:00:00.000000000', 'SELL', 1.1410e+01, 1.1410e+01, nan, 1000., 0., 300120., 0., 0., 0., 0., 0., 'SG', ''),\n",
911
+ " ('SZ000001', '平安银行', '2025-10-23T00:00:00.000000000', 'BUY', 1.1520e+01, 1.1520e+01, nan, 1000., 0., 288600., 0., 0., 0., 0., 0., 'SG', ''),\n",
912
+ " ('SZ000001', '平安银行', '2025-10-30T00:00:00.000000000', 'SELL', 1.1380e+01, 1.1380e+01, nan, 1000., 0., 299980., 0., 0., 0., 0., 0., 'SG', ''),\n",
913
+ " ('SZ000001', '平安银行', '2025-11-05T00:00:00.000000000', 'BUY', 1.1590e+01, 1.1590e+01, nan, 1000., 0., 288390., 0., 0., 0., 0., 0., 'SG', ''),\n",
914
+ " ('SZ000001', '平安银行', '2025-12-01T00:00:00.000000000', 'SELL', 1.1600e+01, 1.1600e+01, nan, 1000., 0., 299990., 0., 0., 0., 0., 0., 'SG', ''),\n",
915
+ " ('SZ000001', '平安银行', '2025-12-19T00:00:00.000000000', 'BUY', 1.1630e+01, 1.1630e+01, nan, 1000., 0., 288360., 0., 0., 0., 0., 0., 'SG', ''),\n",
916
+ " ('SZ000001', '平安银行', '2025-12-31T00:00:00.000000000', 'SELL', 1.1479e+01, 1.1479e+01, nan, 1000., 0., 299839., 0., 0., 0., 0., 0., 'SG', ''),\n",
917
+ " ('SZ000001', '平安银行', '2026-01-07T00:00:00.000000000', 'BUY', 1.1659e+01, 1.1659e+01, nan, 1000., 0., 288180., 0., 0., 0., 0., 0., 'SG', ''),\n",
918
+ " ('SZ000001', '平安银行', '2026-01-12T00:00:00.000000000', 'SELL', 1.1449e+01, 1.1449e+01, nan, 1000., 0., 299629., 0., 0., 0., 0., 0., 'SG', '')],\n",
919
+ " dtype=[('证券代码', '<U10'), ('证券名称', '<U20'), ('日期', '<M8[ns]'), ('交易操作', '<U20'), ('计划价格', '<f8'), ('实际价格', '<f8'), ('目标价格', '<f8'), ('数量', '<f8'), ('止损', '<f8'), ('现金', '<f8'), ('总成本', '<f8'), ('佣金', '<f8'), ('印花税', '<f8'), ('过户费', '<f8'), ('其它成本', '<f8'), ('来源', '<U20'), ('备注', '<U100')])"
865
920
  ]
866
921
  },
867
- "execution_count": 11,
922
+ "execution_count": 19,
868
923
  "metadata": {},
869
924
  "output_type": "execute_result"
870
925
  }
@@ -875,7 +930,7 @@
875
930
  },
876
931
  {
877
932
  "cell_type": "code",
878
- "execution_count": 12,
933
+ "execution_count": 20,
879
934
  "metadata": {},
880
935
  "outputs": [
881
936
  {
@@ -901,21 +956,21 @@
901
956
  " <th></th>\n",
902
957
  " <th>证券代码</th>\n",
903
958
  " <th>证券名称</th>\n",
904
- " <th>买入时间</th>\n",
905
- " <th>持仓天数</th>\n",
959
+ " <th>开仓时间</th>\n",
960
+ " <th>持有天数</th>\n",
906
961
  " <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",
962
+ " <th>总投入资金</th>\n",
963
+ " <th>市值</th>\n",
964
+ " <th>收益</th>\n",
965
+ " <th>收益百分比</th>\n",
966
+ " <th>止损</th>\n",
967
+ " <th>目标价格</th>\n",
913
968
  " <th>清仓时间</th>\n",
914
- " <th>累计持有数量</th>\n",
969
+ " <th>累计持仓数量</th>\n",
915
970
  " <th>累计成本</th>\n",
916
971
  " <th>累计风险</th>\n",
917
- " <th>累计买入金额</th>\n",
918
- " <th>累计卖出金额</th>\n",
972
+ " <th>累计买入资金</th>\n",
973
+ " <th>累计卖出资金</th>\n",
919
974
  " </tr>\n",
920
975
  " </thead>\n",
921
976
  " <tbody>\n",
@@ -923,145 +978,199 @@
923
978
  " <th>0</th>\n",
924
979
  " <td>SZ000001</td>\n",
925
980
  " <td>平安银行</td>\n",
926
- " <td>2025-02-11</td>\n",
927
- " <td>16</td>\n",
981
+ " <td>2025-06-23</td>\n",
982
+ " <td>30</td>\n",
928
983
  " <td>0.0</td>\n",
929
- " <td>-130.0</td>\n",
984
+ " <td>-650.0</td>\n",
930
985
  " <td>0.0</td>\n",
931
- " <td>130.0</td>\n",
986
+ " <td>650.0</td>\n",
932
987
  " <td>-100.0</td>\n",
933
988
  " <td>0.0</td>\n",
934
989
  " <td>NaN</td>\n",
935
- " <td>2025-02-27</td>\n",
990
+ " <td>2025-07-23</td>\n",
936
991
  " <td>1000.0</td>\n",
937
992
  " <td>0.0</td>\n",
938
- " <td>11400.0</td>\n",
939
- " <td>11400.0</td>\n",
940
- " <td>11530.0</td>\n",
993
+ " <td>11810.0</td>\n",
994
+ " <td>11810.0</td>\n",
995
+ " <td>12460.0</td>\n",
941
996
  " </tr>\n",
942
997
  " <tr>\n",
943
998
  " <th>1</th>\n",
944
999
  " <td>SZ000001</td>\n",
945
1000
  " <td>平安银行</td>\n",
946
- " <td>2025-02-28</td>\n",
1001
+ " <td>2025-08-08</td>\n",
947
1002
  " <td>3</td>\n",
948
1003
  " <td>0.0</td>\n",
949
- " <td>60.0</td>\n",
1004
+ " <td>80.0</td>\n",
950
1005
  " <td>0.0</td>\n",
951
- " <td>-60.0</td>\n",
1006
+ " <td>-80.0</td>\n",
952
1007
  " <td>-100.0</td>\n",
953
1008
  " <td>0.0</td>\n",
954
1009
  " <td>NaN</td>\n",
955
- " <td>2025-03-03</td>\n",
1010
+ " <td>2025-08-11</td>\n",
956
1011
  " <td>1000.0</td>\n",
957
1012
  " <td>0.0</td>\n",
958
- " <td>11580.0</td>\n",
959
- " <td>11580.0</td>\n",
960
- " <td>11520.0</td>\n",
1013
+ " <td>12480.0</td>\n",
1014
+ " <td>12480.0</td>\n",
1015
+ " <td>12400.0</td>\n",
961
1016
  " </tr>\n",
962
1017
  " <tr>\n",
963
1018
  " <th>2</th>\n",
964
1019
  " <td>SZ000001</td>\n",
965
1020
  " <td>平安银行</td>\n",
966
- " <td>2025-03-06</td>\n",
967
- " <td>13</td>\n",
1021
+ " <td>2025-08-26</td>\n",
1022
+ " <td>2</td>\n",
968
1023
  " <td>0.0</td>\n",
969
- " <td>210.0</td>\n",
1024
+ " <td>360.0</td>\n",
970
1025
  " <td>0.0</td>\n",
971
- " <td>-210.0</td>\n",
1026
+ " <td>-360.0</td>\n",
972
1027
  " <td>-100.0</td>\n",
973
1028
  " <td>0.0</td>\n",
974
1029
  " <td>NaN</td>\n",
975
- " <td>2025-03-19</td>\n",
1030
+ " <td>2025-08-28</td>\n",
976
1031
  " <td>1000.0</td>\n",
977
1032
  " <td>0.0</td>\n",
978
- " <td>11690.0</td>\n",
979
- " <td>11690.0</td>\n",
980
- " <td>11480.0</td>\n",
1033
+ " <td>12450.0</td>\n",
1034
+ " <td>12450.0</td>\n",
1035
+ " <td>12090.0</td>\n",
981
1036
  " </tr>\n",
982
1037
  " <tr>\n",
983
1038
  " <th>3</th>\n",
984
1039
  " <td>SZ000001</td>\n",
985
1040
  " <td>平安银行</td>\n",
986
- " <td>2025-04-21</td>\n",
1041
+ " <td>2025-10-17</td>\n",
987
1042
  " <td>3</td>\n",
988
1043
  " <td>0.0</td>\n",
1044
+ " <td>90.0</td>\n",
989
1045
  " <td>0.0</td>\n",
1046
+ " <td>-90.0</td>\n",
1047
+ " <td>-100.0</td>\n",
990
1048
  " <td>0.0</td>\n",
1049
+ " <td>NaN</td>\n",
1050
+ " <td>2025-10-20</td>\n",
1051
+ " <td>1000.0</td>\n",
991
1052
  " <td>0.0</td>\n",
1053
+ " <td>11500.0</td>\n",
1054
+ " <td>11500.0</td>\n",
1055
+ " <td>11410.0</td>\n",
1056
+ " </tr>\n",
1057
+ " <tr>\n",
1058
+ " <th>4</th>\n",
1059
+ " <td>SZ000001</td>\n",
1060
+ " <td>平安银行</td>\n",
1061
+ " <td>2025-10-23</td>\n",
1062
+ " <td>7</td>\n",
992
1063
  " <td>0.0</td>\n",
1064
+ " <td>140.0</td>\n",
1065
+ " <td>0.0</td>\n",
1066
+ " <td>-140.0</td>\n",
1067
+ " <td>-100.0</td>\n",
993
1068
  " <td>0.0</td>\n",
994
1069
  " <td>NaN</td>\n",
995
- " <td>2025-04-24</td>\n",
1070
+ " <td>2025-10-30</td>\n",
996
1071
  " <td>1000.0</td>\n",
997
1072
  " <td>0.0</td>\n",
998
- " <td>11000.0</td>\n",
999
- " <td>11000.0</td>\n",
1000
- " <td>11000.0</td>\n",
1073
+ " <td>11520.0</td>\n",
1074
+ " <td>11520.0</td>\n",
1075
+ " <td>11380.0</td>\n",
1001
1076
  " </tr>\n",
1002
1077
  " <tr>\n",
1003
- " <th>4</th>\n",
1078
+ " <th>5</th>\n",
1004
1079
  " <td>SZ000001</td>\n",
1005
1080
  " <td>平安银行</td>\n",
1006
- " <td>2025-05-09</td>\n",
1007
- " <td>75</td>\n",
1081
+ " <td>2025-11-05</td>\n",
1082
+ " <td>26</td>\n",
1008
1083
  " <td>0.0</td>\n",
1009
- " <td>-1752.0</td>\n",
1084
+ " <td>-10.0</td>\n",
1010
1085
  " <td>0.0</td>\n",
1011
- " <td>1752.0</td>\n",
1086
+ " <td>10.0</td>\n",
1012
1087
  " <td>-100.0</td>\n",
1013
1088
  " <td>0.0</td>\n",
1014
1089
  " <td>NaN</td>\n",
1015
- " <td>2025-07-23</td>\n",
1090
+ " <td>2025-12-01</td>\n",
1016
1091
  " <td>1000.0</td>\n",
1017
1092
  " <td>0.0</td>\n",
1018
- " <td>11070.0</td>\n",
1019
- " <td>11070.0</td>\n",
1020
- " <td>12822.0</td>\n",
1093
+ " <td>11590.0</td>\n",
1094
+ " <td>11590.0</td>\n",
1095
+ " <td>11600.0</td>\n",
1021
1096
  " </tr>\n",
1022
1097
  " <tr>\n",
1023
- " <th>5</th>\n",
1098
+ " <th>6</th>\n",
1024
1099
  " <td>SZ000001</td>\n",
1025
1100
  " <td>平安银行</td>\n",
1026
- " <td>2025-08-08</td>\n",
1027
- " <td>3</td>\n",
1101
+ " <td>2025-12-19</td>\n",
1102
+ " <td>12</td>\n",
1028
1103
  " <td>0.0</td>\n",
1029
- " <td>80.0</td>\n",
1104
+ " <td>151.0</td>\n",
1030
1105
  " <td>0.0</td>\n",
1031
- " <td>-80.0</td>\n",
1106
+ " <td>-151.0</td>\n",
1032
1107
  " <td>-100.0</td>\n",
1033
1108
  " <td>0.0</td>\n",
1034
1109
  " <td>NaN</td>\n",
1035
- " <td>2025-08-11</td>\n",
1110
+ " <td>2025-12-31</td>\n",
1036
1111
  " <td>1000.0</td>\n",
1037
1112
  " <td>0.0</td>\n",
1038
- " <td>12480.0</td>\n",
1039
- " <td>12480.0</td>\n",
1040
- " <td>12400.0</td>\n",
1113
+ " <td>11630.0</td>\n",
1114
+ " <td>11630.0</td>\n",
1115
+ " <td>11479.0</td>\n",
1116
+ " </tr>\n",
1117
+ " <tr>\n",
1118
+ " <th>7</th>\n",
1119
+ " <td>SZ000001</td>\n",
1120
+ " <td>平安银行</td>\n",
1121
+ " <td>2026-01-07</td>\n",
1122
+ " <td>5</td>\n",
1123
+ " <td>0.0</td>\n",
1124
+ " <td>210.0</td>\n",
1125
+ " <td>0.0</td>\n",
1126
+ " <td>-210.0</td>\n",
1127
+ " <td>-100.0</td>\n",
1128
+ " <td>0.0</td>\n",
1129
+ " <td>NaN</td>\n",
1130
+ " <td>2026-01-12</td>\n",
1131
+ " <td>1000.0</td>\n",
1132
+ " <td>0.0</td>\n",
1133
+ " <td>11659.0</td>\n",
1134
+ " <td>11659.0</td>\n",
1135
+ " <td>11449.0</td>\n",
1041
1136
  " </tr>\n",
1042
1137
  " </tbody>\n",
1043
1138
  "</table>\n",
1044
1139
  "</div>"
1045
1140
  ],
1046
1141
  "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",
1142
+ " 证券代码 证券名称 开仓时间 持有天数 持仓数量 总投入资金 市值 收益 \\\n",
1143
+ "0 SZ000001 平安银行 2025-06-23 30 0.0 -650.0 0.0 650.0 \n",
1144
+ "1 SZ000001 平安银行 2025-08-08 3 0.0 80.0 0.0 -80.0 \n",
1145
+ "2 SZ000001 平安银行 2025-08-26 2 0.0 360.0 0.0 -360.0 \n",
1146
+ "3 SZ000001 平安银行 2025-10-17 3 0.0 90.0 0.0 -90.0 \n",
1147
+ "4 SZ000001 平安银行 2025-10-23 7 0.0 140.0 0.0 -140.0 \n",
1148
+ "5 SZ000001 平安银行 2025-11-05 26 0.0 -10.0 0.0 10.0 \n",
1149
+ "6 SZ000001 平安银行 2025-12-19 12 0.0 151.0 0.0 -151.0 \n",
1150
+ "7 SZ000001 平安银行 2026-01-07 5 0.0 210.0 0.0 -210.0 \n",
1054
1151
  "\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 "
1152
+ " 收益百分比 止损 目标价格 清仓时间 累计持仓数量 累计成本 累计风险 \\\n",
1153
+ "0 -100.0 0.0 NaN 2025-07-23 1000.0 0.0 11810.0 \n",
1154
+ "1 -100.0 0.0 NaN 2025-08-11 1000.0 0.0 12480.0 \n",
1155
+ "2 -100.0 0.0 NaN 2025-08-28 1000.0 0.0 12450.0 \n",
1156
+ "3 -100.0 0.0 NaN 2025-10-20 1000.0 0.0 11500.0 \n",
1157
+ "4 -100.0 0.0 NaN 2025-10-30 1000.0 0.0 11520.0 \n",
1158
+ "5 -100.0 0.0 NaN 2025-12-01 1000.0 0.0 11590.0 \n",
1159
+ "6 -100.0 0.0 NaN 2025-12-31 1000.0 0.0 11630.0 \n",
1160
+ "7 -100.0 0.0 NaN 2026-01-12 1000.0 0.0 11659.0 \n",
1161
+ "\n",
1162
+ " 累计买入资金 累计卖出资金 \n",
1163
+ "0 11810.0 12460.0 \n",
1164
+ "1 12480.0 12400.0 \n",
1165
+ "2 12450.0 12090.0 \n",
1166
+ "3 11500.0 11410.0 \n",
1167
+ "4 11520.0 11380.0 \n",
1168
+ "5 11590.0 11600.0 \n",
1169
+ "6 11630.0 11479.0 \n",
1170
+ "7 11659.0 11449.0 "
1062
1171
  ]
1063
1172
  },
1064
- "execution_count": 12,
1173
+ "execution_count": 20,
1065
1174
  "metadata": {},
1066
1175
  "output_type": "execute_result"
1067
1176
  }
@@ -1072,22 +1181,24 @@
1072
1181
  },
1073
1182
  {
1074
1183
  "cell_type": "code",
1075
- "execution_count": 13,
1184
+ "execution_count": 21,
1076
1185
  "metadata": {},
1077
1186
  "outputs": [
1078
1187
  {
1079
1188
  "data": {
1080
1189
  "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')])"
1190
+ "array([('SZ000001', '平安银行', '2025-06-23T00:00:00.000000000', 30, 0., -650., 0., 650., -100., 0., nan, '2025-07-23T00:00:00.000000000', 1000., 0., 11810., 11810., 12460.),\n",
1191
+ " ('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",
1192
+ " ('SZ000001', '平安银行', '2025-08-26T00:00:00.000000000', 2, 0., 360., 0., -360., -100., 0., nan, '2025-08-28T00:00:00.000000000', 1000., 0., 12450., 12450., 12090.),\n",
1193
+ " ('SZ000001', '平安银行', '2025-10-17T00:00:00.000000000', 3, 0., 90., 0., -90., -100., 0., nan, '2025-10-20T00:00:00.000000000', 1000., 0., 11500., 11500., 11410.),\n",
1194
+ " ('SZ000001', '平安银行', '2025-10-23T00:00:00.000000000', 7, 0., 140., 0., -140., -100., 0., nan, '2025-10-30T00:00:00.000000000', 1000., 0., 11520., 11520., 11380.),\n",
1195
+ " ('SZ000001', '平安银行', '2025-11-05T00:00:00.000000000', 26, 0., -10., 0., 10., -100., 0., nan, '2025-12-01T00:00:00.000000000', 1000., 0., 11590., 11590., 11600.),\n",
1196
+ " ('SZ000001', '平安银行', '2025-12-19T00:00:00.000000000', 12, 0., 151., 0., -151., -100., 0., nan, '2025-12-31T00:00:00.000000000', 1000., 0., 11630., 11630., 11479.),\n",
1197
+ " ('SZ000001', '平安银行', '2026-01-07T00:00:00.000000000', 5, 0., 210., 0., -210., -100., 0., nan, '2026-01-12T00:00:00.000000000', 1000., 0., 11659., 11659., 11449.)],\n",
1198
+ " dtype=[('证券代码', '<U10'), ('证券名称', '<U20'), ('开仓时间', '<M8[ns]'), ('持有天数', '<i8'), ('持仓数量', '<f8'), ('总投入资金', '<f8'), ('市值', '<f8'), ('收益', '<f8'), ('收益百分比', '<f8'), ('止损', '<f8'), ('目标价格', '<f8'), ('清仓时间', '<M8[ns]'), ('累计持仓数量', '<f8'), ('累计成本', '<f8'), ('累计风险', '<f8'), ('累计买入资金', '<f8'), ('累计卖出资金', '<f8')])"
1088
1199
  ]
1089
1200
  },
1090
- "execution_count": 13,
1201
+ "execution_count": 21,
1091
1202
  "metadata": {},
1092
1203
  "output_type": "execute_result"
1093
1204
  }
@@ -1106,7 +1217,7 @@
1106
1217
  ],
1107
1218
  "metadata": {
1108
1219
  "kernelspec": {
1109
- "display_name": "Python 3 (ipykernel)",
1220
+ "display_name": "base",
1110
1221
  "language": "python",
1111
1222
  "name": "python3"
1112
1223
  },
@@ -1120,7 +1231,7 @@
1120
1231
  "name": "python",
1121
1232
  "nbconvert_exporter": "python",
1122
1233
  "pygments_lexer": "ipython3",
1123
- "version": "3.12.9"
1234
+ "version": "3.12.7"
1124
1235
  }
1125
1236
  },
1126
1237
  "nbformat": 4,