完成系统热度反复活跃矩阵研究
This commit is contained in:
parent
8c79c4610d
commit
4d4663be18
11
DEVLOG.md
11
DEVLOG.md
|
|
@ -2505,3 +2505,14 @@ QMT仍有序号缺口,16:23确认1441965、最高1442003、暂存32条。16:24
|
|||
缺评分不记0次,统一完整20日观察池后有389个可用信号日。每边30基点下,2026有94组最低展示样本要求内的平均批次净收益为正,60基点下剩44组;高频次正格多为少数股票,不能当独立验证或账户盈利。固定smart≥0.8、K≥5、H5的2026批次净收益−0.84%,相对K0改善0.062个百分点;加当天达标未延续改善。固定H5、两年皆正的仅历史频次条件有5组,但2026日均入选仅1.7至4.2只。
|
||||
|
||||
开发机9项配置隔离、断网测试通过;1200次直接历史窗口计数、6项旧基线和36项指数区间核验通过;3个账户逐笔独立重建、42条账户现金守恒及21条30基点前缀核验通过。本地Chrome完成矩阵与表格联动、独立阶段/指数切片、CSV/PNG导出及手机布局验收,外部请求0。沿用历史可覆盖快照,首次可用时间、完整退市覆盖及实际成交容量仍未解决。未改应用、运行参数、持仓或容器,未部署。
|
||||
|
||||
|
||||
## 2026-10-29 完成系统热度反复活跃矩阵研究
|
||||
|
||||
核验时间:2026年10月29日10:14,北京时间。新增`research/heat_recurrence_20261029/`,沿用评分矩阵的阈值、前20交易日次数、持有1至10日及阶段和指数隔离逻辑。协议先冻结;直接使用`stock_fund_heat_scores.score`,每种数据口径3440组、三口径共10320次评估,生成536640行结果、72个预设账户、六张图和可离线交互HTML。
|
||||
|
||||
155模拟PMS只读核对实际镜像`pms:micro50-9e14f92`、空前缀与仅日志挂载;运行读源仍为该表,ParamStore热度阈值0.80。最新10月28日5208只中341只达0.80。回测未追加新数据,仍沿用原缓存、行情截至10月23日,共同信号末日10月8日;没有业务写入、部署、重启、委托或188操作。
|
||||
|
||||
数据质量是主要边界:选股截止前已入库的完整20日观察池只有24日;要求历史逐日及时入库仅4日;忽略入库时间的含回填诊断71日。9月7日缺数使其后20日无完整窗口。固定热度0.80、历史至少5次、H5平均每批净收益−1.42%,60bp−2.01%;所有H1至10均负。主口径1240个达标格中38格30bp正收益(含16个重复K0对照),60bp正收益0;各阶段样本不足,未选上线参数。
|
||||
|
||||
开发机12项断网隔离测试、2400个原始窗口、36项实际买卖日指数比较、三种逐笔账本独立重建、72账户现金守恒及36账户样本内截断前缀通过;原H1/5/10热度事件基线和H5现金基线精确复现。四指数阶段加总、费用顺序、缺值、43个本地链接和源摘要通过;本机Chrome10项验收,外部请求0,六图目视核验。研究代码不属于业务运行镜像,无受影响容器。接续见`docs/热度反复活跃矩阵研究接续_2026-10-29.md`。原有未提交日志、台账、文档及研究目录保持原样。
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
| 任务 | 入口 |
|
||||
| --- | --- |
|
||||
| 当前微盘接入、参数和运行待办 | [阶段接续与实验意见](微盘轮动阶段接续_2026-10-28.md);需要部署证据再读[50股发布记录](微盘轮动50股参数发布_2026-10-28.md) |
|
||||
| 全市场热度、涨跌幅与持有期标定 | [热度策略研究接续](全市场热度四维标定接续_2026-10-28.md),含回填限制、参数结果和复现入口 |
|
||||
| 全市场热度、涨跌幅与持有期标定 | [热度策略研究接续](全市场热度四维标定接续_2026-10-28.md),含回填限制、参数结果和复现入口;[热度反复活跃矩阵接续](热度反复活跃矩阵研究接续_2026-10-29.md),含前20日次数、持有期、数据可用性与阶段指数对照 |
|
||||
| 综合分与聪明资金分阈值及市场阶段比较 | [评分策略研究接续](综合分与聪明资金分标定接续_2026-10-28.md),含810组结果、历史版本限制和复现入口;[反复活跃矩阵接续](反复活跃矩阵研究接续_2026-10-29.md),含20日次数、1至10日持有期与指数隔离 |
|
||||
| PMS通用迁移与既有修复 | [开发接续](开发接续_2026-10-12.md),按主题查对应节;旧时点未完成项可能已有后续结论 |
|
||||
| 架构与接口 | [README模块地图](../README.md)、[总体设计](../POSITION_MGMT_DESIGN.md);改接口再读[QMT协议](../QMT_WS_PROTOCOL.md)、[bionic接口](../BIONIC_PMS_INTERFACE.md)或[计划接口](../UPSTREAM_PLAN_API.md) |
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
# 热度反复活跃矩阵研究接续
|
||||
|
||||
核验时间:2026年10月29日10:12,北京时间。离线研究完成,不改变PMS、bionic、QMT或运行参数。
|
||||
|
||||
## 交付入口
|
||||
|
||||
[交互矩阵浏览器](../research/heat_recurrence_20261029/热度反复活跃矩阵浏览器.html);[完整报告](../research/heat_recurrence_20261029/热度反复活跃与持有期矩阵研究.md)。沿用评分矩阵形式,支持热度阈值、前20日次数、持有1至10日、市场阶段与独立指数对照、费用、月份,以及PNG和CSV导出。
|
||||
|
||||
## 当前源核对
|
||||
|
||||
09:58对155模拟PMS只读核对,实际镜像`pms:micro50-9e14f92`、空表前缀、仅日志挂载。运行代码仍读取`stock_fund_heat_scores.score`最新交易日最大批次,ParamStore阈值`PMS_AUTO_HEAT_TH=0.80`。最新日期10月28日、批次124,5208只股票中341只达到0.80。没有访问188,没有修改服务器或业务容器。
|
||||
|
||||
本次回测仍使用原热度批次与截至10月23日的行情,所有H共用10月8日信号末日。新核对不追加收益样本。热度上游公式与不可变版本、create_time时区语义仍未核实,不把回填记录当成当时可执行信号。
|
||||
|
||||
## 参数与数据口径
|
||||
|
||||
热度下限为0.50、0.60、0.70、0.75、0.80、0.85、0.90、0.95;K为前20交易日达标次数下限0至20,不含当天;三种规则分别为仅当天、仅历史次数、历史次数且当天达标,H为1至10。每种数据口径3440组,共10320次评估、536640行分组结果。
|
||||
|
||||
- 选股时已入库:每个信号截止重建历史批次,可使用截止前已入库的回填历史,实际24个选股日,8月4日至9月4日。
|
||||
- 逐日及时入库:前20日每一天都在各自次日09:25前整批入库,仅9月1日至4日4日,全部格子样本不足。
|
||||
- 含回填诊断:忽略入库时间,共71日,不代表历史可执行收益。
|
||||
|
||||
9月7日整日缺数据导致后续20日无完整窗口。主矩阵没有涨跌幅过滤,也没有其他分数。三种交易规则在同一数据口径内使用同一完整观察池。时区原值与加8小时在共同信号区间中没有选股差异。日均入选的分母含对应阶段缺数日,浓度表另给按可用日计算的数量。
|
||||
|
||||
## 关键结果
|
||||
|
||||
热度≥0.80、前20日≥5次,仅历史频次在24日样本中持有1至10日均为负;H5每批净收益−1.42%,每边60bp为−2.01%,相对同日K0减少1.416个百分点。相同股票日池只看当天热度≥0.80的H5为−0.86%。历史频次条件有558笔完成事件、96只股票,不等于558个独立时间样本。
|
||||
|
||||
再叠加当天达标仅13日28笔,样本不足;热度≥0.80、K≥10没有样本。主口径1240个达到展示门槛的组合中38格30bp为正,其中16格是重复K0对照;60bp正收益为0。各市场阶段均不足20日,不能从少数红格判断某阶段有效。
|
||||
|
||||
固定H5的主口径现金账户:共同池−0.14%,仅当天−4.10%,仅频次K5−6.75%,次数且当天−14.37%。这些是账户累计收益,不能与平均每批收益混用。研究未模拟整手、最低佣金或实际开盘容量。
|
||||
|
||||
## 验证与接续
|
||||
|
||||
开发机12项断网配置隔离测试通过;2400个原始窗口计数、36项实际退出日指数比较、3种逐笔账本独立重建、72账户现金守恒、36账户截断前缀通过。原热度旧事件基线H1/5/10及H5现金账户精确复现。四指数阶段分组加总、费用顺序、缺值、文件摘要及链接经整表核对。浏览器10项验收、外部请求0,六张图完成目视核验。
|
||||
|
||||
复现顺序、冻结协议与源缓存SHA见完整报告;本轮只新增研究代码和交付材料,没有受影响业务容器需要构建或重建。数据缓存保留在本地忽略目录,不覆盖旧研究。
|
||||
|
||||
没有后台任务或自动上线安排。若继续扩展,应另存协议、扩大完整可用热度历史并核实上游时间和版本;不能将本轮短样本最优格直接写入ParamStore。
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
cache/
|
||||
__pycache__/
|
||||
Binary file not shown.
|
|
@ -0,0 +1,73 @@
|
|||
name,config,score,threshold,mode,k,hold,fee_bps,return,max_drawdown,fees_initial_capital,buy_count,sell_count,skipped_buy,delayed_lots,ending_cash,ending_stock_value,open_lots,max_stock_weight,max_positions,max_stale_valuation,mean_exposure
|
||||
available_current,172,available,0.8,current,0,1,30,-0.19011447185224029,-0.2204918496679249,0.13144775858347865,4859,4859,67,7,0.8098855281477597,0.0,0,0.015640490359151493,299,0.005230994041924282,0.8171247302210682
|
||||
available_current,172,available,0.8,current,0,1,60,-0.29701488041204327,-0.3161106452727993,0.24592979906273357,4859,4859,67,7,0.7029851195879567,0.0,0,0.01564049035915149,299,0.004801638583896885,0.8170948298223885
|
||||
available_current,172,available,0.8,current,0,5,30,-0.04102832555891511,-0.07708652863720555,0.02813972776891002,4859,4859,67,15,0.9589716744410849,0.0,0,0.006288427890445987,1017,0.0059941287904019,0.7641732629183788
|
||||
available_current,172,available,0.8,current,0,5,60,-0.06793781961249268,-0.09598332109299101,0.05551936917908106,4859,4859,67,15,0.9320621803875073,0.0,0,0.006285929069645227,1017,0.0058423718025637835,0.764516800989288
|
||||
available_current,172,available,0.8,current,0,10,30,-0.03878314005251282,-0.07381368920833475,0.01403450559126204,4859,4859,67,7,0.9612168599474872,0.0,0,0.00440830567976754,1675,0.004490111863437257,0.7176546647898122
|
||||
available_current,172,available,0.8,current,0,10,60,-0.05236801749290343,-0.0833519674884059,0.02787512231405632,4859,4859,67,7,0.9476319825070966,0.0,0,0.004403710718593867,1675,0.004435280319667137,0.71775616818094
|
||||
available_frequency,178,available,0.8,frequency,5,1,30,-0.113737818255782,-0.15536960013826195,0.13464439951723764,558,558,4,2,0.886262181744218,0.0,0,0.06363647771551588,34,0.0,0.9912739154334164
|
||||
available_frequency,178,available,0.8,frequency,5,1,60,-0.23112750686990624,-0.24504219774960245,0.25159196318049637,558,558,4,2,0.7688724931300938,0.0,0,0.06360220028046265,34,0.0,0.9914420977502122
|
||||
available_frequency,178,available,0.8,frequency,5,5,30,-0.06753122424612834,-0.10161075336644754,0.027820088844897443,558,558,4,1,0.9324687757538717,0.0,0,0.06333600514637751,42,0.0,0.85090064448485
|
||||
available_frequency,178,available,0.8,frequency,5,5,60,-0.09384142484314173,-0.12482214759251387,0.054874387281301645,558,558,4,1,0.9061585751568583,0.0,0,0.06333747238610128,42,0.0,0.8510831891123224
|
||||
available_frequency,178,available,0.8,frequency,5,10,30,-0.06566021184866666,-0.09762577164346753,0.013803853161455035,558,558,4,1,0.9343397881513333,0.0,0,0.05773476740185788,57,0.0,0.7217239044705962
|
||||
available_frequency,178,available,0.8,frequency,5,10,60,-0.0788888510002046,-0.10770799023755395,0.02741862819520254,558,558,4,1,0.9211111489997954,0.0,0,0.05776823897289163,57,0.0,0.7218479907109729
|
||||
available_both,199,available,0.8,both,5,1,30,-0.2220721690560431,-0.2807131416077282,0.06800059424422052,28,28,0,0,0.7779278309439569,0.0,0,1.0000000000000002,5,0.0,0.9966541508597581
|
||||
available_both,199,available,0.8,both,5,1,60,-0.28054164042743845,-0.3287700146776247,0.1311900380298004,28,28,0,0,0.7194583595725615,0.0,0,1.0,5,0.0,0.9973514064294731
|
||||
available_both,199,available,0.8,both,5,5,30,-0.14368882324720778,-0.14541277144348652,0.01414855052888356,28,28,0,0,0.8563111767527922,0.0,0,0.2331279062354456,10,0.0,0.5145567786626962
|
||||
available_both,199,available,0.8,both,5,5,60,-0.15656741018771603,-0.1577590550697865,0.028065751846106365,28,28,0,0,0.843432589812284,0.0,0,0.23302268180275135,10,0.0,0.5141521330585868
|
||||
available_both,199,available,0.8,both,5,10,30,-0.11889855790233028,-0.12483547303029696,0.007138936330999197,28,28,0,0,0.8811014420976697,0.0,0,0.16403440427841293,15,0.0,0.4223062326980803
|
||||
available_both,199,available,0.8,both,5,10,60,-0.12540150287728502,-0.13056911889991718,0.01420515988584711,28,28,0,0,0.874598497122715,0.0,0,0.16378485643665536,15,0.0,0.4216950399536817
|
||||
strict_current,516,strict,0.8,current,0,1,30,-0.036831576247847164,-0.04058738735543743,0.023069916908885046,812,812,10,2,0.9631684237521528,0.0,0,0.006317375678460598,232,0.0040011026335753175,0.4411699005851902
|
||||
strict_current,516,strict,0.8,current,0,1,60,-0.05936554761922985,-0.05936554761922985,0.04560032874066076,812,812,10,2,0.9406344523807701,0.0,0,0.00631689211392964,232,0.003919086868610061,0.4411602965433548
|
||||
strict_current,516,strict,0.8,current,0,5,30,-0.014527500160352091,-0.01961869569973984,0.004676134264727331,812,812,10,7,0.9854724998396479,0.0,0,0.0037890538190102647,715,0.005450680389005561,0.3574612069928766
|
||||
strict_current,516,strict,0.8,current,0,5,60,-0.01912058378249748,-0.021885195484758424,0.009316314213058003,812,812,10,7,0.9808794162175025,0.0,0,0.0037900679621869944,715,0.005428339214650583,0.3569226451218602
|
||||
strict_current,516,strict,0.8,current,0,10,30,-0.017209789391053887,-0.02437912788824015,0.002313224046041274,812,812,10,1,0.9827902106089461,0.0,0,0.00199630293757426,715,0.002732976415353459,0.2994898030368639
|
||||
strict_current,516,strict,0.8,current,0,10,60,-0.01945829223322182,-0.02432496006209328,0.004610631425373395,812,812,10,1,0.9805417077667782,0.0,0,0.0019918346980845785,715,0.0027233004518287312,0.2988114135256169
|
||||
strict_frequency,522,strict,0.8,frequency,5,1,30,-0.01479736787200503,-0.02524393823754645,0.02264835685777575,99,99,2,1,0.985202632127995,0.0,0,0.05011343377254144,31,0.0,0.9798653570004062
|
||||
strict_frequency,522,strict,0.8,frequency,5,1,60,-0.037263961823621905,-0.03787693666071734,0.044773265684090485,99,99,2,1,0.9627360381763781,0.0,0,0.050113433772541426,31,0.0,0.979814840479815
|
||||
strict_frequency,522,strict,0.8,frequency,5,5,30,-0.014231602996254367,-0.030013186225045896,0.004639947382186998,99,99,2,0,0.9857683970037456,0.0,0,0.0373990170447471,39,0.0,0.48795064291705315
|
||||
strict_frequency,522,strict,0.8,frequency,5,5,60,-0.018793681219228753,-0.03222129940548235,0.009244240137454632,99,99,2,0,0.9812063187807712,0.0,0,0.03734635884114869,39,0.0,0.4872087812506976
|
||||
strict_frequency,522,strict,0.8,frequency,5,10,30,-0.008372663188966789,-0.03080485427793611,0.0023205098689074726,99,99,2,0,0.9916273368110332,0.0,0,0.020075262845535412,39,0.0,0.2982076380646317
|
||||
strict_frequency,522,strict,0.8,frequency,5,10,60,-0.010661418879490347,-0.030735544896219325,0.004625148695885487,99,99,2,0,0.9893385811205097,0.0,0,0.02003089319891687,39,0.0,0.2975304631953859
|
||||
strict_both,543,strict,0.8,both,5,1,30,0.03525735484246795,-0.03366416374155268,0.01190743786806616,3,3,0,0,1.035257354842468,0.0,0,1.0000000000000002,2,0.0,1.0000000000000002
|
||||
strict_both,543,strict,0.8,both,5,1,60,0.022908250073032876,-0.03891044005120414,0.023672201116066556,3,3,0,0,1.0229082500730329,0.0,0,1.0,2,0.0,1.0
|
||||
strict_both,543,strict,0.8,both,5,5,30,-0.030701451606315766,-0.05582117430333622,0.002299901543057027,3,3,0,0,0.9692985483936842,0.0,0,0.21345881241224013,3,0.0,0.246243159923435
|
||||
strict_both,543,strict,0.8,both,5,5,60,-0.032886158821733624,-0.05677338521435438,0.004584801964350014,3,3,0,0,0.9671138411782664,0.0,0,0.21296411192816278,3,0.0,0.24572933178955156
|
||||
strict_both,543,strict,0.8,both,5,10,30,-0.03265282374022649,-0.05081401650674433,0.001099822929728662,3,3,0,0,0.9673471762597735,0.0,0,0.10847789438477379,3,0.0,0.14464796001207827
|
||||
strict_both,543,strict,0.8,both,5,10,60,-0.03364889773477653,-0.050686663744129556,0.002192758634115538,3,3,0,0,0.9663511022652235,0.0,0,0.10819121611102343,3,0.0,0.14427452183132142
|
||||
latest_current,860,latest,0.8,current,0,1,30,-0.46422148101703764,-0.46631071366127785,0.3043997177899917,15432,15432,163,50,0.5357785189829624,0.0,0,0.015470572115192595,368,0.0390289804477925,0.92411193403061
|
||||
latest_current,860,latest,0.8,current,0,1,60,-0.6471917244749739,-0.6471917244749739,0.5072121026495757,15432,15432,163,50,0.35280827552502614,0.0,0,0.01546435565418598,368,0.035168523058676515,0.9241230223879754
|
||||
latest_current,860,latest,0.8,current,0,5,30,-0.18686712476182232,-0.1887986592815174,0.0747620897820727,15432,15432,163,73,0.8131328752381777,0.0,0,0.0063310849432340775,1292,0.04657619134063515,0.901396188547534
|
||||
latest_current,860,latest,0.8,current,0,5,60,-0.2524752268075805,-0.2526040517959579,0.14365117560064639,15432,15432,163,73,0.7475247731924195,0.0,0,0.006327779358405837,1292,0.04568044920616661,0.9015456651148094
|
||||
latest_current,860,latest,0.8,current,0,10,30,-0.1196834951828607,-0.17236873385174667,0.03936467156821022,15432,15432,163,49,0.8803165048171393,0.0,0,0.004397557745358449,2004,0.04109760622326873,0.8761873278468861
|
||||
latest_current,860,latest,0.8,current,0,10,60,-0.15589054927404644,-0.18066155174629794,0.0771314652668542,15432,15432,163,49,0.8441094507259536,0.0,0,0.004399127587937254,2004,0.04076046814295605,0.8761213099020064
|
||||
latest_frequency,866,latest,0.8,frequency,5,1,30,-0.49141510254422904,-0.4962506944284091,0.3031511307458642,4008,4008,36,20,0.508584897455771,0.0,0,0.0636364777155159,116,0.05054388447295829,0.990141433035817
|
||||
latest_frequency,866,latest,0.8,frequency,5,1,60,-0.6655974593999372,-0.6658103737759657,0.5090074078480689,4008,4008,36,20,0.3344025406000628,0.0,0,0.06360220028046262,116,0.04527944569404714,0.990393876242178
|
||||
latest_frequency,866,latest,0.8,frequency,5,5,30,-0.2848752141512264,-0.361697463261639,0.07372107818737501,4008,4008,36,13,0.7151247858487736,0.0,0,0.06332650981566712,156,0.03188272707968228,0.9381209604383789
|
||||
latest_frequency,866,latest,0.8,frequency,5,5,60,-0.3427380589234118,-0.39893688628262447,0.14189969911670375,4008,4008,36,13,0.6572619410765882,0.0,0,0.06332631970559513,156,0.031238633327622348,0.9382804443582501
|
||||
latest_frequency,866,latest,0.8,frequency,5,10,30,-0.25576629625346836,-0.36256726124642935,0.03743140056322215,4008,4008,36,19,0.7442337037465316,0.0,0,0.057735537298993445,206,0.024691496263207352,0.8811975299132673
|
||||
latest_frequency,866,latest,0.8,frequency,5,10,60,-0.28665143862037157,-0.3817097508755707,0.07341884550944924,4008,4008,36,19,0.7133485613796284,0.0,0,0.057769760416713,206,0.02449217109870465,0.8812302696376421
|
||||
latest_both,887,latest,0.8,both,5,1,30,-0.67476264154277,-0.6962461565722866,0.21443681379398588,297,297,5,1,0.32523735845723,0.0,0,1.0000000000000002,16,0.0,0.9873385865323749
|
||||
latest_both,887,latest,0.8,both,5,1,60,-0.76773529470619,-0.7817720373390997,0.37569512842679176,297,297,5,1,0.23226470529381005,0.0,0,1.0,16,0.0,0.9877666463062293
|
||||
latest_both,887,latest,0.8,both,5,5,30,-0.47966959915553176,-0.5092284460800915,0.05293393256224475,297,297,5,1,0.5203304008444682,0.0,0,0.2567158349929261,50,0.03229972160938707,0.746177043023516
|
||||
latest_both,887,latest,0.8,both,5,5,60,-0.5132930800801391,-0.5336355376660559,0.10284318854405083,297,297,5,1,0.4867069199198609,0.0,0,0.25614537716841645,50,0.0316146438361929,0.7460530030251412
|
||||
latest_both,887,latest,0.8,both,5,10,30,-0.39860059037996065,-0.46158732054470064,0.028218176678013553,297,297,5,1,0.6013994096200393,0.0,0,0.16678025711977082,71,0.04355001372299791,0.6995919597811463
|
||||
latest_both,887,latest,0.8,both,5,10,60,-0.41848154265079385,-0.4747516890888094,0.055580575373711444,297,297,5,1,0.5815184573492062,0.0,0,0.16686110711070065,71,0.04322285973263147,0.6993581709938551
|
||||
available_universe,1,available,0.5,frequency,0,1,30,-0.07816880116197022,-0.10469414025449342,0.1396502622142001,116897,116897,249,45,0.9218311988380298,0.0,0,0.0002560233385931332,4881,0.001251328517970748,0.7257926074778492
|
||||
available_universe,1,available,0.5,frequency,0,1,60,-0.2014611594362593,-0.2113969202327034,0.26056680535554794,116897,116897,249,45,0.7985388405637407,0.0,0,0.0002560137036430771,4881,0.0011992891578994913,0.7258947337873387
|
||||
available_universe,1,available,0.5,frequency,0,5,30,-0.0013705259746936704,-0.04777471214402074,0.02895348294059767,116897,116897,249,136,0.9986294740253063,0.0,0,0.0002967321781916329,4888,0.0017949044330677845,0.6306967169402165
|
||||
available_universe,1,available,0.5,frequency,0,5,60,-0.0296566289259097,-0.054898820186032316,0.057093316564766294,116897,116897,249,136,0.9703433710740903,0.0,0,0.00029711392195777244,4888,0.0017542429248654425,0.6307952333931502
|
||||
available_universe,1,available,0.5,frequency,0,10,30,-0.008859698803265093,-0.04497043121998945,0.014354297780932211,116897,116887,249,190,0.9911403011967349,0.0,10,0.0003111289375454712,4890,0.0019677679644375602,0.4889254182525662
|
||||
available_universe,1,available,0.5,frequency,0,10,60,-0.022984549313931124,-0.04826906552871191,0.028505096790813034,116897,116887,249,190,0.9770154506860689,0.0,10,0.0003116874744696696,4890,0.0019489428743472354,0.48895048355054455
|
||||
strict_universe,345,strict,0.5,frequency,0,1,30,-0.02132793817781664,-0.023276164006547195,0.023621712205577468,19487,19487,38,10,0.9786720618221834,0.0,0,0.0002448704875162326,4878,0.0006054184249417011,0.3072379360750505
|
||||
strict_universe,345,strict,0.5,frequency,0,1,60,-0.04449907173091594,-0.04451779888419427,0.04670516998893606,19487,19487,38,10,0.9555009282690841,0.0,0,0.0002448686770599111,4878,0.0005982289920390296,0.3073745552442166
|
||||
strict_universe,345,strict,0.5,frequency,0,5,30,-0.011624291044832202,-0.01685639722622223,0.004741576344355172,19487,19487,38,32,0.9883757089551678,0.0,0,0.00022452028001382295,4884,0.0008590462363775947,0.22090618025968453
|
||||
strict_universe,345,strict,0.5,frequency,0,5,60,-0.01629594129165468,-0.019166140051273706,0.009446553561024643,19487,19487,38,32,0.9837040587083453,0.0,0,0.00022460130448381075,4884,0.0008557570941513439,0.22057621192056576
|
||||
strict_universe,345,strict,0.5,frequency,0,10,30,-0.010109691028405199,-0.017723570558354163,0.002361391622042911,19487,19479,38,43,0.9898903089715948,0.0,8,0.00013686108173120172,4884,0.0007921189051628015,0.13654500782683215
|
||||
strict_universe,345,strict,0.5,frequency,0,10,60,-0.012430349920084627,-0.01768401050428481,0.0047066060638484555,19487,19479,38,43,0.9875696500799154,0.0,8,0.0001365521247936787,4884,0.00078941877281603,0.136237683237656
|
||||
latest_universe,689,latest,0.5,frequency,0,1,30,-0.3817113551335526,-0.3829748281035781,0.31810480160558013,341704,341704,939,421,0.6182886448664474,0.0,0,0.00029140885668893084,4886,0.033132250247226554,0.8848780399103667
|
||||
latest_universe,689,latest,0.5,frequency,0,1,60,-0.5953234807959816,-0.5953321327086109,0.5275499520520216,341704,341704,939,421,0.40467651920401837,0.0,0,0.0002914047631296672,4886,0.02968169063232475,0.885060797149432
|
||||
latest_universe,689,latest,0.5,frequency,0,5,30,-0.1216844687818257,-0.19043518089214595,0.07648549440908485,341704,341704,939,683,0.8783155312181743,0.0,0,0.00034188604944547887,4892,0.03736092754718628,0.8331859442018662
|
||||
latest_universe,689,latest,0.5,frequency,0,5,60,-0.19310508464580056,-0.2258609454619298,0.14680230224256233,341704,341704,939,683,0.8068949153541994,0.0,0,0.00034209557172144937,4892,0.03663802754444167,0.8332479379145513
|
||||
latest_universe,689,latest,0.5,frequency,0,10,30,-0.07138611416003238,-0.15600548664044378,0.039779795715704024,341704,341694,939,800,0.9286138858399676,0.0,10,0.0004205709018934101,4897,0.039060718039066265,0.7371797771482734
|
||||
latest_universe,689,latest,0.5,frequency,0,10,60,-0.10994159006181592,-0.17081667646184384,0.07790452953222878,341704,341694,939,800,0.8900584099381841,0.0,10,0.0004200588770416268,4897,0.0387513743344705,0.7370890426414354
|
||||
|
|
|
@ -0,0 +1,502 @@
|
|||
{
|
||||
"environment": "开发机,经unit_test_guard隔离配置、断网运行",
|
||||
"memory_tests": 12,
|
||||
"raw_window_checks": 2400,
|
||||
"strict_latest_count_prefix_exact": true,
|
||||
"available_prefix_protection": "合成晚到修订测试及2400次原始行截止选择核验",
|
||||
"prior_baseline_checks": [
|
||||
{
|
||||
"hold": 1,
|
||||
"error": 9.020562075079397e-17
|
||||
},
|
||||
{
|
||||
"hold": 5,
|
||||
"error": 5.204170427930421e-18
|
||||
},
|
||||
{
|
||||
"hold": 10,
|
||||
"error": 8.326672684688674e-17
|
||||
},
|
||||
{
|
||||
"cash_return": -0.09183817866851673,
|
||||
"error": 2.7755575615628914e-17
|
||||
}
|
||||
],
|
||||
"index_actual_exit_checks": [
|
||||
{
|
||||
"hold": 1,
|
||||
"mode": "current",
|
||||
"index": "csi300",
|
||||
"error": 3.469446951953614e-18
|
||||
},
|
||||
{
|
||||
"hold": 1,
|
||||
"mode": "current",
|
||||
"index": "csi500",
|
||||
"error": 3.469446951953614e-18
|
||||
},
|
||||
{
|
||||
"hold": 1,
|
||||
"mode": "current",
|
||||
"index": "csi1000",
|
||||
"error": 5.204170427930421e-18
|
||||
},
|
||||
{
|
||||
"hold": 1,
|
||||
"mode": "current",
|
||||
"index": "csi2000",
|
||||
"error": 3.469446951953614e-18
|
||||
},
|
||||
{
|
||||
"hold": 1,
|
||||
"mode": "frequency",
|
||||
"index": "csi300",
|
||||
"error": 0.0
|
||||
},
|
||||
{
|
||||
"hold": 1,
|
||||
"mode": "frequency",
|
||||
"index": "csi500",
|
||||
"error": 0.0
|
||||
},
|
||||
{
|
||||
"hold": 1,
|
||||
"mode": "frequency",
|
||||
"index": "csi1000",
|
||||
"error": 0.0
|
||||
},
|
||||
{
|
||||
"hold": 1,
|
||||
"mode": "frequency",
|
||||
"index": "csi2000",
|
||||
"error": 0.0
|
||||
},
|
||||
{
|
||||
"hold": 1,
|
||||
"mode": "both",
|
||||
"index": "csi300",
|
||||
"error": 0.0
|
||||
},
|
||||
{
|
||||
"hold": 1,
|
||||
"mode": "both",
|
||||
"index": "csi500",
|
||||
"error": 0.0
|
||||
},
|
||||
{
|
||||
"hold": 1,
|
||||
"mode": "both",
|
||||
"index": "csi1000",
|
||||
"error": 0.0
|
||||
},
|
||||
{
|
||||
"hold": 1,
|
||||
"mode": "both",
|
||||
"index": "csi2000",
|
||||
"error": 0.0
|
||||
},
|
||||
{
|
||||
"hold": 5,
|
||||
"mode": "current",
|
||||
"index": "csi300",
|
||||
"error": 6.938893903907228e-18
|
||||
},
|
||||
{
|
||||
"hold": 5,
|
||||
"mode": "current",
|
||||
"index": "csi500",
|
||||
"error": 1.0408340855860843e-17
|
||||
},
|
||||
{
|
||||
"hold": 5,
|
||||
"mode": "current",
|
||||
"index": "csi1000",
|
||||
"error": 6.938893903907228e-18
|
||||
},
|
||||
{
|
||||
"hold": 5,
|
||||
"mode": "current",
|
||||
"index": "csi2000",
|
||||
"error": 6.938893903907228e-18
|
||||
},
|
||||
{
|
||||
"hold": 5,
|
||||
"mode": "frequency",
|
||||
"index": "csi300",
|
||||
"error": 6.938893903907228e-18
|
||||
},
|
||||
{
|
||||
"hold": 5,
|
||||
"mode": "frequency",
|
||||
"index": "csi500",
|
||||
"error": 0.0
|
||||
},
|
||||
{
|
||||
"hold": 5,
|
||||
"mode": "frequency",
|
||||
"index": "csi1000",
|
||||
"error": 6.938893903907228e-18
|
||||
},
|
||||
{
|
||||
"hold": 5,
|
||||
"mode": "frequency",
|
||||
"index": "csi2000",
|
||||
"error": 0.0
|
||||
},
|
||||
{
|
||||
"hold": 5,
|
||||
"mode": "both",
|
||||
"index": "csi300",
|
||||
"error": 0.0
|
||||
},
|
||||
{
|
||||
"hold": 5,
|
||||
"mode": "both",
|
||||
"index": "csi500",
|
||||
"error": 0.0
|
||||
},
|
||||
{
|
||||
"hold": 5,
|
||||
"mode": "both",
|
||||
"index": "csi1000",
|
||||
"error": 0.0
|
||||
},
|
||||
{
|
||||
"hold": 5,
|
||||
"mode": "both",
|
||||
"index": "csi2000",
|
||||
"error": 0.0
|
||||
},
|
||||
{
|
||||
"hold": 10,
|
||||
"mode": "current",
|
||||
"index": "csi300",
|
||||
"error": 1.3877787807814457e-17
|
||||
},
|
||||
{
|
||||
"hold": 10,
|
||||
"mode": "current",
|
||||
"index": "csi500",
|
||||
"error": 1.3877787807814457e-17
|
||||
},
|
||||
{
|
||||
"hold": 10,
|
||||
"mode": "current",
|
||||
"index": "csi1000",
|
||||
"error": 6.938893903907228e-18
|
||||
},
|
||||
{
|
||||
"hold": 10,
|
||||
"mode": "current",
|
||||
"index": "csi2000",
|
||||
"error": 2.0816681711721685e-17
|
||||
},
|
||||
{
|
||||
"hold": 10,
|
||||
"mode": "frequency",
|
||||
"index": "csi300",
|
||||
"error": 1.3877787807814457e-17
|
||||
},
|
||||
{
|
||||
"hold": 10,
|
||||
"mode": "frequency",
|
||||
"index": "csi500",
|
||||
"error": 3.469446951953614e-18
|
||||
},
|
||||
{
|
||||
"hold": 10,
|
||||
"mode": "frequency",
|
||||
"index": "csi1000",
|
||||
"error": 6.938893903907228e-18
|
||||
},
|
||||
{
|
||||
"hold": 10,
|
||||
"mode": "frequency",
|
||||
"index": "csi2000",
|
||||
"error": 6.938893903907228e-18
|
||||
},
|
||||
{
|
||||
"hold": 10,
|
||||
"mode": "both",
|
||||
"index": "csi300",
|
||||
"error": 0.0
|
||||
},
|
||||
{
|
||||
"hold": 10,
|
||||
"mode": "both",
|
||||
"index": "csi500",
|
||||
"error": 0.0
|
||||
},
|
||||
{
|
||||
"hold": 10,
|
||||
"mode": "both",
|
||||
"index": "csi1000",
|
||||
"error": 0.0
|
||||
},
|
||||
{
|
||||
"hold": 10,
|
||||
"mode": "both",
|
||||
"index": "csi2000",
|
||||
"error": 0.0
|
||||
}
|
||||
],
|
||||
"event_exit_truncation_holds": [
|
||||
1,
|
||||
5,
|
||||
10
|
||||
],
|
||||
"ledger_rebuilds": [
|
||||
{
|
||||
"mode": "current",
|
||||
"trades": 9718,
|
||||
"error": 1.0769163338864018e-14
|
||||
},
|
||||
{
|
||||
"mode": "frequency",
|
||||
"trades": 1116,
|
||||
"error": 1.9984014443252818e-15
|
||||
},
|
||||
{
|
||||
"mode": "both",
|
||||
"trades": 56,
|
||||
"error": 7.771561172376096e-16
|
||||
}
|
||||
],
|
||||
"event_rebuilds": [
|
||||
{
|
||||
"mode": "current",
|
||||
"completed": 4859,
|
||||
"mean_net30": -0.00856604086762902
|
||||
},
|
||||
{
|
||||
"mode": "frequency",
|
||||
"completed": 558,
|
||||
"mean_net30": -0.014238870396226988
|
||||
},
|
||||
{
|
||||
"mode": "both",
|
||||
"completed": 28,
|
||||
"mean_net30": -0.05777591417209148
|
||||
}
|
||||
],
|
||||
"inside_sample_prefix_checks": [
|
||||
{
|
||||
"name": "available_current",
|
||||
"hold": 1,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 21
|
||||
},
|
||||
{
|
||||
"name": "available_current",
|
||||
"hold": 5,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 21
|
||||
},
|
||||
{
|
||||
"name": "available_current",
|
||||
"hold": 10,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 21
|
||||
},
|
||||
{
|
||||
"name": "available_frequency",
|
||||
"hold": 1,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 21
|
||||
},
|
||||
{
|
||||
"name": "available_frequency",
|
||||
"hold": 5,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 21
|
||||
},
|
||||
{
|
||||
"name": "available_frequency",
|
||||
"hold": 10,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 21
|
||||
},
|
||||
{
|
||||
"name": "available_both",
|
||||
"hold": 1,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 12
|
||||
},
|
||||
{
|
||||
"name": "available_both",
|
||||
"hold": 5,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 12
|
||||
},
|
||||
{
|
||||
"name": "available_both",
|
||||
"hold": 10,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 12
|
||||
},
|
||||
{
|
||||
"name": "strict_current",
|
||||
"hold": 1,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 1
|
||||
},
|
||||
{
|
||||
"name": "strict_current",
|
||||
"hold": 5,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 1
|
||||
},
|
||||
{
|
||||
"name": "strict_current",
|
||||
"hold": 10,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 1
|
||||
},
|
||||
{
|
||||
"name": "strict_frequency",
|
||||
"hold": 1,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 1
|
||||
},
|
||||
{
|
||||
"name": "strict_frequency",
|
||||
"hold": 5,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 1
|
||||
},
|
||||
{
|
||||
"name": "strict_frequency",
|
||||
"hold": 10,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 1
|
||||
},
|
||||
{
|
||||
"name": "strict_both",
|
||||
"hold": 1,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 1
|
||||
},
|
||||
{
|
||||
"name": "strict_both",
|
||||
"hold": 5,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 1
|
||||
},
|
||||
{
|
||||
"name": "strict_both",
|
||||
"hold": 10,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 1
|
||||
},
|
||||
{
|
||||
"name": "latest_current",
|
||||
"hold": 1,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 68
|
||||
},
|
||||
{
|
||||
"name": "latest_current",
|
||||
"hold": 5,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 68
|
||||
},
|
||||
{
|
||||
"name": "latest_current",
|
||||
"hold": 10,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 68
|
||||
},
|
||||
{
|
||||
"name": "latest_frequency",
|
||||
"hold": 1,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 68
|
||||
},
|
||||
{
|
||||
"name": "latest_frequency",
|
||||
"hold": 5,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 68
|
||||
},
|
||||
{
|
||||
"name": "latest_frequency",
|
||||
"hold": 10,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 68
|
||||
},
|
||||
{
|
||||
"name": "latest_both",
|
||||
"hold": 1,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 56
|
||||
},
|
||||
{
|
||||
"name": "latest_both",
|
||||
"hold": 5,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 56
|
||||
},
|
||||
{
|
||||
"name": "latest_both",
|
||||
"hold": 10,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 56
|
||||
},
|
||||
{
|
||||
"name": "available_universe",
|
||||
"hold": 1,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 21
|
||||
},
|
||||
{
|
||||
"name": "available_universe",
|
||||
"hold": 5,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 21
|
||||
},
|
||||
{
|
||||
"name": "available_universe",
|
||||
"hold": 10,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 21
|
||||
},
|
||||
{
|
||||
"name": "strict_universe",
|
||||
"hold": 1,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 1
|
||||
},
|
||||
{
|
||||
"name": "strict_universe",
|
||||
"hold": 5,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 1
|
||||
},
|
||||
{
|
||||
"name": "strict_universe",
|
||||
"hold": 10,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 1
|
||||
},
|
||||
{
|
||||
"name": "latest_universe",
|
||||
"hold": 1,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 68
|
||||
},
|
||||
{
|
||||
"name": "latest_universe",
|
||||
"hold": 5,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 68
|
||||
},
|
||||
{
|
||||
"name": "latest_universe",
|
||||
"hold": 10,
|
||||
"last_valuation": "2026-09-02",
|
||||
"actual_buy_events_before_stop": 68
|
||||
}
|
||||
],
|
||||
"window_example_signal_date": "2026-08-31",
|
||||
"window_example_stocks": 3
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
"""真实快照的独立计数、基线、指数区间及逐笔现金核查;断网执行。"""
|
||||
import sys
|
||||
from collections import defaultdict
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
from common import *
|
||||
from engine import future_exits,account
|
||||
|
||||
def main():
|
||||
sys.addaudithook(offline);p,panel,f,cov=load();dates=panel['dates'];t,n=panel['open'].shape;cfg=configuration();rng=np.random.default_rng(20261029)
|
||||
import datetime as dt
|
||||
# 独立按原始行建立批次,用整批最大时间选择,避免复用prepare计数算法。
|
||||
raw={};batch_meta=defaultdict(list)
|
||||
for path in sorted((PREVIOUS/'raw').glob('2026*.json.gz')):
|
||||
for r in read(path)['data']['rows']:
|
||||
key=(r['trade_date'],int(r['batch_no']));raw.setdefault(key,[]).append(r)
|
||||
scores={}
|
||||
for (day,batch),rr in raw.items():
|
||||
batch_meta[day].append((batch,max(dt.datetime.fromisoformat(r['create_time']) for r in rr)))
|
||||
scores[day,batch]={(r['stock_code'][2:]+'.'+r['stock_code'][:2] if r['stock_code'][:2] in ['SH','SZ','BJ'] else r['stock_code']):float(r['score']) for r in rr}
|
||||
def raw_value(day,code,deadline):
|
||||
options=[batch for batch,stamp in batch_meta[day] if stamp+dt.timedelta(hours=8)<deadline]
|
||||
return scores[day,max(options)].get(code,np.nan) if options else np.nan
|
||||
frequency_checks=0
|
||||
for group,key in enumerate(f['group_keys']):
|
||||
field,q=key.split(':');q=float(q)
|
||||
for _ in range(100):
|
||||
day=int(rng.integers(20,t-1));stock=int(rng.integers(n));code=str(panel['codes'][stock])
|
||||
if field=='available':
|
||||
deadline=dt.datetime.fromisoformat(str(dates[day+1])+'T09:25:00')
|
||||
history=np.array([raw_value(str(d),code,deadline) for d in dates[day-20:day]])
|
||||
assert bool(np.isfinite(history).all())==f['history_observed_available'][day,stock]
|
||||
assert np.isclose(raw_value(str(dates[day]),code,deadline),panel[field][day,stock],equal_nan=True)
|
||||
else:history=panel[field][day-20:day,stock]
|
||||
actual=int(np.sum(history>=q));assert actual==f['counts'][group,day,stock];frequency_checks+=1
|
||||
stop=int(np.searchsorted(dates,'2026-09-01'))
|
||||
for group,key in enumerate(f['group_keys']):
|
||||
field,q=key.split(':')
|
||||
if field!='available':assert np.array_equal(previous_counts(panel[field][:stop]>=float(q)),f['counts'][group,:stop])
|
||||
# 恢复上一轮原始热度与涨跌幅条件,不用本轮20日完整池替换旧基线。
|
||||
old=pd.read_csv(PREVIOUS/'results/grid_asof.csv');oldchecks=[];indexchecks=[]
|
||||
oldwindow=dates<='2026-10-08'
|
||||
for h in [1,5,10]:
|
||||
ex,gr=future_exits(panel,h);d=np.load(ROOT/f'cache/daily_{h:02}.npz')
|
||||
mask=panel['eligible']&oldwindow[:,None]&(panel['asof']>=.8)&(panel['pct']>=0)&(panel['pct']<5)&np.isfinite(gr)
|
||||
daily=divide(np.where(mask,gr*.997/1.003-1,0).sum(1),mask.sum(1));observed=float(mean(daily))
|
||||
row=old[(old.heat==.8)&(old.lower==0)&(old.upper==5)&(old.hold==h)].iloc[0]
|
||||
assert abs(observed-row.mean_daily_net30)<1e-12;assert mask.sum()==row.completed;oldchecks.append({'hold':h,'error':abs(observed-row.mean_daily_net30)})
|
||||
for c in [c for c in cfg if c['score']=='available' and c['threshold']==.8 and (c['mode']=='current' or c['k']==5)]:
|
||||
mask=mask_for(panel,f,c)&np.isfinite(gr)
|
||||
for name,op in zip(f['index_names'],f['index_opens']):
|
||||
values=np.full((t,n),np.nan)
|
||||
for day in np.flatnonzero(mask.any(1)):
|
||||
stocks=np.flatnonzero(mask[day]);values[day,stocks]=gr[day,stocks]-op[ex[day,stocks]]/op[day+1]
|
||||
direct=divide(np.nansum(values,axis=1),mask.sum(1));saved=d['excess_'+str(name)][:,c['config']]
|
||||
err=float(np.nanmax(np.abs(direct-saved)));assert err<1e-12;indexchecks.append({'hold':h,'mode':c['mode'],'index':str(name),'error':err})
|
||||
short={key:values[:stop] if key!='codes' else values for key,values in panel.items()};sx,sg=future_exits(short,h)
|
||||
valid=np.isfinite(gr[:stop])&(ex[:stop]<stop)
|
||||
assert np.array_equal(np.isfinite(sg),valid);assert np.allclose(sg[valid],gr[:stop][valid])
|
||||
oldmask=panel['eligible']&oldwindow[:,None]&(panel['asof']>=.8)&(panel['pct']>=0)&(panel['pct']<5)
|
||||
legacy=account(panel,oldmask,5,.003)['summary'];aa=pd.read_csv(PREVIOUS/'results/accounts.csv');expected=aa[(aa.key=='0.8/0/5/5')&(aa.cost_bps==30)].iloc[0]
|
||||
assert abs(legacy['return']-expected['return'])<1e-12;oldchecks.append({'cash_return':legacy['return'],'error':abs(legacy['return']-expected['return'])})
|
||||
ledgerchecks=[];eventchecks=[]
|
||||
for c in [c for c in cfg if c['score']=='available' and c['threshold']==.8 and (c['mode']=='current' or c['k']==5)]:
|
||||
mask=mask_for(panel,f,c)&(dates>='2026-01-01')[:,None];aa=account(panel,mask,5,.003,detail=True)
|
||||
byday=defaultdict(list);legs=defaultdict(dict)
|
||||
for tr in aa['journal']:byday[tr['day']].append(tr);legs[tr['signal'],tr['stock']][tr['side']]=tr
|
||||
cash=1.;quantities=np.zeros(n);err=0.
|
||||
for i,row in enumerate(aa['daily']):
|
||||
for tr in byday[i]:
|
||||
j=tr['stock'];value=tr['qty']*tr['price'];assert tr['price']==panel['open'][i,j]
|
||||
if tr['side']=='buy':assert i==tr['signal']+1 and panel['can_buy'][i,j];cash-=value*1.003;quantities[j]+=tr['qty']
|
||||
else:assert i>=tr['signal']+6 and panel['can_sell'][i,j];cash+=value*.997;quantities[j]-=tr['qty']
|
||||
assert cash>=-1e-10 and quantities[j]>=-1e-10
|
||||
value=float(quantities@panel['mark'][i]);err=max(err,abs(cash-row['cash']),abs(value-row['stock_value']),abs(cash+value-row['nav']))
|
||||
assert err<1e-10;ledgerchecks.append({'mode':c['mode'],'trades':len(aa['journal']),'error':err})
|
||||
batches=defaultdict(list)
|
||||
for (sig,j),tr in legs.items():
|
||||
if 'sell' in tr:batches[sig].append(tr['sell']['price']/tr['buy']['price']*.997/1.003-1)
|
||||
dd=np.load(ROOT/'cache/daily_05.npz');expected=mean((dd['gross'][:,c['config']][dates>='2026-01-01']+1)*.997/1.003-1)
|
||||
observed=np.mean([np.mean(v) for v in batches.values()]);assert abs(expected-observed)<1e-12
|
||||
eventchecks.append({'mode':c['mode'],'completed':sum(map(len,batches.values())),'mean_net30':float(observed)})
|
||||
print(c['mode'],'独立逐笔重建完成',flush=True)
|
||||
# 截断点放在主口径和严格口径均已有成交之后,避免只验证空仓前缀。
|
||||
stop_inside=int(np.searchsorted(dates,'2026-09-03'));prefix_checks=[]
|
||||
saved_accounts=pd.read_csv(ROOT/'account_daily.csv.gz')
|
||||
account_cfg=[c for c in cfg if c['threshold']==.8 and (c['mode']=='current' or c['k']==5)]
|
||||
account_cfg.extend(cfg[i*len(p['thresholds'])*43+1] for i in range(len(p['scores'])))
|
||||
for c in account_cfg:
|
||||
name=c['score']+('_universe' if c['mode']=='frequency' and c['k']==0 else '_'+c['mode'])
|
||||
for h in [1,5,10]:
|
||||
short=account(panel,mask_for(panel,f,c),h,.003,stop=stop_inside)['daily']
|
||||
full=saved_accounts[(saved_accounts.name==name)&(saved_accounts.hold==h)&(saved_accounts.fee_bps==30)].iloc[:stop_inside]
|
||||
for key in ['cash','stock_value','nav','buy_cash','sell_cash']:
|
||||
assert np.allclose([x[key] for x in short],full[key],atol=1e-12)
|
||||
prefix_checks.append({'name':name,'hold':h,'last_valuation':short[-1]['date'],'actual_buy_events_before_stop':int(sum(x['buy_cash']>0 for x in short))})
|
||||
# 一个事先指定日期的窗口明细,按股票代码顺序展示3只,而非按收益选例。
|
||||
day=int(np.where(dates=='2026-08-31')[0][0]);group=list(f['group_keys']).index('available:0.8');chosen=np.flatnonzero(f['base_available'][day]&(f['counts'][group,day]>=5))[:3];trace=[]
|
||||
for stock in chosen:
|
||||
for j in range(day-20,day):trace.append({'signal_date':str(dates[day]),'stock':str(panel['codes'][stock]),'historical_date':str(dates[j]),'heat':float(raw_value(str(dates[j]),str(panel['codes'][stock]),dt.datetime.fromisoformat(str(dates[day+1])+'T09:25:00'))),'hit_ge_0_8':bool(raw_value(str(dates[j]),str(panel['codes'][stock]),dt.datetime.fromisoformat(str(dates[day+1])+'T09:25:00'))>=.8),'prior20_hits':int(f['counts'][group,day,stock]),'signal_day_score':float(panel['available'][day,stock])})
|
||||
pd.DataFrame(trace).to_csv(ROOT/'window_examples.csv',index=False,lineterminator='\n')
|
||||
dump(ROOT/'audit.json',{'environment':'开发机,经unit_test_guard隔离配置、断网运行','memory_tests':12,'raw_window_checks':frequency_checks,'strict_latest_count_prefix_exact':True,'available_prefix_protection':'合成晚到修订测试及2400次原始行截止选择核验','prior_baseline_checks':oldchecks,'index_actual_exit_checks':indexchecks,'event_exit_truncation_holds':[1,5,10],'ledger_rebuilds':ledgerchecks,'event_rebuilds':eventchecks,'inside_sample_prefix_checks':prefix_checks,'window_example_signal_date':'2026-08-31','window_example_stocks':len(chosen)})
|
||||
print('全部审计通过',frequency_checks,'次直接20日计数;',len(indexchecks),'项指数区间检查')
|
||||
if __name__=='__main__':main()
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,54 @@
|
|||
"""只打开本地研究HTML并阻断外部请求;不访问任何线上业务页面。"""
|
||||
import json
|
||||
from pathlib import Path
|
||||
import pandas as pd
|
||||
from playwright.sync_api import sync_playwright
|
||||
from common import ROOT,dump
|
||||
|
||||
def main():
|
||||
errors=[];external=[];checks=[];grid=pd.read_csv(ROOT/'grid.csv.gz');out=ROOT/'cache';out.mkdir(exist_ok=True)
|
||||
with sync_playwright() as p:
|
||||
browser=p.chromium.launch(executable_path='/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',headless=True)
|
||||
context=browser.new_context(viewport={'width':1600,'height':1200},device_scale_factor=1,accept_downloads=True)
|
||||
def route(req):
|
||||
if req.request.url.startswith(('file:','data:','blob:')):req.continue_()
|
||||
else:external.append(req.request.url.split('?')[0]);req.abort()
|
||||
context.route('**/*',route);page=context.new_page();page.on('pageerror',lambda err:errors.append(str(err)))
|
||||
page.goto((ROOT/'热度反复活跃矩阵浏览器.html').as_uri(),wait_until='load');page.wait_for_function('window.__dashboardReady===true',timeout=30000)
|
||||
assert page.locator('canvas').count()==1;assert page.locator('#details tr').count()==10
|
||||
observed=page.evaluate("getDisplayedCell('full',.8,5,5)")
|
||||
row=grid[(grid.score=='available')&(grid.threshold==.8)&(grid['mode']=='frequency')&(grid.k==5)&(grid.hold==5)&(grid.period=='full')&(grid.phase_index=='all')].iloc[0]
|
||||
assert abs(observed[1]-row.mean_net30)<1e-9;checks.append('默认完整区间单矩阵、10行持有期表与源数据一致')
|
||||
coords=page.evaluate('({x:charts[0].scales.x.getPixelForValue(4),y:charts[0].scales.y.getPixelForValue(10)})')
|
||||
box=page.locator('canvas').first.bounding_box();page.mouse.click(box['x']+coords['x'],box['y']+coords['y'])
|
||||
assert '10次' in page.locator('#detail-title').inner_text();checks.append('点击K=10、H=5格后,1至10日明细切换成功')
|
||||
page.screenshot(path=str(out/'dashboard-default.png'),full_page=True)
|
||||
with page.expect_download() as download:page.locator('#download-csv').click()
|
||||
path=download.value.path();data=pd.read_csv(path);assert len(data)==210;checks.append('默认210格CSV导出成功')
|
||||
page.locator('#preset-current').click();page.wait_for_function("window.__dashboardState.mode==='current' && window.__dashboardState.view==='threshold_hold'");assert page.locator('#threshold').is_disabled();checks.append('单日分数切换成功')
|
||||
page.select_option('#mode','both');page.select_option('#view','threshold_count');page.select_option('#hold','10');page.select_option('#stage','-1');page.select_option('#phase_index','csi500');page.select_option('#metric','index_excess');page.select_option('#benchmark','csi1000');page.select_option('#period','full')
|
||||
page.wait_for_function("window.__dashboardState.mode==='both'&&window.__dashboardState.view==='threshold_count'&&window.__dashboardState.hold==='10'&&window.__dashboardState.stage==='-1'&&window.__dashboardState.phase_index==='csi500'&&window.__dashboardState.metric==='index_excess'&&window.__dashboardState.benchmark==='csi1000'&&window.__dashboardState.period==='full'")
|
||||
observed=page.evaluate("getDisplayedCell('full',.8,5,10)")
|
||||
row=grid[(grid.score=='available')&(grid.threshold==.8)&(grid['mode']=='both')&(grid.k==5)&(grid.hold==10)&(grid.period=='full')&(grid.phase_index=='csi500')&(grid.stage==-1)].iloc[0]
|
||||
assert abs(observed[15]-row.excess_csi1000)<1e-9;assert page.locator('canvas').count()==1
|
||||
displayed=page.evaluate("charts[0].data.datasets[0].data.find(p=>p.q===.8&&p.k===5&&p.h===10).z")
|
||||
assert abs(displayed-(row.excess_csi1000+row.mean_net30-row.mean_gross))<1e-9
|
||||
checks.append('阶段指数与收益指数可独立选择,阈值×次数矩阵一致')
|
||||
with page.expect_download() as download:page.locator('[data-download="0"]').click()
|
||||
download.value.save_as(out/'dashboard-export.png');assert (out/'dashboard-export.png').stat().st_size>10000;checks.append('PNG导出成功')
|
||||
page.screenshot(path=str(out/'dashboard-index.png'),full_page=True)
|
||||
page.set_viewport_size({'width':430,'height':932});page.screenshot(path=str(out/'dashboard-mobile.png'),full_page=True)
|
||||
# 手机可水平滚动图表,页面整体不应越出视口。
|
||||
overflow=page.evaluate('document.documentElement.scrollWidth>window.innerWidth');assert not overflow;checks.append('430像素视口无页面级横向溢出')
|
||||
page.select_option('#score','strict');page.select_option('#stage','99');page.select_option('#metric','return');page.select_option('#period','full')
|
||||
page.wait_for_function("window.__dashboardState.score==='strict'&&window.__dashboardState.stage==='99'&&window.__dashboardState.period==='full'&&window.__dashboardState.metric==='return'")
|
||||
assert page.evaluate('charts[0].data.datasets[0].data.every(p=>!p.ok)');assert '4个选股日' in page.locator('#basis-note').inner_text();checks.append('严格4日样本全部标灰并明确提示')
|
||||
page.select_option('#period','2026-10');page.wait_for_function("window.__dashboardState.period==='2026-10'")
|
||||
assert page.evaluate('charts[0].data.datasets[0].data.every(p=>p.z===null)');checks.append('10月无完整窗口显示缺值,没有伪造0收益')
|
||||
page.select_option('#score','latest');page.select_option('#period','compare');page.wait_for_function("window.__dashboardState.score==='latest'&&window.__dashboardState.period==='compare'")
|
||||
assert page.locator('canvas').count()==2;assert page.locator('#details tr').count()==20;assert '不代表历史可执行收益' in page.locator('#basis-note').inner_text();checks.append('含回填诊断和8/9月并排切换正确')
|
||||
assert not errors,errors;assert not external,external
|
||||
browser.close()
|
||||
dump(ROOT/'browser_checks.json',{'browser':'本机Google Chrome,无头模式,独立临时上下文','external_requests':external,'page_errors':errors,'checks':checks,'data_comparisons_tolerance':1e-9,'screenshots':'cache/dashboard-*.png(不入Git)'})
|
||||
print('浏览器验收通过',len(checks),'项;外部请求0')
|
||||
if __name__=='__main__':main()
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"browser": "本机Google Chrome,无头模式,独立临时上下文",
|
||||
"external_requests": [],
|
||||
"page_errors": [],
|
||||
"checks": [
|
||||
"默认完整区间单矩阵、10行持有期表与源数据一致",
|
||||
"点击K=10、H=5格后,1至10日明细切换成功",
|
||||
"默认210格CSV导出成功",
|
||||
"单日分数切换成功",
|
||||
"阶段指数与收益指数可独立选择,阈值×次数矩阵一致",
|
||||
"PNG导出成功",
|
||||
"430像素视口无页面级横向溢出",
|
||||
"严格4日样本全部标灰并明确提示",
|
||||
"10月无完整窗口显示缺值,没有伪造0收益",
|
||||
"含回填诊断和8/9月并排切换正确"
|
||||
],
|
||||
"data_comparisons_tolerance": 1e-09,
|
||||
"screenshots": "cache/dashboard-*.png(不入Git)"
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
"""把分组结果分块嵌入独立HTML;浏览器只解压当前筛选,无联网请求。"""
|
||||
import base64,gzip,json,sys
|
||||
import pandas as pd
|
||||
from common import ROOT,dump,digest,offline
|
||||
COLUMNS=['mean_gross','mean_net30','mean_net60','win30','active_days','completed','mean_selected','filled','unresolved','delayed','delta_k0_net30','delta_current_net30','delta_universe_net30','excess_csi300','excess_csi500','excess_csi1000','excess_csi2000']
|
||||
def main():
|
||||
sys.addaudithook(offline);g=pd.read_csv(ROOT/'grid.csv.gz');payload={}
|
||||
for key,z in g.groupby(['score','period','phase_index','stage']):
|
||||
z=z.sort_values(['config','hold']);assert len(z)==3440
|
||||
raw=z[COLUMNS].to_json(orient='values',double_precision=10).encode();payload['|'.join(map(str,key))]=base64.b64encode(gzip.compress(raw,mtime=0)).decode()
|
||||
chart=(ROOT/'vendor/chart.umd.js').read_text();expected='jb8JQMbMoBUzgWatfe6COACi2ljcDdZQ2OxczGA3bGNeWe+6DChMTBJemed7ZnvJ'
|
||||
import hashlib
|
||||
assert base64.b64encode(hashlib.sha384(chart.encode()).digest()).decode()==expected
|
||||
html=(ROOT/'dashboard.html.tpl').read_text().replace('/*__CHARTJS__*/',chart).replace('/*__PAYLOAD__*/',json.dumps(payload,separators=(',',':')))
|
||||
assert '<script src=' not in html
|
||||
dest=ROOT/'热度反复活跃矩阵浏览器.html';dest.write_text(html)
|
||||
dump(ROOT/'dashboard_manifest.json',{'chunks':len(payload),'rows_per_chunk':3440,'columns':COLUMNS,'html_bytes':dest.stat().st_size,'html_sha256':digest(dest),'chartjs_version':'4.5.1','chartjs_sha384':expected,'external_runtime_requests':0,'data_source':'grid.csv.gz','data_source_sha256':digest(ROOT/'grid.csv.gz'),'default':'热度>=0.8,历史频次,当时可查口径,全区间,30基点,全部阶段'})
|
||||
print('独立矩阵浏览器',dest.stat().st_size,'字节;',len(payload),'个按需本地分块')
|
||||
if __name__=='__main__':main()
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,93 @@
|
|||
"""全部频次、门槛、持有期与市场分组;不按事后冠军选账户。"""
|
||||
import sys
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
from common import *
|
||||
from engine import future_exits,account
|
||||
|
||||
def slices(dates,features):
|
||||
out=[]
|
||||
for period in ['full','2026-08','2026-09','2026-10']:
|
||||
period_mask=features['window'] if period=='full' else features['window']&np.char.startswith(dates,period)
|
||||
out.append((period,'all',99,period_mask))
|
||||
for ix,index in enumerate(features['index_names']):
|
||||
for stage in [-1,0,1]:out.append((period,str(index),stage,period_mask&(features['stages'][ix]==stage)))
|
||||
return out
|
||||
|
||||
def main():
|
||||
sys.addaudithook(offline);p,panel,f,cov=load();dates=panel['dates'];t,n=panel['open'].shape;configs=configuration();nc=len(configs);n_groups=len(f['group_keys'])
|
||||
ids=[];selected=[];filled=[];can_buy=np.vstack([panel['can_buy'][1:],np.zeros((1,n),bool)])
|
||||
for group,key in enumerate(f['group_keys']):
|
||||
field,q=key.split(':');q=float(q);hit=panel[field]>=q;base=f['base_'+field]
|
||||
bucket=np.arange(t,dtype=np.int32)[:,None]*42+hit.astype(np.int32)*21+np.maximum(f['counts'][group],0)
|
||||
ids.append(bucket);selected.append(aggregate(bucket,base,None,t));filled.append(aggregate(bucket,base&can_buy,None,t))
|
||||
selected=np.concatenate(selected,axis=1);filled=np.concatenate(filled,axis=1)
|
||||
cfg=pd.DataFrame(configs);sl=slices(dates,f);all_rows=[];checks=[];daily_dir=ROOT/'cache'
|
||||
control=np.array([c['config']//43*43+(1 if c['mode']=='frequency' else 0) for c in configs])
|
||||
current=np.array([c['config']//43*43 for c in configs]);universe=np.array([c['config']//43*43+1 for c in configs])
|
||||
for h in p['holds']:
|
||||
exits,gross=future_exits(panel,h);gr=gross-1
|
||||
fields={'completed':[],'gross':[],'wins30':[],'delayed':[]}
|
||||
for index in f['index_names']:fields['excess_'+str(index)]=[]
|
||||
ix_excess=[]
|
||||
# 比较各股票实际持有区间的指数开盘收益,卖出延期不偷偷截回计划日。
|
||||
for op in f['index_opens']:
|
||||
benchmark=op[np.maximum(exits,0)]/np.r_[op[1:],np.nan][:,None]-1
|
||||
ix_excess.append(gr-benchmark)
|
||||
for group,bucket in enumerate(ids):
|
||||
field=str(f['group_keys'][group]).split(':')[0];ok=f['base_'+field]&np.isfinite(gross)
|
||||
cc=aggregate(bucket,ok,None,t);fields['completed'].append(cc)
|
||||
fields['gross'].append(divide(aggregate(bucket,ok,gr,t),cc))
|
||||
fields['wins30'].append(aggregate(bucket,ok,gross*.997/1.003>1,t))
|
||||
fields['delayed'].append(aggregate(bucket,ok&(exits>np.arange(t)[:,None]+h+1),None,t))
|
||||
for index,values in zip(f['index_names'],ix_excess):fields['excess_'+str(index)].append(divide(aggregate(bucket,ok,values,t),cc))
|
||||
d={k:np.concatenate(values,axis=1) for k,values in fields.items()};d['selected']=selected;d['filled']=filled
|
||||
np.savez_compressed(daily_dir/f'daily_{h:02}.npz',**d)
|
||||
for period,index,stage,dd in sl:
|
||||
v=d['gross'][dd];cc=d['completed'][dd];ntr=cc.sum(0)
|
||||
z=cfg.copy();z['hold']=h;z['period']=period;z['phase_index']=index;z['stage']=stage;z['phase_days']=int(dd.sum())
|
||||
z['active_days']=np.sum(cc>0,axis=0);z['selected']=selected[dd].sum(0).astype(int);z['mean_selected']=divide(selected[dd].sum(0),np.full(nc,dd.sum()))
|
||||
z['filled']=filled[dd].sum(0).astype(int);z['completed']=ntr.astype(int);z['unresolved']=(filled[dd].sum(0)-ntr).astype(int);z['delayed']=d['delayed'][dd].sum(0).astype(int)
|
||||
z['mean_gross']=mean(v);z['mean_net30']=(z['mean_gross']+1)*.997/1.003-1;z['mean_net60']=(z['mean_gross']+1)*.994/1.006-1
|
||||
z['win30']=divide(d['wins30'][dd].sum(0),ntr)
|
||||
z['delta_k0_net30']=mean(v-v[:,control])*.997/1.003;z['delta_current_net30']=mean(v-v[:,current])*.997/1.003;z['delta_universe_net30']=mean(v-v[:,universe])*.997/1.003
|
||||
z['paired_days']=np.sum(np.isfinite(v-v[:,control]),axis=0)
|
||||
for key in ['csi300','csi500','csi1000','csi2000']:z['excess_'+key]=mean(d['excess_'+key][dd])
|
||||
z['supported']=(z.active_days>=20)&(z.completed>=100)
|
||||
all_rows.append(z)
|
||||
# K=0条件是本实验的恒等式,覆盖每一分数阈值与持有期。
|
||||
for group in range(n_groups):
|
||||
off=group*43;assert np.array_equal(d['completed'][:,off],d['completed'][:,off+22]);assert np.allclose(d['gross'][:,off],d['gross'][:,off+22],equal_nan=True,atol=1e-14)
|
||||
basis_start=(group//len(p['thresholds']))*len(p['thresholds'])*43
|
||||
assert np.array_equal(d['completed'][:,basis_start+1],d['completed'][:,off+1])
|
||||
# 对K=5直接逐股筛选,再独立等权计算,核对分桶累计没有错位。
|
||||
config=configs[off+6];mask=mask_for(panel,f,config)&np.isfinite(gross)
|
||||
direct=divide(np.where(mask,gr,0).sum(1),mask.sum(1))
|
||||
assert np.allclose(direct,d['gross'][:,off+6],equal_nan=True,atol=1e-12)
|
||||
delta=np.abs(direct-d['gross'][:,off+6]);error=float(np.nanmax(delta)) if np.isfinite(delta).any() else 0.
|
||||
assert error<1e-12;checks.append({'hold':h,'group':str(f['group_keys'][group]),'max_error':error})
|
||||
print('持有',h,'日:',nc,'组条件、',len(sl),'种时间阶段分组完成',flush=True)
|
||||
grid=pd.concat(all_rows,ignore_index=True);grid.to_csv(ROOT/'grid.csv.gz',index=False,compression={'method':'gzip','mtime':0},lineterminator='\n')
|
||||
focus=grid[(grid.threshold==.8)&grid.k.isin([0,1,3,5,8,10,15,20])];focus.to_csv(ROOT/'focus_grid.csv',index=False,lineterminator='\n')
|
||||
accounts=[];curves=[];cashchecks=[]
|
||||
account_configs=[c for c in configs if c['threshold']==.8 and (c['mode']=='current' or c['k']==5)]
|
||||
# 无分数/频次门槛对照,其完整历史观察池与所有条件一致。
|
||||
account_configs.extend(configs[i*len(p['thresholds'])*43+1] for i in range(len(p['scores'])));test=f['window']
|
||||
for c in account_configs:
|
||||
mask=mask_for(panel,f,c)&test[:,None]
|
||||
for h in [1,5,10]:
|
||||
for fee in [30,60]:
|
||||
aa=account(panel,mask,h,fee/10000);cash=1.;err=0.
|
||||
for row in aa['daily']:
|
||||
err=max(err,abs(row['cash']-(cash+row['sell_cash']-row['buy_cash'])),abs(row['nav']-row['cash']-row['stock_value']));cash=row['cash'];assert cash>=-1e-12
|
||||
assert err<1e-10
|
||||
name=c['score']+('_universe' if c['mode']=='frequency' and c['k']==0 else '_'+c['mode'])
|
||||
accounts.append({'name':name,**c,'hold':h,'fee_bps':fee,**aa['summary']})
|
||||
curves.extend({'name':name,'hold':h,'fee_bps':fee,**row} for row in aa['daily'])
|
||||
cashchecks.append({'name':name,'hold':h,'fee_bps':fee,'error':err})
|
||||
if fee==30:assert account(panel,mask,h,.003,stop=t//2)['daily']==aa['daily'][:t//2]
|
||||
print('预设账户',c['score'],c['mode'],c['k'],'完成',flush=True)
|
||||
pd.DataFrame(accounts).to_csv(ROOT/'accounts.csv',index=False,lineterminator='\n');pd.DataFrame(curves).to_csv(ROOT/'account_daily.csv.gz',index=False,compression={'method':'gzip','mtime':0},lineterminator='\n')
|
||||
dump(ROOT/'calculation_checks.json',{'grid_rows':len(grid),'combinations':nc*10,'k0_identities':'全部24组阈值、10个持有期通过;无门槛历史池一致,both K0=current','direct_mask_checks':checks,'account_checks':cashchecks,'account_prefix_check':'全部36条30bp预设账户前半段与截断计算逐日一致'})
|
||||
print('计算完成',len(grid),'行分组结果,',len(accounts),'账户')
|
||||
if __name__=='__main__':main()
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
"""155模拟PMS只读核对:使用既有连接注入守卫,不导出凭证、不改变历史缓存。"""
|
||||
import gzip, importlib.util, json, shlex, subprocess
|
||||
from pathlib import Path
|
||||
ROOT=Path(__file__).resolve().parent
|
||||
OLD=ROOT.parent/'heat_calibration_20261028'
|
||||
def main():
|
||||
spec=importlib.util.spec_from_file_location('old_fetch',OLD/'fetch.py');m=importlib.util.module_from_spec(spec);spec.loader.exec_module(m)
|
||||
code=(OLD/'readonly_support.py').read_text()+'''
|
||||
import gzip,hashlib,inspect
|
||||
from app.services import strategy_advisor,param_store
|
||||
signal.alarm(100)
|
||||
data={}
|
||||
data['latest_date']=read('proxy','SELECT MAX(trade_date) AS trade_date FROM stock_fund_heat_scores')
|
||||
assert data['latest_date']['ok']
|
||||
day=data['latest_date']['rows'][0]['trade_date']
|
||||
data['latest_batch']=read('proxy','SELECT MAX(batch_no) AS batch FROM stock_fund_heat_scores WHERE trade_date=%s',(day,))
|
||||
assert data['latest_batch']['ok']
|
||||
batch=data['latest_batch']['rows'][0]['batch']
|
||||
data['latest_summary']=read('proxy','SELECT COUNT(*) AS rows_count,MIN(score) AS min_score,MAX(score) AS max_score,SUM(score>=0.8) AS above_08,MIN(create_time) AS first_create,MAX(create_time) AS last_create FROM stock_fund_heat_scores WHERE trade_date=%s AND batch_no=%s',(day,batch))
|
||||
data['heat_threshold_paramstore']=param_store.get_float('PMS_AUTO_HEAT_TH',.8)
|
||||
source=inspect.getsource(strategy_advisor.heat_of)
|
||||
data['heat_of_source']=source
|
||||
data['heat_of_sha256']=hashlib.sha256(source.encode()).hexdigest()
|
||||
out={'checked_at_beijing':dt.datetime.now(dt.timezone(dt.timedelta(hours=8))).isoformat(),'host':'155','prefix':settings.PMS_TABLE_PREFIX,'data':data}
|
||||
sys.stdout.buffer.write(gzip.compress(json.dumps(out,ensure_ascii=False,default=encode).encode()))
|
||||
for conn in CONNECTIONS.values():conn.close()
|
||||
'''
|
||||
wrapper=m.WRAPPER.replace("'pms-heat-research'","'pms-heat-recurrence-source'").replace("'role': 'readonly-research'","'role': 'readonly-research', 'mounts': [{'destination':x['Destination'],'type':x['Type']} for x in info.get('Mounts',[])]")
|
||||
r=subprocess.run(['ssh','-o','BatchMode=yes','-o','ConnectTimeout=8','-p','2280','factor@192.168.16.155','python3 -c '+shlex.quote(wrapper)],input=json.dumps({'mode':'probe','code':code}).encode(),stdout=subprocess.PIPE,stderr=subprocess.PIPE,timeout=140)
|
||||
if r.returncode:raise RuntimeError('只读核对失败,退出码'+str(r.returncode)+';不回显可能含配置的异常正文')
|
||||
out=json.loads(gzip.decompress(r.stdout));out['instance']=next(json.loads(line) for line in r.stderr.decode().splitlines() if line.startswith('{') and '"source_image"' in line);(ROOT/'source_check.json').write_text(json.dumps(out,ensure_ascii=False,indent=2)+'\n')
|
||||
print({k:v for k,v in out.items() if k!='data'});print({k:v for k,v in out['data'].items() if 'source' not in k})
|
||||
if __name__=='__main__':main()
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
"""研究公共函数,仅处理离线缓存。"""
|
||||
import gzip,hashlib,json,sys
|
||||
from pathlib import Path
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
ROOT=Path(__file__).resolve().parent
|
||||
PREVIOUS=ROOT.parent/'heat_calibration_20261028'
|
||||
OLD=ROOT.parent/'macro_timing_20261026'
|
||||
def read(path):
|
||||
with gzip.open(path,'rt') if str(path).endswith('.gz') else open(path) as f:return json.load(f)
|
||||
def dump(path,value):path.write_text(json.dumps(value,ensure_ascii=False,indent=2,allow_nan=False)+'\n')
|
||||
def digest(path):return hashlib.sha256(path.read_bytes()).hexdigest()
|
||||
def offline(event,args):
|
||||
if event in ('socket.connect','socket.getaddrinfo','socket.sendto','socket.sendmsg'):raise RuntimeError('离线研究禁止联网')
|
||||
def divide(a,b):return np.divide(a,b,out=np.full(np.broadcast_shapes(a.shape,b.shape),np.nan),where=b>0)
|
||||
def mean(a,axis=0):
|
||||
a=np.asarray(a);return divide(np.nansum(a,axis=axis),np.sum(np.isfinite(a),axis=axis))
|
||||
def previous_counts(hit,window=20):
|
||||
"""明确排除当天,前window个日历交易日不足则返回-1。"""
|
||||
c=np.vstack([np.zeros((1,hit.shape[1]),dtype=np.int32),np.cumsum(hit,axis=0,dtype=np.int32)])
|
||||
out=np.full(hit.shape,-1,dtype=np.int16)
|
||||
out[window:]=c[window:-1]-c[:-window-1]
|
||||
return out
|
||||
|
||||
def regime(rows,dates):
|
||||
series=pd.Series({r['timestamp'][:10]:float(r['close']) for r in rows}).sort_index()
|
||||
ma=series.rolling(60,min_periods=60).mean();r20=series/series.shift(20)-1
|
||||
stage=np.where((series>=ma)&(r20>0),1,np.where((series<ma)&(r20<0),-1,0))
|
||||
z=pd.DataFrame({'close':series,'ma60':ma,'return20':r20,'stage':stage})
|
||||
assert z.loc[dates,['close','ma60','return20']].notna().all().all()
|
||||
return z.loc[dates]
|
||||
|
||||
def aggregate(ids,valid,weights,t):
|
||||
"""按当天是否达标及历史达标次数分桶,再累加为>=K。"""
|
||||
x=np.bincount(ids[valid],weights=None if weights is None else weights[valid],minlength=t*42).reshape(t,2,21)
|
||||
x=x[:,:,::-1].cumsum(2)[:,:,::-1]
|
||||
return np.concatenate([x[:,1,:1],x.sum(1),x[:,1]],axis=1)
|
||||
def configuration():
|
||||
p=read(ROOT/'protocol.json');rows=[]
|
||||
for score in p['scores']:
|
||||
for threshold in p['thresholds']:
|
||||
for mode,ks in [('current',[0]),('frequency',range(21)),('both',range(21))]:
|
||||
for k in ks:rows.append({'config':len(rows),'score':score,'threshold':threshold,'mode':mode,'k':k})
|
||||
return rows
|
||||
|
||||
def load():
|
||||
p=read(ROOT/'protocol.json');cov=read(ROOT/'coverage.json')
|
||||
assert digest(ROOT/'protocol.json')==(ROOT/'protocol.sha256').read_text().split()[0]
|
||||
assert digest(PREVIOUS/'cache/panel.npz')==cov['source_sha256']['heat_calibration_20261028/cache/panel.npz']
|
||||
panel=dict(np.load(PREVIOUS/'cache/panel.npz'));features=dict(np.load(ROOT/'cache/features.npz'))
|
||||
for field in p['scores']:panel[field]=features['today_'+field]
|
||||
return p,panel,features,cov
|
||||
|
||||
def mask_for(panel,features,config):
|
||||
field=config['score'];base=features['base_'+field];q=config['threshold'];mode=config['mode'];k=config['k']
|
||||
if mode=='current':return base&(panel[field]>=q)
|
||||
group=next(i for i,c in enumerate(features['group_keys']) if c==field+':'+str(q))
|
||||
mask=base&(features['counts'][group]>=k)
|
||||
return mask if mode=='frequency' else mask&(panel[field]>=q)
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
basis,mode,active_days,completed,unique_stocks,median_completed_per_active_day,max_stock_fraction,top5_stock_fraction,mean_selected_per_usable_day
|
||||
available,current,24,4859,2897,203.5,0.0014406256431364478,0.0065857172257666186,205.25
|
||||
available,frequency,24,558,96,21.0,0.02867383512544803,0.13620071684587814,23.416666666666668
|
||||
available,both,13,28,22,2.0,0.10714285714285714,0.39285714285714285,1.1666666666666667
|
||||
strict,current,4,812,715,203.5,0.003694581280788177,0.01847290640394089,205.5
|
||||
strict,frequency,4,99,39,23.0,0.04040404040404041,0.20202020202020202,25.25
|
||||
strict,both,2,3,3,1.5,0.3333333333333333,1.0,0.75
|
||||
latest,current,71,15432,4569,213.0,0.000842405391394505,0.003758424053913945,219.64788732394365
|
||||
latest,frequency,71,4008,482,52.0,0.007984031936127744,0.03268463073852296,56.95774647887324
|
||||
latest,both,57,297,175,4.0,0.026936026936026935,0.09764309764309764,4.253521126760563
|
||||
|
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,191 @@
|
|||
{
|
||||
"created_at_beijing": "2026-10-29T09:58:25.395847+08:00",
|
||||
"source_sha256": {
|
||||
"heat_calibration_20261028/coverage.json": "deb42fa6f14de8ba8dab15300098f4017fedf39d9c427b09753d83391ffd589c",
|
||||
"heat_calibration_20261028/cache/panel.npz": "754a40dfaf46576c0f01015922f4ec83016b4130e60bdba01e8e5fd6fb1dd802",
|
||||
"heat_calibration_20261028/protocol.json": "1be91305138b7dc546c7a95b93431c0b7ae6087353ae808511810a4d1da5d93b",
|
||||
"score_recurrence_20261029/engine.py": "6e8f7b5fc97ba1353eaeda346111ff214ce53b33a846bddf2486167362be479d",
|
||||
"heat_calibration_20261028/raw/202604.json.gz": "b165f1c70ffdfc443b04792284988ccb3bb963eedb58a869e6fa98ba3f7105d2",
|
||||
"heat_calibration_20261028/raw/202605.json.gz": "bdfa5067151b4b2db3b9346898883c316f05605ca796ccaeeff20145f5628b44",
|
||||
"heat_calibration_20261028/raw/202606.json.gz": "4435ec35be4fd67a60e76091815b8c47dea2210b8c8e34073f12ef0d811653a8",
|
||||
"heat_calibration_20261028/raw/202607.json.gz": "35a3b65a400c0dd096dc564cca8efef50be176859cee890a22efacf714312884",
|
||||
"heat_calibration_20261028/raw/202608.json.gz": "2fb24c1e48dca6d15aa437917cd82012f9700405ca2150c8e0962994677791fc",
|
||||
"heat_calibration_20261028/raw/202609.json.gz": "444943155f6b1ae4c91b7378ec22ff8733d59f9171853c7f3a90b365f65ba5a0",
|
||||
"heat_calibration_20261028/raw/202610.json.gz": "9484ef7e7d4549dc7b7f1fc868408e7dd2557bbdd1daad6fa334af9e2704c58e",
|
||||
"macro_timing_20261026/raw/export.json": "a1b6678eb5aa0578b0a5f679304bfb65ef4a965a1260c6bed8d45bb672c0d67c",
|
||||
"macro_timing_20261026/raw/csi2000.json": "45e62d8a5ba450a701c29774356dc47004ac07cf70275ebf601f0602d5a52122"
|
||||
},
|
||||
"features_sha256": "1e34b4e83c3799ae6b8862a684a7fc0e81a5b1d7d956847f2d11e56e6600c7f5",
|
||||
"panel_shape": [
|
||||
120,
|
||||
5232
|
||||
],
|
||||
"raw_heat_rows": 636116,
|
||||
"raw_heat_first": "2026-04-27",
|
||||
"raw_heat_last": "2026-10-27",
|
||||
"first_calendar_signal": "2026-05-28",
|
||||
"last_calendar_signal": "2026-10-08",
|
||||
"calendar_days": 89,
|
||||
"basis_coverage": {
|
||||
"available": {
|
||||
"usable_days": 24,
|
||||
"first_signal": "2026-08-04",
|
||||
"last_signal": "2026-09-04",
|
||||
"stock_days": 117146,
|
||||
"by_month": {
|
||||
"2026-04": 0,
|
||||
"2026-05": 0,
|
||||
"2026-06": 0,
|
||||
"2026-07": 0,
|
||||
"2026-08": 20,
|
||||
"2026-09": 4,
|
||||
"2026-10": 0
|
||||
},
|
||||
"signal_dates": [
|
||||
"2026-08-04",
|
||||
"2026-08-05",
|
||||
"2026-08-06",
|
||||
"2026-08-07",
|
||||
"2026-08-10",
|
||||
"2026-08-11",
|
||||
"2026-08-12",
|
||||
"2026-08-13",
|
||||
"2026-08-14",
|
||||
"2026-08-17",
|
||||
"2026-08-18",
|
||||
"2026-08-19",
|
||||
"2026-08-20",
|
||||
"2026-08-21",
|
||||
"2026-08-24",
|
||||
"2026-08-25",
|
||||
"2026-08-26",
|
||||
"2026-08-27",
|
||||
"2026-08-28",
|
||||
"2026-08-31",
|
||||
"2026-09-01",
|
||||
"2026-09-02",
|
||||
"2026-09-03",
|
||||
"2026-09-04"
|
||||
]
|
||||
},
|
||||
"strict": {
|
||||
"usable_days": 4,
|
||||
"first_signal": "2026-09-01",
|
||||
"last_signal": "2026-09-04",
|
||||
"stock_days": 19525,
|
||||
"by_month": {
|
||||
"2026-04": 0,
|
||||
"2026-05": 0,
|
||||
"2026-06": 0,
|
||||
"2026-07": 0,
|
||||
"2026-08": 0,
|
||||
"2026-09": 4,
|
||||
"2026-10": 0
|
||||
},
|
||||
"signal_dates": [
|
||||
"2026-09-01",
|
||||
"2026-09-02",
|
||||
"2026-09-03",
|
||||
"2026-09-04"
|
||||
]
|
||||
},
|
||||
"latest": {
|
||||
"usable_days": 71,
|
||||
"first_signal": "2026-05-28",
|
||||
"last_signal": "2026-09-04",
|
||||
"stock_days": 342643,
|
||||
"by_month": {
|
||||
"2026-04": 0,
|
||||
"2026-05": 2,
|
||||
"2026-06": 21,
|
||||
"2026-07": 23,
|
||||
"2026-08": 21,
|
||||
"2026-09": 4,
|
||||
"2026-10": 0
|
||||
},
|
||||
"signal_dates": [
|
||||
"2026-05-28",
|
||||
"2026-05-29",
|
||||
"2026-06-01",
|
||||
"2026-06-02",
|
||||
"2026-06-03",
|
||||
"2026-06-04",
|
||||
"2026-06-05",
|
||||
"2026-06-08",
|
||||
"2026-06-09",
|
||||
"2026-06-10",
|
||||
"2026-06-11",
|
||||
"2026-06-12",
|
||||
"2026-06-15",
|
||||
"2026-06-16",
|
||||
"2026-06-17",
|
||||
"2026-06-18",
|
||||
"2026-06-22",
|
||||
"2026-06-23",
|
||||
"2026-06-24",
|
||||
"2026-06-25",
|
||||
"2026-06-26",
|
||||
"2026-06-29",
|
||||
"2026-06-30",
|
||||
"2026-07-01",
|
||||
"2026-07-02",
|
||||
"2026-07-03",
|
||||
"2026-07-06",
|
||||
"2026-07-07",
|
||||
"2026-07-08",
|
||||
"2026-07-09",
|
||||
"2026-07-10",
|
||||
"2026-07-13",
|
||||
"2026-07-14",
|
||||
"2026-07-15",
|
||||
"2026-07-16",
|
||||
"2026-07-17",
|
||||
"2026-07-20",
|
||||
"2026-07-21",
|
||||
"2026-07-22",
|
||||
"2026-07-23",
|
||||
"2026-07-24",
|
||||
"2026-07-27",
|
||||
"2026-07-28",
|
||||
"2026-07-29",
|
||||
"2026-07-30",
|
||||
"2026-07-31",
|
||||
"2026-08-03",
|
||||
"2026-08-04",
|
||||
"2026-08-05",
|
||||
"2026-08-06",
|
||||
"2026-08-07",
|
||||
"2026-08-10",
|
||||
"2026-08-11",
|
||||
"2026-08-12",
|
||||
"2026-08-13",
|
||||
"2026-08-14",
|
||||
"2026-08-17",
|
||||
"2026-08-18",
|
||||
"2026-08-19",
|
||||
"2026-08-20",
|
||||
"2026-08-21",
|
||||
"2026-08-24",
|
||||
"2026-08-25",
|
||||
"2026-08-26",
|
||||
"2026-08-27",
|
||||
"2026-08-28",
|
||||
"2026-08-31",
|
||||
"2026-09-01",
|
||||
"2026-09-02",
|
||||
"2026-09-03",
|
||||
"2026-09-04"
|
||||
]
|
||||
}
|
||||
},
|
||||
"timestamp_sensitivity": {
|
||||
"base_differing_stock_days": 0,
|
||||
"configuration_mask_differences": 0
|
||||
},
|
||||
"configurations": 1032,
|
||||
"combinations": 10320,
|
||||
"previous_quality": {
|
||||
"missing_listing_codes": 78
|
||||
},
|
||||
"availability": "available只使用截至选股次日09:25已整批入库的观测;包含此前回填历史。strict逐日及时入库;latest含未来入库,仅诊断。"
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
condition,hold,active_days,completed,mean_net30,mean_net60
|
||||
仅当天完整样本,1,41,8321,-0.008796735205536555,-0.014726272912860217
|
||||
current,1,24,4859,-0.008838788590678126,-0.014768074727873004
|
||||
frequency,1,24,558,-0.0049034550980156565,-0.01085628303452102
|
||||
both,1,13,28,-0.018195728422304176,-0.02406903983713138
|
||||
仅当天完整样本,2,41,8321,-0.00975363797682131,-0.015677451337518855
|
||||
current,2,24,4859,-0.00811590969657372,-0.014049520211837807
|
||||
frequency,2,24,558,-0.006156168525476965,-0.012101502528327646
|
||||
both,2,13,28,-0.02234950590865943,-0.028197968756993874
|
||||
仅当天完整样本,3,41,8321,-0.009639667725230236,-0.015564162874344367
|
||||
current,3,24,4859,-0.006969991946422072,-0.0129104575263842
|
||||
frequency,3,24,558,-0.006426427960407083,-0.01237014522775337
|
||||
both,3,13,28,-0.048605885992498585,-0.054297278942766036
|
||||
仅当天完整样本,4,41,8320,-0.01159805493396416,-0.01751083469511272
|
||||
current,4,24,4859,-0.007256782231891311,-0.01319553218613656
|
||||
frequency,4,24,558,-0.01013079648526285,-0.016052353622966753
|
||||
both,4,13,28,-0.038175820384485894,-0.04392960766849807
|
||||
仅当天完整样本,5,41,8320,-0.01395625426648008,-0.019854926899090852
|
||||
current,5,24,4859,-0.00856604086762902,-0.01449695862566891
|
||||
frequency,5,24,558,-0.014238870396226988,-0.020135852373593166
|
||||
both,5,13,28,-0.057775914172091464,-0.06341245053562294
|
||||
仅当天完整样本,6,41,8320,-0.016917362780944783,-0.022798321585105197
|
||||
current,6,24,4859,-0.009852370125153097,-0.01577559285422414
|
||||
frequency,6,24,558,-0.019004298100778697,-0.024872772521451703
|
||||
both,6,13,28,-0.05630881086611769,-0.0619541236781157
|
||||
仅当天完整样本,7,41,8320,-0.02029843860511689,-0.026159171268683612
|
||||
current,7,24,4859,-0.01133005513304928,-0.017244438112207328
|
||||
frequency,7,24,558,-0.02420679865122873,-0.03004415087499024
|
||||
both,7,13,28,-0.061944034740787086,-0.06755563673519516
|
||||
仅当天完整样本,8,41,8320,-0.023512209552747743,-0.02935371692046085
|
||||
current,8,24,4859,-0.011674033801122053,-0.017586359044439837
|
||||
frequency,8,24,558,-0.027577165654782677,-0.0333943557998414
|
||||
both,8,13,28,-0.08238374202960139,-0.08787307040022274
|
||||
仅当天完整样本,9,41,8319,-0.02787562434726706,-0.033691029064317424
|
||||
current,9,24,4859,-0.01276573747934491,-0.018671531975282152
|
||||
frequency,9,24,558,-0.02817850059997462,-0.033992093462458906
|
||||
both,9,13,28,-0.0845583516017704,-0.09003467110739416
|
||||
仅当天完整样本,10,41,8319,-0.033956451120941276,-0.03973547935203059
|
||||
current,10,24,4859,-0.016423999030506592,-0.022307909216150112
|
||||
frequency,10,24,558,-0.02747157107801827,-0.03328939290685662
|
||||
both,10,13,28,-0.09482643385635728,-0.10024132803876717
|
||||
|
|
|
@ -0,0 +1,361 @@
|
|||
date,basis,calendar_window,current_eligible,common_eligible
|
||||
2026-04-27,available,False,0,0
|
||||
2026-04-28,available,False,0,0
|
||||
2026-04-29,available,False,0,0
|
||||
2026-04-30,available,False,0,0
|
||||
2026-05-06,available,False,0,0
|
||||
2026-05-07,available,False,0,0
|
||||
2026-05-08,available,False,0,0
|
||||
2026-05-11,available,False,0,0
|
||||
2026-05-12,available,False,0,0
|
||||
2026-05-13,available,False,0,0
|
||||
2026-05-14,available,False,0,0
|
||||
2026-05-15,available,False,0,0
|
||||
2026-05-18,available,False,0,0
|
||||
2026-05-19,available,False,0,0
|
||||
2026-05-20,available,False,0,0
|
||||
2026-05-21,available,False,0,0
|
||||
2026-05-22,available,False,0,0
|
||||
2026-05-25,available,False,0,0
|
||||
2026-05-26,available,False,0,0
|
||||
2026-05-27,available,False,0,0
|
||||
2026-05-28,available,True,0,0
|
||||
2026-05-29,available,True,0,0
|
||||
2026-06-01,available,True,0,0
|
||||
2026-06-02,available,True,0,0
|
||||
2026-06-03,available,True,0,0
|
||||
2026-06-04,available,True,0,0
|
||||
2026-06-05,available,True,0,0
|
||||
2026-06-08,available,True,0,0
|
||||
2026-06-09,available,True,0,0
|
||||
2026-06-10,available,True,0,0
|
||||
2026-06-11,available,True,0,0
|
||||
2026-06-12,available,True,0,0
|
||||
2026-06-15,available,True,0,0
|
||||
2026-06-16,available,True,0,0
|
||||
2026-06-17,available,True,0,0
|
||||
2026-06-18,available,True,0,0
|
||||
2026-06-22,available,True,0,0
|
||||
2026-06-23,available,True,0,0
|
||||
2026-06-24,available,True,0,0
|
||||
2026-06-25,available,True,0,0
|
||||
2026-06-26,available,True,0,0
|
||||
2026-06-29,available,True,0,0
|
||||
2026-06-30,available,True,0,0
|
||||
2026-07-01,available,True,0,0
|
||||
2026-07-02,available,True,0,0
|
||||
2026-07-03,available,True,0,0
|
||||
2026-07-06,available,True,0,0
|
||||
2026-07-07,available,True,0,0
|
||||
2026-07-08,available,True,0,0
|
||||
2026-07-09,available,True,0,0
|
||||
2026-07-10,available,True,0,0
|
||||
2026-07-13,available,True,0,0
|
||||
2026-07-14,available,True,0,0
|
||||
2026-07-15,available,True,0,0
|
||||
2026-07-16,available,True,0,0
|
||||
2026-07-17,available,True,0,0
|
||||
2026-07-20,available,True,0,0
|
||||
2026-07-21,available,True,0,0
|
||||
2026-07-22,available,True,0,0
|
||||
2026-07-23,available,True,0,0
|
||||
2026-07-24,available,True,0,0
|
||||
2026-07-27,available,True,0,0
|
||||
2026-07-28,available,True,0,0
|
||||
2026-07-29,available,True,0,0
|
||||
2026-07-30,available,True,0,0
|
||||
2026-07-31,available,True,0,0
|
||||
2026-08-03,available,True,0,0
|
||||
2026-08-04,available,True,4900,4879
|
||||
2026-08-05,available,True,4900,4879
|
||||
2026-08-06,available,True,4900,4880
|
||||
2026-08-07,available,True,4902,4880
|
||||
2026-08-10,available,True,4902,4884
|
||||
2026-08-11,available,True,4902,4885
|
||||
2026-08-12,available,True,4900,4883
|
||||
2026-08-13,available,True,4897,4881
|
||||
2026-08-14,available,True,4900,4882
|
||||
2026-08-17,available,True,4900,4880
|
||||
2026-08-18,available,True,4899,4879
|
||||
2026-08-19,available,True,4899,4880
|
||||
2026-08-20,available,True,4898,4880
|
||||
2026-08-21,available,True,4898,4880
|
||||
2026-08-24,available,True,4898,4880
|
||||
2026-08-25,available,True,4902,4880
|
||||
2026-08-26,available,True,4902,4879
|
||||
2026-08-27,available,True,4902,4883
|
||||
2026-08-28,available,True,4902,4884
|
||||
2026-08-31,available,True,4899,4883
|
||||
2026-09-01,available,True,4898,4882
|
||||
2026-09-02,available,True,4897,4881
|
||||
2026-09-03,available,True,4900,4881
|
||||
2026-09-04,available,True,4899,4881
|
||||
2026-09-07,available,True,0,0
|
||||
2026-09-08,available,True,4897,0
|
||||
2026-09-09,available,True,4896,0
|
||||
2026-09-10,available,True,4893,0
|
||||
2026-09-11,available,True,4893,0
|
||||
2026-09-14,available,True,4892,0
|
||||
2026-09-15,available,True,4891,0
|
||||
2026-09-16,available,True,4893,0
|
||||
2026-09-17,available,True,4893,0
|
||||
2026-09-18,available,True,4895,0
|
||||
2026-09-21,available,True,4891,0
|
||||
2026-09-22,available,True,4893,0
|
||||
2026-09-23,available,True,4894,0
|
||||
2026-09-24,available,True,4895,0
|
||||
2026-09-28,available,True,4896,0
|
||||
2026-09-29,available,True,4894,0
|
||||
2026-09-30,available,True,4894,0
|
||||
2026-10-08,available,True,4888,0
|
||||
2026-10-09,available,False,4889,0
|
||||
2026-10-12,available,False,4892,0
|
||||
2026-10-13,available,False,0,0
|
||||
2026-10-14,available,False,4281,0
|
||||
2026-10-15,available,False,4283,0
|
||||
2026-10-16,available,False,0,0
|
||||
2026-10-19,available,False,4894,0
|
||||
2026-10-20,available,False,4895,0
|
||||
2026-10-21,available,False,4896,0
|
||||
2026-10-22,available,False,4896,0
|
||||
2026-10-23,available,False,0,0
|
||||
2026-04-27,strict,False,0,0
|
||||
2026-04-28,strict,False,0,0
|
||||
2026-04-29,strict,False,0,0
|
||||
2026-04-30,strict,False,0,0
|
||||
2026-05-06,strict,False,0,0
|
||||
2026-05-07,strict,False,0,0
|
||||
2026-05-08,strict,False,0,0
|
||||
2026-05-11,strict,False,0,0
|
||||
2026-05-12,strict,False,0,0
|
||||
2026-05-13,strict,False,0,0
|
||||
2026-05-14,strict,False,0,0
|
||||
2026-05-15,strict,False,0,0
|
||||
2026-05-18,strict,False,0,0
|
||||
2026-05-19,strict,False,0,0
|
||||
2026-05-20,strict,False,0,0
|
||||
2026-05-21,strict,False,0,0
|
||||
2026-05-22,strict,False,0,0
|
||||
2026-05-25,strict,False,0,0
|
||||
2026-05-26,strict,False,0,0
|
||||
2026-05-27,strict,False,0,0
|
||||
2026-05-28,strict,True,0,0
|
||||
2026-05-29,strict,True,0,0
|
||||
2026-06-01,strict,True,0,0
|
||||
2026-06-02,strict,True,0,0
|
||||
2026-06-03,strict,True,0,0
|
||||
2026-06-04,strict,True,0,0
|
||||
2026-06-05,strict,True,0,0
|
||||
2026-06-08,strict,True,0,0
|
||||
2026-06-09,strict,True,0,0
|
||||
2026-06-10,strict,True,0,0
|
||||
2026-06-11,strict,True,0,0
|
||||
2026-06-12,strict,True,0,0
|
||||
2026-06-15,strict,True,0,0
|
||||
2026-06-16,strict,True,0,0
|
||||
2026-06-17,strict,True,0,0
|
||||
2026-06-18,strict,True,0,0
|
||||
2026-06-22,strict,True,0,0
|
||||
2026-06-23,strict,True,0,0
|
||||
2026-06-24,strict,True,0,0
|
||||
2026-06-25,strict,True,0,0
|
||||
2026-06-26,strict,True,0,0
|
||||
2026-06-29,strict,True,0,0
|
||||
2026-06-30,strict,True,0,0
|
||||
2026-07-01,strict,True,0,0
|
||||
2026-07-02,strict,True,0,0
|
||||
2026-07-03,strict,True,0,0
|
||||
2026-07-06,strict,True,0,0
|
||||
2026-07-07,strict,True,0,0
|
||||
2026-07-08,strict,True,0,0
|
||||
2026-07-09,strict,True,0,0
|
||||
2026-07-10,strict,True,0,0
|
||||
2026-07-13,strict,True,0,0
|
||||
2026-07-14,strict,True,0,0
|
||||
2026-07-15,strict,True,0,0
|
||||
2026-07-16,strict,True,0,0
|
||||
2026-07-17,strict,True,0,0
|
||||
2026-07-20,strict,True,0,0
|
||||
2026-07-21,strict,True,0,0
|
||||
2026-07-22,strict,True,0,0
|
||||
2026-07-23,strict,True,0,0
|
||||
2026-07-24,strict,True,0,0
|
||||
2026-07-27,strict,True,0,0
|
||||
2026-07-28,strict,True,0,0
|
||||
2026-07-29,strict,True,0,0
|
||||
2026-07-30,strict,True,0,0
|
||||
2026-07-31,strict,True,0,0
|
||||
2026-08-03,strict,True,0,0
|
||||
2026-08-04,strict,True,4900,0
|
||||
2026-08-05,strict,True,4900,0
|
||||
2026-08-06,strict,True,4900,0
|
||||
2026-08-07,strict,True,4902,0
|
||||
2026-08-10,strict,True,4902,0
|
||||
2026-08-11,strict,True,4902,0
|
||||
2026-08-12,strict,True,4900,0
|
||||
2026-08-13,strict,True,4897,0
|
||||
2026-08-14,strict,True,4900,0
|
||||
2026-08-17,strict,True,4900,0
|
||||
2026-08-18,strict,True,4899,0
|
||||
2026-08-19,strict,True,4899,0
|
||||
2026-08-20,strict,True,4898,0
|
||||
2026-08-21,strict,True,4898,0
|
||||
2026-08-24,strict,True,4898,0
|
||||
2026-08-25,strict,True,4902,0
|
||||
2026-08-26,strict,True,4902,0
|
||||
2026-08-27,strict,True,4902,0
|
||||
2026-08-28,strict,True,4902,0
|
||||
2026-08-31,strict,True,4899,0
|
||||
2026-09-01,strict,True,4898,4882
|
||||
2026-09-02,strict,True,4897,4881
|
||||
2026-09-03,strict,True,4900,4881
|
||||
2026-09-04,strict,True,4899,4881
|
||||
2026-09-07,strict,True,0,0
|
||||
2026-09-08,strict,True,4897,0
|
||||
2026-09-09,strict,True,4896,0
|
||||
2026-09-10,strict,True,4893,0
|
||||
2026-09-11,strict,True,4893,0
|
||||
2026-09-14,strict,True,4892,0
|
||||
2026-09-15,strict,True,4891,0
|
||||
2026-09-16,strict,True,4893,0
|
||||
2026-09-17,strict,True,4893,0
|
||||
2026-09-18,strict,True,4895,0
|
||||
2026-09-21,strict,True,4891,0
|
||||
2026-09-22,strict,True,4893,0
|
||||
2026-09-23,strict,True,4894,0
|
||||
2026-09-24,strict,True,4895,0
|
||||
2026-09-28,strict,True,4896,0
|
||||
2026-09-29,strict,True,4894,0
|
||||
2026-09-30,strict,True,4894,0
|
||||
2026-10-08,strict,True,4888,0
|
||||
2026-10-09,strict,False,4889,0
|
||||
2026-10-12,strict,False,4892,0
|
||||
2026-10-13,strict,False,0,0
|
||||
2026-10-14,strict,False,4281,0
|
||||
2026-10-15,strict,False,4283,0
|
||||
2026-10-16,strict,False,0,0
|
||||
2026-10-19,strict,False,4894,0
|
||||
2026-10-20,strict,False,4895,0
|
||||
2026-10-21,strict,False,4896,0
|
||||
2026-10-22,strict,False,4896,0
|
||||
2026-10-23,strict,False,0,0
|
||||
2026-04-27,latest,False,4955,0
|
||||
2026-04-28,latest,False,4945,0
|
||||
2026-04-29,latest,False,4914,0
|
||||
2026-04-30,latest,False,4886,0
|
||||
2026-05-06,latest,False,4885,0
|
||||
2026-05-07,latest,False,4291,0
|
||||
2026-05-08,latest,False,4888,0
|
||||
2026-05-11,latest,False,4884,0
|
||||
2026-05-12,latest,False,4885,0
|
||||
2026-05-13,latest,False,4890,0
|
||||
2026-05-14,latest,False,4881,0
|
||||
2026-05-15,latest,False,4890,0
|
||||
2026-05-18,latest,False,4893,0
|
||||
2026-05-19,latest,False,4893,0
|
||||
2026-05-20,latest,False,4898,0
|
||||
2026-05-21,latest,False,4901,0
|
||||
2026-05-22,latest,False,4901,0
|
||||
2026-05-25,latest,False,4901,0
|
||||
2026-05-26,latest,False,4901,0
|
||||
2026-05-27,latest,False,4900,0
|
||||
2026-05-28,latest,True,4900,4276
|
||||
2026-05-29,latest,True,4901,4276
|
||||
2026-06-01,latest,True,4901,4275
|
||||
2026-06-02,latest,True,4904,4276
|
||||
2026-06-03,latest,True,4907,4276
|
||||
2026-06-04,latest,True,4908,4277
|
||||
2026-06-05,latest,True,4910,4872
|
||||
2026-06-08,latest,True,4909,4871
|
||||
2026-06-09,latest,True,4908,4871
|
||||
2026-06-10,latest,True,4907,4875
|
||||
2026-06-11,latest,True,4908,4875
|
||||
2026-06-12,latest,True,4907,4876
|
||||
2026-06-15,latest,True,4906,4878
|
||||
2026-06-16,latest,True,4905,4876
|
||||
2026-06-17,latest,True,4902,4880
|
||||
2026-06-18,latest,True,4903,4883
|
||||
2026-06-22,latest,True,4902,4882
|
||||
2026-06-23,latest,True,4905,4882
|
||||
2026-06-24,latest,True,4904,4882
|
||||
2026-06-25,latest,True,4905,4881
|
||||
2026-06-26,latest,True,4716,4694
|
||||
2026-06-29,latest,True,4899,4875
|
||||
2026-06-30,latest,True,4899,4877
|
||||
2026-07-01,latest,True,4901,4879
|
||||
2026-07-02,latest,True,4901,4882
|
||||
2026-07-03,latest,True,4901,4882
|
||||
2026-07-06,latest,True,4903,4883
|
||||
2026-07-07,latest,True,4902,4882
|
||||
2026-07-08,latest,True,4879,4858
|
||||
2026-07-09,latest,True,4902,4880
|
||||
2026-07-10,latest,True,4901,4881
|
||||
2026-07-13,latest,True,4904,4880
|
||||
2026-07-14,latest,True,4905,4879
|
||||
2026-07-15,latest,True,4905,4880
|
||||
2026-07-16,latest,True,4904,4878
|
||||
2026-07-17,latest,True,4905,4879
|
||||
2026-07-20,latest,True,4905,4879
|
||||
2026-07-21,latest,True,4905,4883
|
||||
2026-07-22,latest,True,4906,4883
|
||||
2026-07-23,latest,True,4905,4883
|
||||
2026-07-24,latest,True,4903,4882
|
||||
2026-07-27,latest,True,4899,4879
|
||||
2026-07-28,latest,True,4899,4879
|
||||
2026-07-29,latest,True,4899,4881
|
||||
2026-07-30,latest,True,4901,4880
|
||||
2026-07-31,latest,True,4902,4880
|
||||
2026-08-03,latest,True,4900,4879
|
||||
2026-08-04,latest,True,4900,4879
|
||||
2026-08-05,latest,True,4900,4879
|
||||
2026-08-06,latest,True,4900,4880
|
||||
2026-08-07,latest,True,4902,4880
|
||||
2026-08-10,latest,True,4902,4884
|
||||
2026-08-11,latest,True,4902,4885
|
||||
2026-08-12,latest,True,4900,4883
|
||||
2026-08-13,latest,True,4897,4881
|
||||
2026-08-14,latest,True,4900,4882
|
||||
2026-08-17,latest,True,4900,4880
|
||||
2026-08-18,latest,True,4899,4879
|
||||
2026-08-19,latest,True,4899,4880
|
||||
2026-08-20,latest,True,4898,4880
|
||||
2026-08-21,latest,True,4898,4880
|
||||
2026-08-24,latest,True,4898,4880
|
||||
2026-08-25,latest,True,4902,4880
|
||||
2026-08-26,latest,True,4902,4879
|
||||
2026-08-27,latest,True,4902,4883
|
||||
2026-08-28,latest,True,4902,4884
|
||||
2026-08-31,latest,True,4899,4883
|
||||
2026-09-01,latest,True,4898,4882
|
||||
2026-09-02,latest,True,4897,4881
|
||||
2026-09-03,latest,True,4900,4881
|
||||
2026-09-04,latest,True,4899,4881
|
||||
2026-09-07,latest,True,0,0
|
||||
2026-09-08,latest,True,4897,0
|
||||
2026-09-09,latest,True,4896,0
|
||||
2026-09-10,latest,True,4893,0
|
||||
2026-09-11,latest,True,4893,0
|
||||
2026-09-14,latest,True,4892,0
|
||||
2026-09-15,latest,True,4891,0
|
||||
2026-09-16,latest,True,4893,0
|
||||
2026-09-17,latest,True,4893,0
|
||||
2026-09-18,latest,True,4895,0
|
||||
2026-09-21,latest,True,4891,0
|
||||
2026-09-22,latest,True,4893,0
|
||||
2026-09-23,latest,True,4894,0
|
||||
2026-09-24,latest,True,4895,0
|
||||
2026-09-28,latest,True,4896,0
|
||||
2026-09-29,latest,True,4894,0
|
||||
2026-09-30,latest,True,4894,0
|
||||
2026-10-08,latest,True,4888,0
|
||||
2026-10-09,latest,False,4889,0
|
||||
2026-10-12,latest,False,4892,0
|
||||
2026-10-13,latest,False,0,0
|
||||
2026-10-14,latest,False,4281,0
|
||||
2026-10-15,latest,False,4283,0
|
||||
2026-10-16,latest,False,4895,0
|
||||
2026-10-19,latest,False,4894,0
|
||||
2026-10-20,latest,False,4895,0
|
||||
2026-10-21,latest,False,4896,0
|
||||
2026-10-22,latest,False,4896,0
|
||||
2026-10-23,latest,False,4897,0
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>系统热度与反复活跃矩阵</title><style>
|
||||
:root{font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;color:#233244;background:#f4f6f8;font-size:14px}*{box-sizing:border-box}body{margin:0}main{max-width:1540px;margin:auto;padding:24px}header{margin-bottom:18px}h1{font-size:28px;margin:0 0 8px;font-weight:650}h2{font-size:18px;margin:0}p{line-height:1.65;margin:6px 0}.muted{color:#607084}.tag{font-size:12px;color:#235a80;background:#e4eff8;border-radius:4px;padding:4px 8px;display:inline-block;margin:8px 6px 0 0}.panel{background:white;border:1px solid #e0e6ed;border-radius:12px;padding:18px;margin-bottom:16px}.filters{display:grid;grid-template-columns:repeat(6,minmax(145px,1fr));gap:12px}label{display:block;color:#607084;font-size:12px}select{margin-top:5px;width:100%;height:36px;border:1px solid #cbd4df;border-radius:6px;background:white;color:#233244;padding:0 7px;font-size:13px}select:disabled{background:#f1f3f5;color:#8d99a6}.actions{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0 4px}button{border:1px solid #bdcddd;border-radius:6px;background:#fff;color:#2c5271;padding:8px 12px;cursor:pointer;font-size:13px}button:hover{background:#eaf2f9}button.primary{background:#265f87;color:white;border-color:#265f87}.charts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.charts.wide{grid-template-columns:1fr}.chart-panel{background:white;border:1px solid #e0e6ed;border-radius:12px;padding:16px;min-width:0}.chart-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px}.chart-sub{font-size:12px;min-height:34px;color:#607084;line-height:1.5}.canvas-box{position:relative;height:800px}.legend{display:flex;align-items:center;gap:10px;font-size:12px;margin:8px auto;justify-content:center}.gradient{height:12px;width:180px;background:linear-gradient(90deg,#2166ac,#f7f7f7,#b2182b);border:1px solid #e0e6ed}.grey{display:inline-block;background:#e1e5ea;width:12px;height:12px;margin-right:4px}.notice{padding:11px 14px;border-left:3px solid #7199b9;background:#eef4f8;font-size:13px;line-height:1.6;margin:14px 0}.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.kpi{padding:14px;background:#fff;border:1px solid #e0e6ed;border-radius:10px}.kpi strong{display:block;font-size:22px;margin-top:5px}.kpi span{font-size:12px;color:#607084}table{border-collapse:collapse;width:100%;font-size:12px;white-space:nowrap}th,td{padding:8px 10px;border-bottom:1px solid #e6ebf0;text-align:right}th{background:#f3f6f9;font-weight:600;position:sticky;top:0}th:first-child,td:first-child{text-align:left}.scroll{overflow:auto;max-height:530px}#loading{padding:40px;text-align:center;color:#5a7187}footer{font-size:12px;color:#607084;margin:20px 0}a{color:#265f87}.hidden{display:none!important}@media(max-width:1050px){.filters{grid-template-columns:repeat(3,minmax(135px,1fr))}.charts{grid-template-columns:1fr}.kpis{grid-template-columns:repeat(2,1fr)}}@media(max-width:580px){main{padding:12px}h1{font-size:23px}.filters{grid-template-columns:repeat(2,minmax(120px,1fr))}.chart-panel{padding:10px}.canvas-box{min-width:480px}.chart-panel{overflow:auto}}@media print{.filters,.actions,button{display:none}.charts{display:block}.chart-panel{break-inside:avoid;margin:12px 0}body{background:#fff}}
|
||||
</style></head><body><main>
|
||||
<header><h1>系统热度与反复活跃矩阵</h1><p class="muted">固定一个条件,比较持有1至10个交易日。区分历史数据可用性,按月份与阶段查看,分清绝对收益、频次增量和指数差额。</p><span class="tag">前20个交易日,不含信号当天</span><span class="tag">全市场同一合格池</span><span class="tag">3440组参数 × 3种数据口径</span></header>
|
||||
<section class="panel"><div class="filters">
|
||||
<label>矩阵坐标<select id="view"><option value="count_hold">次数 × 持有日</option><option value="threshold_hold">热度门槛 × 持有日</option><option value="threshold_count">热度门槛 × 次数</option></select></label>
|
||||
<label>历史数据口径<select id="score"><option value="available">选股时已入库(24日)</option><option value="strict">逐日及时入库(4日)</option><option value="latest">含回填诊断(71日)</option></select></label>
|
||||
<label>筛选规则<select id="mode"><option value="frequency">仅看前20日次数</option><option value="both">次数足够且当天达标</option><option value="current">只看当天热度</option></select></label>
|
||||
<label>固定热度门槛<select id="threshold"></select></label><label>固定次数下限 K<select id="k"></select></label><label>固定持有日 H<select id="hold"></select></label>
|
||||
<label>时间区间<select id="period"><option value="full">完整区间</option><option value="compare">8月与9月并排</option><option value="2026-08">2026年8月</option><option value="2026-09">2026年9月</option><option value="2026-10">2026年10月(无完整窗口)</option></select></label>
|
||||
<label>市场阶段<select id="stage"><option value="99">全部阶段</option><option value="1">上涨</option><option value="0">震荡</option><option value="-1">下跌</option></select></label>
|
||||
<label>阶段划分依据<select id="phase_index"></select></label>
|
||||
<label>着色指标<select id="metric"><option value="return">平均每批收益</option><option value="delta_k0">增加频次要求的改善</option><option value="delta_current">相对只看当天热度</option><option value="delta_universe">相对共同全市场池</option><option value="index_excess">相对同期指数</option><option value="win30">个股胜率(30基点)</option><option value="active_days">有效信号日数</option><option value="mean_selected">日均入选(含缺数日)</option></select></label>
|
||||
<label>每边费用<select id="fee"><option value="30">30基点净收益</option><option value="60">60基点压力</option><option value="0">0基点毛收益</option></select></label>
|
||||
<label>同期收益对照指数<select id="benchmark"></select></label>
|
||||
<label>收益色标范围<select id="scale"><option value="auto">同页图统一范围</option><option value="1">固定 ±1%</option><option value="2">固定 ±2%</option><option value="5">固定 ±5%</option><option value="10">固定 ±10%</option></select></label>
|
||||
</div><div class="actions"><button class="primary" id="preset-current">先看单日热度</button><button id="preset-frequency">再看20日频次</button><button id="preset-both">叠加当天达标</button><button id="download-csv">下载当前矩阵CSV</button></div>
|
||||
<p id="rule" class="muted"></p></section>
|
||||
<div class="notice" id="basis-note"></div><div class="notice">信号日后下一交易日开盘买入,买后H个交易日开盘卖出;卖出受阻顺延。每格是已结束交易的平均批次收益,不是账户累计收益。缺失历史热度不会记为0次;未达20个有效信号日或100笔完成交易的格子标灰。</div>
|
||||
<div id="loading">正在读取本地矩阵数据…</div><section class="charts" id="charts"></section>
|
||||
<section class="panel" style="margin-top:16px"><h2 id="detail-title">点击一个格子,查看该行持有1至10日的明细</h2><p class="muted" id="detail-note"></p><div class="scroll"><table><thead><tr><th>时间区间</th><th>门槛</th><th>次数</th><th>持有日</th><th id="value-heading">当前指标</th><th>毛收益</th><th>30bp净收益</th><th>60bp净收益</th><th>有效日</th><th>完成笔数</th><th>日均入选</th><th>未退出笔数</th></tr></thead><tbody id="details"></tbody></table></div></section>
|
||||
<footer><p>统一日历窗口:2026-05-28至2026-10-08;行情与退出估值截至2026-10-23。选股时已入库口径实际仅8月4日至9月4日24日;逐日及时入库仅9月1日至4日4日;含回填诊断71日。9月7日整日缺热度,后续20个交易日均无法形成完整观察窗。没有2025年热度历史。</p><p>10月29日只读核对155模拟系统:仍读取 stock_fund_heat_scores.score,ParamStore阈值0.80;最新10月28日5208只中341只达到0.80。此核对不追加到回测。主网格没有涨跌幅过滤,避免把另一变量混进热度与频次效果。</p><p>阶段只使用信号日及以前的指数趋势,不改变股票池。收益对照指数可独立选择;同期指数按每笔股票的实际买卖日开盘计算,属于价格收益对照,不是风险中性收益或ETF成交回报。所有区间均为已见历史,少数高收益格不代表稳定最优参数。</p><p><a href="热度反复活跃与持有期矩阵研究.md">研究报告</a> · <a href="grid.csv.gz">完整压缩CSV</a> · <a href="protocol.json">冻结协议</a> · <a href="window_examples.csv">20日计数实例</a> · <a href="accounts.csv">预设现金账户结果</a></p></footer>
|
||||
</main><script>/*__CHARTJS__*/</script><script>
|
||||
const PAYLOAD=/*__PAYLOAD__*/;
|
||||
const BASIS={available:'选股时已入库',strict:'逐日及时入库',latest:'含回填诊断'},PERIOD={full:'完整区间','2026-08':'2026年8月','2026-09':'2026年9月','2026-10':'2026年10月'};
|
||||
const Q=[.5,.6,.7,.75,.8,.85,.9,.95],INDEX={csi300:'沪深300',csi500:'中证500',csi1000:'中证1000',csi2000:'中证2000'},STAGE={'99':'全部阶段','1':'上涨','0':'震荡','-1':'下跌'};
|
||||
const COL={gross:0,net30:1,net60:2,win30:3,active_days:4,completed:5,mean_selected:6,filled:7,unresolved:8,delayed:9,delta_k0:10,delta_current:11,delta_universe:12,csi300:13,csi500:14,csi1000:15,csi2000:16};
|
||||
const $=id=>document.getElementById(id),cache=new Map();let charts=[],visible=[],generation=0,selection={q:.8,k:5,h:5},ready=false;
|
||||
const percent=v=>v==null?'—':(v>=0?'+':'')+(v*100).toFixed(2)+'%';const number=v=>v==null?'—':v.toLocaleString('zh-CN',{maximumFractionDigits:1});
|
||||
for(const id of ['threshold']){Q.forEach(q=>$(id).add(new Option(q,q)));$(id).value='.8';$(id).value='0.8'}
|
||||
for(let k=0;k<=20;k++)$('k').add(new Option(k,k));$('k').value='5';for(let h=1;h<=10;h++)$('hold').add(new Option(h,h));$('hold').value='5';
|
||||
for(const id of ['phase_index','benchmark'])Object.entries(INDEX).forEach(([k,v])=>$(id).add(new Option(v,k)));$('benchmark').value='csi2000';
|
||||
function state(){return Object.fromEntries([...document.querySelectorAll('select')].map(e=>[e.id,e.value]))}
|
||||
async function chunk(s,period){const ix=s.stage==='99'?'all':s.phase_index,key=[s.score,period,ix,s.stage].join('|');if(cache.has(key))return cache.get(key);const bytes=Uint8Array.from(atob(PAYLOAD[key]),c=>c.charCodeAt(0));const stream=new Blob([bytes]).stream().pipeThrough(new DecompressionStream('gzip'));const data=JSON.parse(await new Response(stream).text());cache.set(key,data);if(cache.size>8)cache.delete(cache.keys().next().value);return data}
|
||||
function lookup(data,s,q,k,h){const off=Q.indexOf(Number(q))*43;const config=off+(s.mode==='current'?0:s.mode==='frequency'?1+Number(k):22+Number(k));return data[config*10+Number(h)-1]}
|
||||
function value(v,s){if(!v)return null;const fee=Number(s.fee)/10000,f=(1-fee)/(1+fee);if(s.metric==='return')return v[s.fee==='0'?0:s.fee==='30'?1:2];if(s.metric.startsWith('delta_'))return v[COL[s.metric]]==null?null:v[COL[s.metric]]*f/(.997/1.003);if(s.metric==='index_excess'){if(v[0]==null||v[COL[s.benchmark]]==null)return null;return v[COL[s.benchmark]]+(v[0]+1)*f-1-v[0]}return v[COL[s.metric]]}
|
||||
function isCount(s){return ['active_days','mean_selected'].includes(s.metric)}function unit(s){return isCount(s)?(s.metric==='active_days'?'日':'只'):s.metric==='return'||s.metric==='win30'?'%':'百分点'}
|
||||
function formatted(v,s){if(v==null)return '—';if(isCount(s))return number(v);if(s.metric==='win30')return (v*100).toFixed(1)+'%';return (v>=0?'+':'')+(v*100).toFixed(2)+(unit(s)==='%'?'%':'')}
|
||||
function supported(v){return v&&v[4]>=20&&v[5]>=100}
|
||||
function color(v,limit,s){if(v==null)return '#e1e5ea';let z=Math.max(-1,Math.min(1,v/limit));if(isCount(s)||s.metric==='win30')z=Math.max(0,z);const white=[247,247,247],end=z<0?[33,102,172]:[178,24,43];return 'rgb('+white.map((a,i)=>Math.round(a+(end[i]-a)*Math.abs(z))).join(',')+')'}
|
||||
function rowsFor(s){return s.view==='count_hold'?Array.from({length:21},(_,i)=>i):Q}
|
||||
function columnsFor(s){return s.view==='threshold_count'?Array.from({length:21},(_,i)=>i):Array.from({length:10},(_,i)=>i+1)}
|
||||
function pointsFor(data,s){const rows=rowsFor(s),cols=columnsFor(s),out=[];rows.forEach((r,y)=>cols.forEach((c,x)=>{const q=s.view==='count_hold'?Number(s.threshold):r,k=s.view==='count_hold'?r:s.view==='threshold_count'?c:Number(s.k),h=s.view==='threshold_count'?Number(s.hold):c,v=lookup(data,s,q,k,h);out.push({x,y,q,k:s.mode==='current'?0:k,h,v,z:value(v,s),ok:supported(v)})}));return out}
|
||||
const cells={id:'matrixCells',beforeDraw(chart){const c=chart.ctx;c.save();c.fillStyle='#fff';c.fillRect(0,0,chart.width,chart.height);c.restore()},beforeDatasetsDraw(chart){const {ctx,scales:{x,y}}=chart,opts=chart.options.plugins.matrixCells,s=opts.state;const width=Math.abs(x.getPixelForValue(1)-x.getPixelForValue(0)),height=Math.abs(y.getPixelForValue(1)-y.getPixelForValue(0));ctx.save();for(const p of chart.data.datasets[0].data){const px=x.getPixelForValue(p.x),py=y.getPixelForValue(p.y);ctx.fillStyle=p.ok?color(p.z,opts.limit,s):'#e1e5ea';ctx.fillRect(px-width/2+.7,py-height/2+.7,width-1.4,height-1.4);ctx.textAlign='center';ctx.textBaseline='middle';ctx.font=(width<40?'10':'12')+'px -apple-system, "PingFang SC", sans-serif';ctx.fillStyle=p.ok&&p.z!=null&&Math.abs(p.z)>opts.limit*.58?'#fff':'#273849';let text=p.z==null?'—':isCount(s)?Math.round(p.z).toString():(p.z*100).toFixed(2);if(!p.ok&&p.z!=null)text+='*';ctx.fillText(text,px,py,width-4)}ctx.restore()},afterDraw(chart){const c=chart.ctx;c.save();c.fillStyle='#607084';c.font='10px -apple-system, "PingFang SC", sans-serif';c.textAlign='center';c.fillText('信号截至2026-10-08;行情与退出估值截至2026-10-23;注意数据口径与缺日',chart.width/2,chart.height-5);c.restore()}};
|
||||
Chart.register(cells);
|
||||
function matrix(canvas,data,s,period,limit){const rows=rowsFor(s),cols=columnsFor(s),pts=pointsFor(data,s);return new Chart(canvas,{type:'scatter',data:{datasets:[{data:pts,pointRadius:0,pointHitRadius:23}]},options:{layout:{padding:{bottom:20}},animation:false,responsive:true,maintainAspectRatio:false,devicePixelRatio:2,interaction:{mode:'nearest',intersect:false},plugins:{title:{display:true,text:[`${PERIOD[period]} · 热度 · ${BASIS[s.score]} · ${s.mode==='current'?'仅当天':s.mode==='frequency'?'历史频次':'历史频次且当天达标'}`,`${s.view==='count_hold'?'门槛≥'+s.threshold:s.view==='threshold_count'?'持有'+s.hold+'日':s.mode==='current'?'单日筛选':'次数≥'+s.k} · ${s.stage==='99'?'全部阶段':INDEX[s.phase_index]+' '+STAGE[s.stage]} · ${$('metric').selectedOptions[0].text}(${unit(s)})`,`${s.metric==='index_excess'?INDEX[s.benchmark]+'对照 · ':''}${isCount(s)||s.metric==='win30'?'':$('fee').selectedOptions[0].text+' · '}色标上限${formatted(limit,s)};灰格样本不足`],font:{size:11},color:'#233244',padding:{bottom:12}},legend:{display:false},matrixCells:{state:s,limit},tooltip:{enabled:true,callbacks:{title:items=>{const p=items[0].raw;return `门槛 ≥ ${p.q} · ${s.mode==='current'?'仅当天':`前20日 ≥ ${p.k}次`} · 持有${p.h}日`},label:context=>{const p=context.raw;return [`${$('metric').selectedOptions[0].text}:${formatted(p.z,s)} ${unit(s)==='百分点'?'个百分点':''}`,`有效信号日:${p.v[4]};完成交易:${p.v[5]}`,`日均入选:${number(p.v[6])}只;未退出:${p.v[8]}笔`,p.ok?'达到最低展示样本要求':'样本不足,实际数值仅供观察']}}}},scales:{x:{type:'linear',min:-.5,max:cols.length-.5,afterBuildTicks:axis=>axis.ticks=cols.map((_,i)=>({value:i})),ticks:{callback:v=>cols[v],font:{size:12},maxRotation:0},grid:{display:false},title:{display:true,text:s.view==='threshold_count'?'此前20个交易日达标次数下限 K':'持有交易日 H',font:{size:13}}},y:{type:'linear',min:-.5,max:rows.length-.5,reverse:true,afterBuildTicks:axis=>axis.ticks=rows.map((_,i)=>({value:i})),ticks:{callback:v=>rows[v],font:{size:12}},grid:{display:false},title:{display:true,text:s.view==='count_hold'?'此前20日达标次数下限 K':'热度下限(含边界)',font:{size:13}}}},onClick:(event,items)=>{if(items.length){const p=pts[items[0].index];selection={q:p.q,k:p.k,h:p.h};renderDetails(s)}}}})}
|
||||
function renderDetails(s){$('value-heading').textContent=$('metric').selectedOptions[0].text+'('+unit(s)+')';$('detail-title').textContent=`该条件持有1至10日:热度 ≥ ${selection.q},${s.mode==='current'?'只看当天':`前20日 ≥ ${selection.k}次`}`;$('detail-note').textContent='点击任一矩阵格可切换此表;灰格的实际值仍保留。日均入选以统一日历窗口中的对应阶段日期为分母,包含缺数据日;不能把24日与71日口径差异全部归因于热度。';const lines=[];for(const v of visible){for(let h=1;h<=10;h++){const a=lookup(v.data,s,selection.q,selection.k,h),z=value(a,s);lines.push(`<tr><td>${PERIOD[v.period]}</td><td>${selection.q}</td><td>${s.mode==='current'?'—':selection.k}</td><td>${h}</td><td>${formatted(z,s)}${supported(a)?'':' *'}</td><td>${percent(a[0])}</td><td>${percent(a[1])}</td><td>${percent(a[2])}</td><td>${a[4]}</td><td>${number(a[5])}</td><td>${number(a[6])}</td><td>${a[8]}</td></tr>`)}}$('details').innerHTML=lines.join('')}
|
||||
async function render(){const turn=++generation;ready=false;let s=state();$('basis-note').textContent=s.score==='available'?'当前口径:在选股次日09:25前已经入库的当天与前20日记录,允许使用此前已入库的回填历史。共24个可用选股日,不代表24日历史全部原生及时记录。':s.score==='strict'?'严格口径:历史20日每一天都要求及时入库,仅剩4个选股日。所有格子均未达到20日最低展示要求,实际数值仅作观察。':'含回填诊断:忽略入库时间的最新批次回放,共71个选股日;包含当时无法取得的数据,不代表历史可执行收益。';if(s.mode==='current'&&s.view!=='threshold_hold'){$('view').value='threshold_hold';s=state()}$('threshold').disabled=s.view!=='count_hold';$('k').disabled=s.view!=='threshold_hold'||s.mode==='current';$('hold').disabled=s.view!=='threshold_count';$('phase_index').disabled=s.stage==='99';$('benchmark').disabled=s.metric!=='index_excess';$('fee').disabled=isCount(s)||s.metric==='win30';$('scale').disabled=isCount(s)||s.metric==='win30';const periods=s.period==='compare'?['2026-08','2026-09']:[s.period];$('loading').classList.remove('hidden');try{const chunks=await Promise.all(periods.map(p=>chunk(s,p)));if(turn!==generation)return;visible=periods.map((period,i)=>({period,data:chunks[i]}));const all=visible.flatMap(v=>pointsFor(v.data,s)).filter(p=>p.ok&&p.z!=null).map(p=>Math.abs(p.z));let limit=s.scale==='auto'?Math.max(isCount(s)?1:.001,...all):Number(s.scale)/100;if(isCount(s)||s.metric==='win30')limit=Math.max(s.metric==='win30'?1:1,...all);else if(s.scale==='auto')limit=Math.ceil(limit*1000)/1000;charts.forEach(c=>c.destroy());charts=[];$('charts').innerHTML='';$('charts').classList.toggle('wide',s.view==='threshold_count'||periods.length===1);
|
||||
for(const [i,v] of visible.entries()){const panel=document.createElement('article');panel.className='chart-panel';const phase=s.stage==='99'?'全部阶段':INDEX[s.phase_index]+'划分 · '+STAGE[s.stage],metric=$('metric').selectedOptions[0].text+(s.metric==='index_excess'?' '+INDEX[s.benchmark]:'');panel.innerHTML=`<div class="chart-head"><h2>${PERIOD[v.period]}</h2><button data-download="${i}">下载PNG</button></div><div class="chart-sub">${phase} · ${metric} · ${isCount(s)||s.metric==='win30'?'':$('fee').selectedOptions[0].text}</div><div class="canvas-box" style="height:${s.view==='count_hold'?820:370}px"><canvas aria-label="${v.period}年参数热力图,明细在下方表格" role="img"></canvas></div><div class="legend"><span>${formatted(isCount(s)||s.metric==='win30'?0:-limit,s)}</span><div class="gradient" style="background:${isCount(s)||s.metric==='win30'?'linear-gradient(90deg,#f7f7f7,#b2182b)':'linear-gradient(90deg,#2166ac,#f7f7f7,#b2182b)'}"></div><span>${formatted(limit,s)} ${unit(s)==='百分点'?'个百分点':''}</span></div><p class="muted" style="font-size:12px"><span class="grey"></span>灰色为样本不足或无样本;*保留实际值。同页图使用相同色标${s.scale==='auto'?',切换条件后重算':',超出范围按端点色显示'}。</p>`;$('charts').appendChild(panel);charts.push(matrix(panel.querySelector('canvas'),v.data,s,v.period,limit));panel.querySelector('button').onclick=()=>download(charts[i].toBase64Image(),'矩阵_'+s.score+'_'+v.period+'.png')}
|
||||
$('rule').textContent=(s.mode==='current'?'只检验当天一个热度门槛。':s.mode==='frequency'?'只检验此前20日达标频次,当天不额外要求达标。':'此前20日达标次数满足要求,同时要求当天热度达标。')+' K=0为同一可观察样本的对照;不含当天,不要求连续。';if(!Q.includes(selection.q))selection.q=.8;if(s.view==='count_hold')selection.q=Number(s.threshold);if(s.view==='threshold_hold'&&s.mode!=='current')selection.k=Number(s.k);renderDetails(s);$('loading').classList.add('hidden');ready=true;window.__dashboardReady=true;window.__dashboardState=s}catch(error){$('loading').textContent='数据读取失败:'+error.message;console.error(error)}}
|
||||
function download(url,name){const a=document.createElement('a');a.href=url;a.download=name;a.click()}
|
||||
for(const e of document.querySelectorAll('select'))e.addEventListener('change',render);
|
||||
$('preset-current').onclick=()=>{$('mode').value='current';$('view').value='threshold_hold';render()};$('preset-frequency').onclick=()=>{$('mode').value='frequency';$('view').value='count_hold';render()};$('preset-both').onclick=()=>{$('mode').value='both';$('view').value='count_hold';render()};
|
||||
$('download-csv').onclick=()=>{const s=state(),rows=[['时间区间','数据口径','门槛','规则','前20日次数下限','持有日','阶段指数','阶段','收益对照指数','费用每边基点','指标','指标值原比例','有效日','完成笔数','日均入选','样本足够']];for(const v of visible)for(const p of pointsFor(v.data,s))rows.push([v.period,s.score,p.q,s.mode,p.k,p.h,s.stage==='99'?'all':s.phase_index,s.stage,s.benchmark,s.fee,s.metric,p.z??'',p.v[4],p.v[5],p.v[6],p.ok]);const blob=new Blob(['\ufeff'+rows.map(r=>r.join(',')).join('\n')],{type:'text/csv;charset=utf-8'}),u=URL.createObjectURL(blob);download(u,'当前矩阵.csv');setTimeout(()=>URL.revokeObjectURL(u),1000)};
|
||||
window.getDisplayedCell=(period,q,k,h)=>{const s=state(),v=visible.find(v=>v.period===period);return v?lookup(v.data,s,q,k,h):null};render();
|
||||
</script></body></html>
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"chunks": 156,
|
||||
"rows_per_chunk": 3440,
|
||||
"columns": [
|
||||
"mean_gross",
|
||||
"mean_net30",
|
||||
"mean_net60",
|
||||
"win30",
|
||||
"active_days",
|
||||
"completed",
|
||||
"mean_selected",
|
||||
"filled",
|
||||
"unresolved",
|
||||
"delayed",
|
||||
"delta_k0_net30",
|
||||
"delta_current_net30",
|
||||
"delta_universe_net30",
|
||||
"excess_csi300",
|
||||
"excess_csi500",
|
||||
"excess_csi1000",
|
||||
"excess_csi2000"
|
||||
],
|
||||
"html_bytes": 9769444,
|
||||
"html_sha256": "927cbc33258d72d427af0d6959712109c5ace710c1e04c43c61afa69e81dd7d6",
|
||||
"chartjs_version": "4.5.1",
|
||||
"chartjs_sha384": "jb8JQMbMoBUzgWatfe6COACi2ljcDdZQ2OxczGA3bGNeWe+6DChMTBJemed7ZnvJ",
|
||||
"external_runtime_requests": 0,
|
||||
"data_source": "grid.csv.gz",
|
||||
"data_source_sha256": "75eec5840cf59a9ef4f6eea6ce7fdb6e3da5856b200f4a22e30b843f6036e361",
|
||||
"default": "热度>=0.8,历史频次,当时可查口径,全区间,30基点,全部阶段"
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
"""固定0.80、K5的样本、费用与时间窗比较;不进行择优账户回测。"""
|
||||
import sys
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
from common import *
|
||||
from engine import future_exits
|
||||
|
||||
def main():
|
||||
sys.addaudithook(offline);p,panel,f,cov=load();dates=panel['dates'];cfg=configuration();g=pd.read_csv(ROOT/'grid.csv.gz');rows=[]
|
||||
for h in p['holds']:
|
||||
ex,gr=future_exits(panel,h)
|
||||
for label,mask in [('仅当天完整样本',panel['eligible']&np.isfinite(panel['asof'])&(panel['asof']>=.8)&(dates<='2026-10-08')[:,None])]+[(c['mode'],mask_for(panel,f,c)) for c in cfg if c['score']=='available' and c['threshold']==.8 and (c['mode']=='current' or c['k']==5)]:
|
||||
m=mask&np.isfinite(gr);net=gr*.997/1.003-1;daily=divide(np.where(m,net,0).sum(1),m.sum(1));rows.append({'condition':label,'hold':h,'active_days':int(np.isfinite(daily).sum()),'completed':int(m.sum()),'mean_net30':float(mean(daily)),'mean_net60':float((mean(daily)+1)*(.994/1.006)/(.997/1.003)-1)})
|
||||
pd.DataFrame(rows).to_csv(ROOT/'current_window_comparison.csv',index=False)
|
||||
ex,gr=future_exits(panel,5);con=[];interval=[];rng=np.random.default_rng(20261029)
|
||||
for c in [c for c in cfg if c['threshold']==.8 and (c['mode']=='current' or c['k']==5)]:
|
||||
mask=mask_for(panel,f,c)&np.isfinite(gr);by_stock=mask.sum(0);active=mask.any(1);count=int(mask.sum());selected=mask_for(panel,f,c).sum(1)
|
||||
con.append({'basis':c['score'],'mode':c['mode'],'active_days':int(active.sum()),'completed':count,'unique_stocks':int((by_stock>0).sum()),'median_completed_per_active_day':float(np.median(mask.sum(1)[active])),'max_stock_fraction':float(by_stock.max()/count),'top5_stock_fraction':float(np.sort(by_stock)[-5:].sum()/count),'mean_selected_per_usable_day':float(selected[f['base_'+c['score']].any(1)].mean())})
|
||||
if c['score']=='available':
|
||||
dd=np.load(ROOT/'cache/daily_05.npz');v=(dd['gross'][:,c['config']]+1)*.997/1.003-1;control=c['config']//43*43+(1 if c['mode']=='frequency' else 0);diff=(dd['gross'][:,c['config']]-dd['gross'][:,control])*.997/1.003
|
||||
window=f['base_available'].any(1);vv=np.column_stack([v[window],diff[window]]);n=len(vv)
|
||||
for block in [5,10]:
|
||||
samples=[]
|
||||
for _ in range(2000):
|
||||
starts=rng.integers(0,n,size=(n+block-1)//block);ix=np.concatenate([(x+np.arange(block))%n for x in starts])[:n];samples.append(mean(vv[ix],axis=0))
|
||||
aa=np.array(samples);interval.append({'mode':c['mode'],'hold':5,'block_sessions':block,'observations':n,'mean_net30_95pct':[float(x) for x in np.nanquantile(aa[:,0],[.025,.975])],'increment_vs_control_95pct':[float(x) for x in np.nanquantile(aa[:,1],[.025,.975])],'note':'24日短样本循环分块自助法,描述不确定性,不据此认定显著或独立样本外'})
|
||||
pd.DataFrame(con).to_csv(ROOT/'concentration.csv',index=False);dump(ROOT/'uncertainty.json',interval)
|
||||
summary={}
|
||||
for basis in p['scores']:
|
||||
z=g[(g.score==basis)&(g.period=='full')&(g.phase_index=='all')];summary[basis]={'combinations':len(z),'supported':int(z.supported.sum()),'positive30_supported':int((z.supported&(z.mean_net30>0)).sum()),'positive60_supported':int((z.supported&(z.mean_net60>0)).sum()),'available_net_min':float(z[z.supported].mean_net30.min()) if z.supported.any() else None,'available_net_max':float(z[z.supported].mean_net30.max()) if z.supported.any() else None}
|
||||
dump(ROOT/'result_summary.json',summary);print(summary)
|
||||
if __name__=='__main__':main()
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
"""上一轮已复核的纯账户引擎副本,冻结复用,不导入线上代码。"""
|
||||
import numpy as np
|
||||
|
||||
def future_exits(panel,hold):
|
||||
t,n=panel['open'].shape
|
||||
nxt=np.full((t+1,n),-1,dtype=np.int16)
|
||||
for i in range(t-1,-1,-1):nxt[i]=np.where(panel['can_sell'][i],i,nxt[i+1])
|
||||
exits=np.full((t,n),-1,dtype=np.int16)
|
||||
gross=np.full((t,n),np.nan)
|
||||
for s in range(t-hold-1):
|
||||
e=nxt[s+hold+1];j=np.arange(n)
|
||||
exits[s]=e
|
||||
ok=(e>=0)&panel['can_buy'][s+1]
|
||||
gross[s,ok]=panel['open'][e[ok],j[ok]]/panel['open'][s+1,ok]
|
||||
return exits,gross
|
||||
|
||||
def daily_means(mask,values):
|
||||
valid=mask&np.isfinite(values)
|
||||
n=valid.sum(axis=1)
|
||||
total=np.where(valid,values,0).sum(axis=1)
|
||||
return np.divide(total,n,out=np.full(len(n),np.nan),where=n>0)
|
||||
|
||||
def mean(v):
|
||||
v=np.asarray(v);v=v[np.isfinite(v)]
|
||||
return float(v.mean()) if len(v) else None
|
||||
|
||||
def account(panel,mask,hold,cost,stop=None,detail=False):
|
||||
"""每批次独立到期;卖出失败保留原任务。预算采用前收资产,禁止重复使用现金。"""
|
||||
t,n=mask.shape;stop=t if stop is None else stop
|
||||
holds=np.broadcast_to(np.asarray(hold,dtype=int),(t,))
|
||||
assert np.all((holds>=1)&(holds<=10))
|
||||
cash=1.;prev=1.;lots=[];records=[];journal=[];fees=0.;skipped=0;delays=0
|
||||
max_weight=0.;max_positions=0;max_stale_value=0.;buy_count=sell_count=0
|
||||
for i in range(stop):
|
||||
fee_today=0.;turnover=0.;sell_cash=0.;buy_cash=0.
|
||||
survivors=[]
|
||||
for lot in lots:
|
||||
ix,q,due,sig=lot
|
||||
if i>=due:
|
||||
sell=panel['can_sell'][i,ix]
|
||||
if i==due:delays+=int((~sell).sum())
|
||||
if sell.any():
|
||||
v=q[sell]*panel['open'][i,ix[sell]];fee=float(v.sum()*cost)
|
||||
cash+=float(v.sum())-fee;fee_today+=fee;turnover+=float(v.sum());sell_cash+=float(v.sum())-fee
|
||||
sell_count+=int(sell.sum())
|
||||
if detail:
|
||||
journal.extend({'day':i,'side':'sell','stock':int(j),'qty':float(qty),'price':float(price),'signal':sig}
|
||||
for j,qty,price in zip(ix[sell],q[sell],panel['open'][i,ix[sell]]))
|
||||
ix,q=ix[~sell],q[~sell]
|
||||
if len(ix):survivors.append((ix,q,due,sig))
|
||||
lots=survivors
|
||||
if i>0:
|
||||
chosen=np.flatnonzero(mask[i-1]);count=len(chosen)
|
||||
if count:
|
||||
available=panel['can_buy'][i,chosen];skipped+=int((~available).sum());ix=chosen[available]
|
||||
h=int(holds[i-1]);budget=min(max(cash,0),prev/h)
|
||||
if len(ix) and budget>0:
|
||||
each=budget/count/(1+cost);q=each/panel['open'][i,ix]
|
||||
value=each*len(ix);fee=value*cost
|
||||
cash-=value+fee;fee_today+=fee;turnover+=value;buy_cash=value+fee
|
||||
lots.append((ix,q,i+h,i-1));buy_count+=len(ix)
|
||||
if detail:
|
||||
journal.extend({'day':i,'side':'buy','stock':int(j),'qty':float(qty),'price':float(price),'signal':i-1}
|
||||
for j,qty,price in zip(ix,q,panel['open'][i,ix]))
|
||||
values=np.zeros(n)
|
||||
for ix,q,_,_ in lots:np.add.at(values,ix,q*panel['mark'][i,ix])
|
||||
value=float(values.sum());nav=cash+value;assert cash>=-1e-12 and nav>=0
|
||||
max_weight=max(max_weight,float(values.max()/nav) if nav else 0)
|
||||
max_positions=max(max_positions,int(np.count_nonzero(values)))
|
||||
max_stale_value=max(max_stale_value,float(values[~np.isfinite(panel['close'][i])].sum()))
|
||||
fees+=fee_today
|
||||
records.append({'date':str(panel['dates'][i]),'cash':cash,'stock_value':value,'nav':nav,'fee':fee_today,
|
||||
'turnover':turnover,'sell_cash':sell_cash,'buy_cash':buy_cash,'positions':int(np.count_nonzero(values))})
|
||||
prev=nav
|
||||
nav=np.array([1.]+[r['nav'] for r in records]);draw=nav/np.maximum.accumulate(nav)-1
|
||||
summary={'return':float(nav[-1]-1),'max_drawdown':float(draw.min()),'fees_initial_capital':fees,
|
||||
'buy_count':buy_count,'sell_count':sell_count,'skipped_buy':skipped,'delayed_lots':delays,
|
||||
'ending_cash':cash,'ending_stock_value':records[-1]['stock_value'],'open_lots':sum(len(x[0]) for x in lots),
|
||||
'max_stock_weight':max_weight,'max_positions':max_positions,'max_stale_valuation':max_stale_value,
|
||||
'mean_exposure':float(np.mean([r['stock_value']/r['nav'] for r in records if r['buy_cash'] or r['stock_value']])) if buy_count else 0}
|
||||
return {'summary':summary,'daily':records,'journal':journal}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 459 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 391 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 80 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 262 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 283 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 220 KiB |
|
|
@ -0,0 +1,36 @@
|
|||
"""核验分组加总、报告引用与交付摘要,不改研究计算口径。"""
|
||||
import datetime as dt,sys,re,ast
|
||||
from pathlib import Path
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
import matplotlib
|
||||
from common import *
|
||||
def main():
|
||||
sys.addaudithook(offline);p,panel,f,cov=load();g=pd.read_csv(ROOT/'grid.csv.gz');keys=['config','hold','period']
|
||||
whole=g[g.phase_index=='all'].set_index(keys).sort_index();partition=[]
|
||||
for index in ['csi300','csi500','csi1000','csi2000']:
|
||||
z=g[g.phase_index==index].copy();z['weighted_gross']=z.mean_gross.fillna(0)*z.active_days
|
||||
aggregate=z.groupby(keys)[['phase_days','active_days','selected','filled','completed','unresolved','delayed','weighted_gross']].sum().sort_index()
|
||||
for field in ['phase_days','active_days','selected','filled','completed','unresolved','delayed']:assert np.array_equal(aggregate[field],whole[field])
|
||||
weighted=divide(aggregate.weighted_gross.to_numpy(),aggregate.active_days.to_numpy());assert np.allclose(weighted,whole.mean_gross.to_numpy(),atol=1e-12,equal_nan=True)
|
||||
partition.append(index)
|
||||
assert len(g)==536640
|
||||
assert np.all(g.mean_net60.dropna()<=g.mean_net30.dropna()+1e-14)
|
||||
assert np.all(g.mean_net30.dropna()<=g.mean_gross.dropna()+1e-14)
|
||||
assert not g[g.completed==0].mean_gross.notna().any()
|
||||
for name,sha in cov['source_sha256'].items():assert digest(ROOT.parent/name)==sha
|
||||
assert digest(ROOT/'cache/features.npz')==cov['features_sha256']
|
||||
dashboard=read(ROOT/'dashboard_manifest.json');assert digest(ROOT/'热度反复活跃矩阵浏览器.html')==dashboard['html_sha256'];assert digest(ROOT/'grid.csv.gz')==dashboard['data_source_sha256']
|
||||
links=0
|
||||
docs=[ROOT/'热度反复活跃与持有期矩阵研究.md',ROOT.parents[1]/'docs/热度反复活跃矩阵研究接续_2026-10-29.md',ROOT.parents[1]/'docs/开发入口.md',ROOT/'vendor/README.md']
|
||||
for path in docs:
|
||||
for dest in re.findall(r'!?\[[^\]]*\]\(([^)]+)\)',path.read_text()):
|
||||
if '://' not in dest and not dest.startswith('#'):
|
||||
target=(path.parent/dest.split('#')[0]).resolve()
|
||||
assert target==(ROOT/'manifest.json').resolve() or target.exists(),(path,dest);links+=1
|
||||
for path in ROOT.glob('*.py'):ast.parse(path.read_text())
|
||||
browser=read(ROOT/'browser_checks.json');assert not browser['external_requests'] and not browser['page_errors']
|
||||
files=[path for path in ROOT.rglob('*') if path.is_file() and not any(x in path.parts for x in ['cache','__pycache__']) and path.name!='manifest.json']
|
||||
result={'created_at_beijing':dt.datetime.now(dt.timezone(dt.timedelta(hours=8))).isoformat(),'protocol_sha256':digest(ROOT/'protocol.json'),'files_sha256':{str(path.relative_to(ROOT)):digest(path) for path in sorted(files)},'runtime':{'python':sys.version.split()[0],'numpy':np.__version__,'pandas':pd.__version__,'matplotlib':matplotlib.__version__},'grid_rows':len(g),'parameter_combinations':10320,'accounts':72,'phase_partitions_checked':partition,'cash_and_event_audit':'audit.json和calculation_checks.json','local_links_checked':links,'figures_checked':6,'browser_checks':len(browser['checks']),'new_database_access':'仅155只读核对最新热度与参数,收益计算未追加数据','live_strategy_changes':False}
|
||||
dump(ROOT/'manifest.json',result);print({'files':len(files),'local_links':links,'phase_partitions':partition,'grid_rows':len(g),'figures':6,'browser_checks':len(browser['checks'])})
|
||||
if __name__=='__main__':main()
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
|
@ -0,0 +1,481 @@
|
|||
date,index,open,close,ma60,return20,stage
|
||||
2026-04-27,csi300,4776.3351,4770.9469,4649.0210566666665,0.05960531694589166,1
|
||||
2026-04-28,csi300,4757.0766,4758.2083,4649.949585,0.05927454668907717,1
|
||||
2026-04-29,csi300,4737.5755,4810.3468,4651.672631666666,0.08096483335589122,1
|
||||
2026-04-30,csi300,4820.9716,4807.3069,4653.366216666666,0.06213785885793821,1
|
||||
2026-05-06,csi300,4857.6537,4877.0932,4656.017913333333,0.08890081191778165,1
|
||||
2026-05-07,csi300,4895.8001,4900.5098,4658.461914999999,0.10352234937355398,1
|
||||
2026-05-08,csi300,4871.1185,4871.9122,4661.22145,0.09712525932774807,1
|
||||
2026-05-11,csi300,4902.2775,4951.8366,4666.985728333334,0.07752720236680832,1
|
||||
2026-05-12,csi300,4965.0175,4948.0465,4671.784713333333,0.08361894315427443,1
|
||||
2026-05-13,csi300,4919.4248,4998.3417,4676.779021666666,0.07802676356022586,1
|
||||
2026-05-14,csi300,5027.6405,4914.5971,4680.84866,0.05777734989705263,1
|
||||
2026-05-15,csi300,4911.6223,4859.5927,4684.448606666668,0.03367356877441807,1
|
||||
2026-05-18,csi300,4836.3286,4833.5237,4686.356403333333,0.031647705870922804,1
|
||||
2026-05-19,csi300,4818.7051,4852.8832,4688.49953,0.02454826478452099,1
|
||||
2026-05-20,csi300,4829.6129,4850.7,4690.780888333333,0.025806063588767802,1
|
||||
2026-05-21,csi300,4886.2389,4783.0976,4691.839548333333,0.005392751091715997,1
|
||||
2026-05-22,csi300,4818.8435,4845.0956,4694.9177150000005,0.01617001856335043,1
|
||||
2026-05-25,csi300,4873.1962,4921.5974,4698.485271666666,0.025412474761059345,1
|
||||
2026-05-26,csi300,4900.1152,4947.8493,4702.0179966666665,0.0337465429913244,1
|
||||
2026-05-27,csi300,4940.9454,4908.1714,4705.039621666667,0.029102928672657846,1
|
||||
2026-05-28,csi300,4889.2659,4914.2133,4708.432395,0.030028923608435232,1
|
||||
2026-05-29,csi300,4937.5119,4892.1213,4711.156603333333,0.028143576648378188,1
|
||||
2026-06-01,csi300,4897.8968,4844.2556,4714.295926666668,0.007049138328238724,1
|
||||
2026-06-02,csi300,4860.6119,4914.5591,4719.494833333332,0.02231024609641641,1
|
||||
2026-06-03,csi300,4921.3445,4938.8091,4724.3467833333325,0.012654238389375072,1
|
||||
2026-06-04,csi300,4897.3164,4904.7454,4728.4185566666665,0.000864318238890105,1
|
||||
2026-06-05,csi300,4886.9645,4816.9199,4731.776303333333,-0.011287621316328322,0
|
||||
2026-06-08,csi300,4703.773,4713.6358,4732.424296666667,-0.04810352587159272,-1
|
||||
2026-06-09,csi300,4743.4505,4801.8106,4734.046208333334,-0.029554269548598744,0
|
||||
2026-06-10,csi300,4753.1154,4748.5932,4735.063426666667,-0.04996627181370972,0
|
||||
2026-06-11,csi300,4730.072,4722.4122,4735.951296666667,-0.03910491462260457,-1
|
||||
2026-06-12,csi300,4784.6396,4777.3206,4737.713988333333,-0.016929834469460836,0
|
||||
2026-06-15,csi300,4829.2886,4891.7126,4741.951878333333,0.012038608603491596,1
|
||||
2026-06-16,csi300,4894.8785,4884.2322,4745.716875,0.006459871113320803,1
|
||||
2026-06-17,csi300,4859.7012,4931.3861,4751.519125000001,0.016633908508050466,1
|
||||
2026-06-18,csi300,4916.0442,4941.5986,4757.762136666667,0.033137730662238685,1
|
||||
2026-06-22,csi300,4949.3457,5059.6582,4768.456488333334,0.04428449254953826,1
|
||||
2026-06-23,csi300,5048.0255,4919.386,4775.867548333334,-0.0004493256599980011,0
|
||||
2026-06-24,csi300,4900.3838,4943.0197,4782.626783333332,-0.0009761008687148021,0
|
||||
2026-06-25,csi300,4950.9753,5020.1038,4791.669608333334,0.022805316049068658,1
|
||||
2026-06-26,csi300,4981.8251,4868.2205,4797.763786666666,-0.009359137911250204,0
|
||||
2026-06-29,csi300,4866.0432,4926.921,4805.013303333332,0.00711341724090131,1
|
||||
2026-06-30,csi300,4914.4934,4979.4328,4813.836361666667,0.02790463822759448,1
|
||||
2026-07-01,csi300,4972.6923,4958.9773,4821.051536666667,0.009038084413309555,1
|
||||
2026-07-02,csi300,4865.1713,4812.2957,4826.607896666666,-0.025616175365028915,-1
|
||||
2026-07-03,csi300,4809.4988,4842.1737,4833.297643333334,-0.012757379822406212,0
|
||||
2026-07-06,csi300,4868.5422,4841.998,4839.987340000001,0.005206252235998354,1
|
||||
2026-07-07,csi300,4813.8707,4792.2624,4843.26578,0.016680669304149465,0
|
||||
2026-07-08,csi300,4804.4837,4755.5338,4846.420948333334,-0.009637364705721518,-1
|
||||
2026-07-09,csi300,4774.4021,4876.3125,4850.416731666667,0.026896239500995733,1
|
||||
2026-07-10,csi300,4887.5355,4780.7867,4852.6606,0.012361161526729836,0
|
||||
2026-07-13,csi300,4745.4383,4695.383,4852.562255,-0.01715137141936851,-1
|
||||
2026-07-14,csi300,4691.1224,4796.502,4854.416515,-0.019463653690529492,-1
|
||||
2026-07-15,csi300,4797.943,4786.7828,4855.252766666667,-0.019951836032693238,-1
|
||||
2026-07-16,csi300,4711.532,4698.4344,4854.748813333334,-0.04723858470542386,-1
|
||||
2026-07-17,csi300,4661.6218,4529.0953,4850.943036666666,-0.08347567930750188,-1
|
||||
2026-07-20,csi300,4575.6712,4598.3208,4848.1151,-0.09117955833459257,-1
|
||||
2026-07-21,csi300,4630.8532,4739.2287,4847.108461666667,-0.0366219076933586,-1
|
||||
2026-07-22,csi300,4710.6602,4717.2442,4845.9570766666675,-0.0456756221303346,-1
|
||||
2026-07-23,csi300,4735.1706,4728.0018,4845.267626666667,-0.05818644626431824,-1
|
||||
2026-07-24,csi300,4685.4082,4649.1917,4843.238373333333,-0.04499155286824008,-1
|
||||
2026-07-27,csi300,4656.0272,4702.4272,4842.308688333333,-0.04556472490628527,-1
|
||||
2026-07-28,csi300,4623.7986,4569.5235,4838.294966666666,-0.08232048035671846,-1
|
||||
2026-07-29,csi300,4582.0949,4600.2624,4834.844225,-0.07233646744057487,-1
|
||||
2026-07-30,csi300,4566.0467,4549.7201,4829.388006666666,-0.054563479962380534,-1
|
||||
2026-07-31,csi300,4623.8536,4588.1968,4824.182790000001,-0.052451009760348,-1
|
||||
2026-08-03,csi300,4561.817,4543.1781,4818.7038883333325,-0.061714172537865486,-1
|
||||
2026-08-04,csi300,4566.9425,4600.9304,4812.855451666666,-0.03992519274403661,-1
|
||||
2026-08-05,csi300,4550.1888,4658.1549,4808.023925,-0.0204769651726584,-1
|
||||
2026-08-06,csi300,4621.803,4651.3098,4802.24006,-0.04614197715999535,-1
|
||||
2026-08-07,csi300,4656.0976,4694.4365,4798.570716666667,-0.018061922737527714,-1
|
||||
2026-08-10,csi300,4698.8162,4702.0247,4795.944583333333,0.0014145171969996984,0
|
||||
2026-08-11,csi300,4689.4493,4663.7887,4793.115666666667,-0.02766876778118732,-1
|
||||
2026-08-12,csi300,4660.4658,4690.9165,4790.4162216666655,-0.020027292652593287,-1
|
||||
2026-08-13,csi300,4716.9748,4663.9513,4787.303743333334,-0.0073392745464320175,-1
|
||||
2026-08-14,csi300,4672.9752,4665.8812,4785.350136666666,0.030201594565696155,0
|
||||
2026-08-17,csi300,4672.2756,4741.0981,4783.616845,0.03104987803373782,0
|
||||
2026-08-18,csi300,4734.0733,4725.8134,4780.353778333333,-0.002830692682123548,-1
|
||||
2026-08-19,csi300,4660.055,4588.6955,4774.367881666667,-0.027250804611726576,-1
|
||||
2026-08-20,csi300,4613.2975,4592.7504,4769.110865,-0.02860646119043353,-1
|
||||
2026-08-21,csi300,4585.4354,4618.8952,4764.1888966666675,-0.006516509095548906,-1
|
||||
2026-08-24,csi300,4620.9489,4563.1266,4758.705651666667,-0.029623127392594317,-1
|
||||
2026-08-25,csi300,4542.2438,4552.0326,4753.835268333333,-0.0038277295214699247,-1
|
||||
2026-08-26,csi300,4549.4321,4590.7935,4748.439175,-0.0020583391069169954,-1
|
||||
2026-08-27,csi300,4594.4794,4630.277,4743.296973333333,0.017705902391665918,0
|
||||
2026-08-28,csi300,4615.8393,4609.1764,4738.370823333333,0.004572515285307777,0
|
||||
2026-08-31,csi300,4561.9861,4625.0862,4735.173595,0.01802881115314392,0
|
||||
2026-09-01,csi300,4618.7337,4611.4394,4733.470321666667,0.0022841032326852417,0
|
||||
2026-09-02,csi300,4581.514,4547.9559,4729.23941,-0.023657221016845198,-1
|
||||
2026-09-03,csi300,4570.9115,4552.5784,4725.972496666667,-0.021226580091482927,-1
|
||||
2026-09-04,csi300,4575.3163,4548.0499,4723.066458333333,-0.03118299714992412,-1
|
||||
2026-09-07,csi300,4567.8945,4575.0245,4719.694856666667,-0.027009683721993083,-1
|
||||
2026-09-08,csi300,4575.9905,4558.7371,4714.145264999999,-0.022524948439452186,-1
|
||||
2026-09-09,csi300,4578.5125,4572.5995,4708.951386666667,-0.02522257644108561,-1
|
||||
2026-09-10,csi300,4550.1865,4548.3898,4702.568115,-0.024777595769492677,-1
|
||||
2026-09-11,csi300,4514.2954,4510.1554,4695.3773949999995,-0.03337543184768621,-1
|
||||
2026-09-14,csi300,4474.9474,4480.0821,4685.717793333332,-0.05505391251026859,-1
|
||||
2026-09-15,csi300,4473.805,4450.0402,4677.895363333333,-0.05835465276728857,-1
|
||||
2026-09-16,csi300,4449.8833,4480.2683,4670.18284,-0.023629199191796513,-1
|
||||
2026-09-17,csi300,4463.6206,4460.1557,4660.850371666666,-0.02887043458751859,-1
|
||||
2026-09-18,csi300,4492.3233,4507.3926,4654.836573333333,-0.02414053473220168,-1
|
||||
2026-09-21,csi300,4524.343,4539.5654,4648.380646666667,-0.005163389505782989,-1
|
||||
2026-09-22,csi300,4569.8738,4544.5875,4641.133225,-0.0016355550704975075,-1
|
||||
2026-09-23,csi300,4547.6106,4517.2785,4633.771578333332,-0.01601357151002314,-1
|
||||
2026-09-24,csi300,4499.8574,4439.1443,4627.5523883333335,-0.04127889109010108,-1
|
||||
2026-09-28,csi300,4423.8156,4340.755,4619.195409999999,-0.05823630442957228,-1
|
||||
2026-09-29,csi300,4335.8085,4345.2088,4610.9155900000005,-0.06051290460272918,-1
|
||||
2026-09-30,csi300,4356.7955,4357.6155,4603.671475,-0.05504222824656446,-1
|
||||
2026-10-08,csi300,4354.9293,4310.2765,4596.25052,-0.052260709036338726,-1
|
||||
2026-10-09,csi300,4297.2513,4317.2549,4586.932893333333,-0.05169015870215443,-1
|
||||
2026-10-12,csi300,4305.9149,4287.9798,4578.719445,-0.05718277189526877,-1
|
||||
2026-10-13,csi300,4236.9492,4275.68,4571.724395,-0.06543014141235748,-1
|
||||
2026-10-14,csi300,4259.3328,4217.6801,4562.077363333334,-0.07481392160122602,-1
|
||||
2026-10-15,csi300,4145.9473,4166.0124,4551.73119,-0.08891815257382607,-1
|
||||
2026-10-16,csi300,4189.2597,4170.6131,4542.934168333333,-0.08305723928938558,-1
|
||||
2026-10-19,csi300,4148.3471,4174.5349,4537.024828333334,-0.07441439822672191,-1
|
||||
2026-10-20,csi300,4157.9331,4152.1076,4529.587941666667,-0.0732072521617404,-1
|
||||
2026-10-21,csi300,4161.2572,4111.9325,4519.133005,-0.07597857205874237,-1
|
||||
2026-10-22,csi300,4110.6489,4036.2966,4507.783878333333,-0.09909489125907922,-1
|
||||
2026-10-23,csi300,3992.9041,4105.3286,4497.405991666667,-0.07955486845448023,-1
|
||||
2026-04-27,csi500,8236.4336,8299.0486,8157.390455000001,0.07255908229285746,1
|
||||
2026-04-28,csi500,8274.6312,8203.9614,8150.953713333333,0.05806732801430603,1
|
||||
2026-04-29,csi500,8157.3548,8342.4217,8148.215855,0.0951902913124556,1
|
||||
2026-04-30,csi500,8331.4394,8349.5081,8144.892121666666,0.07734303916170071,1
|
||||
2026-05-06,csi500,8441.3419,8588.4399,8144.680046666666,0.12927137378477394,1
|
||||
2026-05-07,csi500,8637.8414,8696.7989,8147.662646666667,0.15419647779450862,1
|
||||
2026-05-08,csi500,8638.8383,8694.1709,8153.056823333333,0.1483349483760017,1
|
||||
2026-05-11,csi500,8771.1761,8839.7415,8166.435088333334,0.11259554520582093,1
|
||||
2026-05-12,csi500,8856.1797,8785.9791,8174.756398333334,0.11234174460747526,1
|
||||
2026-05-13,csi500,8730.913,8918.239,8185.076091666666,0.11906525145053592,1
|
||||
2026-05-14,csi500,8952.9502,8670.1574,8193.81026,0.08816354336767573,1
|
||||
2026-05-15,csi500,8676.621,8536.3444,8200.30912,0.055359077311168736,1
|
||||
2026-05-18,csi500,8493.0157,8554.2372,8204.358358333333,0.06342056160996856,1
|
||||
2026-05-19,csi500,8524.1543,8627.9461,8209.716713333333,0.0547506280958201,1
|
||||
2026-05-20,csi500,8581.3938,8656.3062,8215.224971666667,0.053822968556902495,1
|
||||
2026-05-21,csi500,8703.1742,8419.8373,8215.162768333334,0.015659173610917954,1
|
||||
2026-05-22,csi500,8473.6091,8576.9402,8219.785355,0.03707394094932104,1
|
||||
2026-05-25,csi500,8631.2078,8703.8901,8224.96836,0.03912395252977352,1
|
||||
2026-05-26,csi500,8665.4355,8658.6192,8227.152691666666,0.04380990130806839,1
|
||||
2026-05-27,csi500,8659.2188,8530.9802,8226.715428333333,0.03432451014448468,1
|
||||
2026-05-28,csi500,8503.6714,8563.2218,8225.128286666666,0.03183174514726894,1
|
||||
2026-05-29,csi500,8589.818,8359.5596,8220.148720000001,0.018966227705557115,1
|
||||
2026-06-01,csi500,8358.4866,8274.212,8220.025355,-0.00817624695236896,0
|
||||
2026-06-02,csi500,8290.8329,8321.4347,8221.233516666667,-0.0033622819049662356,0
|
||||
2026-06-03,csi500,8317.0025,8362.156,8222.116595000001,-0.026347497640403672,0
|
||||
2026-06-04,csi500,8279.8632,8356.7444,8222.056756666667,-0.03910111109962544,0
|
||||
2026-06-05,csi500,8317.6415,8251.1407,8221.584416666667,-0.05095715337272688,0
|
||||
2026-06-08,csi500,7978.6598,7963.4529,8214.136915000001,-0.09913056846741497,-1
|
||||
2026-06-09,csi500,8059.339,8176.1785,8210.351063333334,-0.06940610637236777,-1
|
||||
2026-06-10,csi500,8094.1367,8063.8637,8205.424256666667,-0.0958008974641742,-1
|
||||
2026-06-11,csi500,8025.608,8035.7788,8202.023936666666,-0.07316806036301027,-1
|
||||
2026-06-12,csi500,8189.2103,8106.203,8200.70812,-0.050389414935039345,-1
|
||||
2026-06-15,csi500,8175.0523,8406.7479,8207.220148333332,-0.01724166591966836,0
|
||||
2026-06-16,csi500,8430.9157,8507.9799,8214.079353333333,-0.013904375225524346,0
|
||||
2026-06-17,csi500,8451.6325,8627.0862,8226.57929,-0.003375573752231742,0
|
||||
2026-06-18,csi500,8590.4987,8673.0899,8241.796846666668,0.03007808713833482,1
|
||||
2026-06-22,csi500,8709.664,8868.782,8265.597461666668,0.034026330275685135,1
|
||||
2026-06-23,csi500,8831.5916,8688.5923,8283.784446666667,-0.0017575819345421184,0
|
||||
2026-06-24,csi500,8638.6561,8842.9378,8301.705653333333,0.02128729717089306,1
|
||||
2026-06-25,csi500,8844.849,8938.0113,8323.303671666667,0.047712114019441865,1
|
||||
2026-06-26,csi500,8891.0312,8703.5652,8339.402851666668,0.016389088508719896,1
|
||||
2026-06-29,csi500,8731.5763,8821.0944,8357.192368333333,0.05521042041497015,1
|
||||
2026-06-30,csi500,8815.1067,9031.3788,8380.759911666666,0.09150923374938924,1
|
||||
2026-07-01,csi500,9052.0429,9028.9326,8402.073914999999,0.08502114425052221,1
|
||||
2026-07-02,csi500,8829.6208,8694.1756,8420.221954999999,0.039705023441322984,1
|
||||
2026-07-03,csi500,8702.3265,8745.2607,8440.393999999998,0.04649134655835607,1
|
||||
2026-07-06,csi500,8790.9674,8651.1339,8458.394388333332,0.04847732144477934,1
|
||||
2026-07-07,csi500,8604.0756,8508.7885,8467.788318333334,0.06847979222681166,1
|
||||
2026-07-08,csi500,8539.0155,8390.0194,8475.978093333333,0.026154137901954977,0
|
||||
2026-07-09,csi500,8437.1473,8652.787,8487.368466666667,0.07303239760860536,1
|
||||
2026-07-10,csi500,8672.3631,8503.9705,8496.306358333333,0.05826338823562427,1
|
||||
2026-07-13,csi500,8409.1434,8138.1443,8497.132618333333,0.003940352838437411,0
|
||||
2026-07-14,csi500,8135.0456,8275.9388,8500.996976666667,-0.01556001221352199,-1
|
||||
2026-07-15,csi500,8294.1422,8147.5786,8500.455261666666,-0.0423603845138375,-1
|
||||
2026-07-16,csi500,8006.4489,7955.6635,8496.146421666666,-0.07782728541648276,-1
|
||||
2026-07-17,csi500,7900.097,7513.7627,8483.20876,-0.13366945498858496,-1
|
||||
2026-07-20,csi500,7597.7694,7411.3134,8468.891873333332,-0.16433695179338037,-1
|
||||
2026-07-21,csi500,7437.4524,7800.6085,8459.299001666666,-0.10220111260140496,-1
|
||||
2026-07-22,csi500,7741.9063,7751.6618,8450.239915,-0.12340649959112004,-1
|
||||
2026-07-23,csi500,7750.8521,7734.31,8441.680483333334,-0.13467216135652005,-1
|
||||
2026-07-24,csi500,7625.2021,7532.7006,8428.908016666666,-0.1345270096902358,-1
|
||||
2026-07-27,csi500,7512.4036,7720.5975,8420.851951666667,-0.12475741105321358,-1
|
||||
2026-07-28,csi500,7589.7596,7443.4332,8405.86881,-0.17582537895542594,-1
|
||||
2026-07-29,csi500,7444.802,7524.5075,8392.1188,-0.1666226969066089,-1
|
||||
2026-07-30,csi500,7477.3139,7309.5753,8370.80439,-0.1592560771374344,-1
|
||||
2026-07-31,csi500,7537.8478,7493.985,8350.757491666667,-0.14308043441174956,-1
|
||||
2026-08-03,csi500,7457.1176,7414.5227,8329.430021666667,-0.14294209456173135,-1
|
||||
2026-08-04,csi500,7467.0793,7607.4867,8308.892441666667,-0.10592598464517011,-1
|
||||
2026-08-05,csi500,7567.9561,7809.2065,8292.612898333335,-0.06922664564994918,-1
|
||||
2026-08-06,csi500,7737.5918,7829.3615,8274.46494,-0.09516303822109573,-1
|
||||
2026-08-07,csi500,7828.7906,7980.1245,8262.964391666666,-0.06160016665156587,-1
|
||||
2026-08-10,csi500,8003.9204,8030.9483,8254.541123333333,-0.013172044639218283,-1
|
||||
2026-08-11,csi500,7979.276,7967.5386,8244.762813333333,-0.037264678660987705,-1
|
||||
2026-08-12,csi500,7978.0412,8045.3099,8235.05221,-0.012552036012269951,-1
|
||||
2026-08-13,csi500,8096.8517,7968.3809,8223.586788333334,0.0015985341763136152,0
|
||||
2026-08-14,csi500,7989.6469,7990.3277,8216.428295,0.06342561231006139,0
|
||||
2026-08-17,csi500,8007.8703,8184.6407,8209.88997,0.10434416388328693,0
|
||||
2026-08-18,csi500,8178.8426,8177.1762,8201.111405,0.04827414425425913,0
|
||||
2026-08-19,csi500,8029.5224,7783.4558,8186.525348333334,0.004101572129991515,0
|
||||
2026-08-20,csi500,7864.677,7850.4006,8175.182355,0.015009819880506425,0
|
||||
2026-08-21,csi500,7812.2612,7854.3336,8163.367551666667,0.04269823229135117,0
|
||||
2026-08-24,csi500,7861.0536,7717.0851,8152.659643333333,-0.0004549388826446954,-1
|
||||
2026-08-25,csi500,7644.2044,7710.9365,8143.2717183333325,0.035938160901343164,0
|
||||
2026-08-26,csi500,7714.8387,7770.5347,8134.090051666667,0.03269678447393409,0
|
||||
2026-08-27,csi500,7786.6874,7946.3255,8127.159543333332,0.08711179157016136,0
|
||||
2026-08-28,csi500,7939.4485,7895.4511,8119.471321666667,0.05357177789920864,0
|
||||
2026-08-31,csi500,7797.233,7952.0986,8114.487286666667,0.07250310259350878,0
|
||||
2026-09-01,csi500,7944.2925,7858.5176,8112.738365,0.0329978756321716,0
|
||||
2026-09-02,csi500,7781.2902,7729.2332,8105.289276666666,-0.010240899635577616,-1
|
||||
2026-09-03,csi500,7776.8153,7755.3612,8100.147568333335,-0.009451639191778272,-1
|
||||
2026-09-04,csi500,7806.611,7652.6887,8093.762733333334,-0.04103141498606944,-1
|
||||
2026-09-07,csi500,7687.4731,7759.3676,8087.982143333334,-0.03381676607232054,-1
|
||||
2026-09-08,csi500,7773.2785,7770.7314,8077.381868333334,-0.02470112915424094,-1
|
||||
2026-09-09,csi500,7793.0399,7768.1055,8065.050628333334,-0.03445540363833599,-1
|
||||
2026-09-10,csi500,7731.6328,7717.7984,8049.895831666667,-0.03144710363933534,-1
|
||||
2026-09-11,csi500,7638.6277,7580.5371,8031.686618333333,-0.051285831493494305,-1
|
||||
2026-09-14,csi500,7511.0366,7571.2002,8010.060255,-0.07495020520570927,-1
|
||||
2026-09-15,csi500,7550.6828,7561.5909,7991.2768983333335,-0.07528091421094729,-1
|
||||
2026-09-16,csi500,7556.9044,7683.4702,7971.952438333334,-0.012845913507981921,-1
|
||||
2026-09-17,csi500,7651.4565,7654.9785,7950.568558333333,-0.02489326468256914,-1
|
||||
2026-09-18,csi500,7731.0711,7799.6129,7935.502686666666,-0.006966943700990713,-1
|
||||
2026-09-21,csi500,7829.8194,7850.48,7919.325779999999,0.017285658803995796,0
|
||||
2026-09-22,csi500,7911.6401,7828.9445,7899.285208333334,0.015303977668601032,0
|
||||
2026-09-23,csi500,7839.9385,7791.8165,7878.666606666667,0.002738781927066114,0
|
||||
2026-09-24,csi500,7763.7294,7624.0659,7860.831445000001,-0.04055454310297257,-1
|
||||
2026-09-28,csi500,7599.1961,7402.2951,7838.448685,-0.06246077567372943,-1
|
||||
2026-09-29,csi500,7388.109,7439.6273,7818.256908333334,-0.06444478693963884,-1
|
||||
2026-09-30,csi500,7469.046,7435.1639,7800.363165,-0.05387195417110224,-1
|
||||
2026-10-08,csi500,7420.4365,7248.4336,7781.336735,-0.06220534269816047,-1
|
||||
2026-10-09,csi500,7209.8576,7251.006,7757.973718333334,-0.0650331025200993,-1
|
||||
2026-10-12,csi500,7226.066,7093.0205,7734.457885,-0.07313353802043454,-1
|
||||
2026-10-13,csi500,6976.6318,7085.0875,7716.906938333333,-0.086898847272038,-1
|
||||
2026-10-14,csi500,7066.7305,6980.1074,7695.309748333334,-0.10174383327674918,-1
|
||||
2026-10-15,csi500,6809.8338,6769.2512,7672.337625,-0.1285840286283445,-1
|
||||
2026-10-16,csi500,6863.1865,6772.7532,7652.622453333333,-0.12245010183214944,-1
|
||||
2026-10-19,csi500,6735.531,6800.6594,7640.737398333334,-0.10287895035827999,-1
|
||||
2026-10-20,csi500,6773.4489,6841.4392,7631.239495000001,-0.09638643553501602,-1
|
||||
2026-10-21,csi500,6875.7127,6840.5627,7615.238731666666,-0.09535403455905023,-1
|
||||
2026-10-22,csi500,6841.5348,6655.2498,7596.965198333333,-0.13382239707261445,-1
|
||||
2026-10-23,csi500,6559.6131,6814.4429,7581.63408,-0.10980247691094103,-1
|
||||
2026-04-27,csi1000,8292.811,8338.7263,8121.872698333333,0.07647679513496564,1
|
||||
2026-04-28,csi1000,8307.6916,8226.6919,8117.805166666667,0.05905843565713864,1
|
||||
2026-04-29,csi1000,8163.3482,8343.0651,8117.432343333334,0.09491194334880837,1
|
||||
2026-04-30,csi1000,8345.2469,8381.9465,8117.428896666666,0.07957004966092573,1
|
||||
2026-05-06,csi1000,8462.023,8574.5557,8120.341595000001,0.124765433263468,1
|
||||
2026-05-07,csi1000,8602.146,8714.51,8126.713316666666,0.15629197723498622,1
|
||||
2026-05-08,csi1000,8655.1267,8741.1507,8134.818156666666,0.1492416017077849,1
|
||||
2026-05-11,csi1000,8807.905,8866.7792,8149.674005,0.11450946711822341,1
|
||||
2026-05-12,csi1000,8880.4148,8821.8874,8159.887111666667,0.11367127203346006,1
|
||||
2026-05-13,csi1000,8764.0225,8955.4473,8172.359228333333,0.11967836141787336,1
|
||||
2026-05-14,csi1000,8989.4867,8778.7088,8184.203096666666,0.09384207910204645,1
|
||||
2026-05-15,csi1000,8786.3816,8682.6536,8194.721086666666,0.06604138792413106,1
|
||||
2026-05-18,csi1000,8645.7632,8720.2132,8202.828335,0.0757508180872617,1
|
||||
2026-05-19,csi1000,8691.3841,8808.6445,8212.134075,0.06992132402453288,1
|
||||
2026-05-20,csi1000,8769.0973,8808.9095,8221.624016666667,0.06036440051582215,1
|
||||
2026-05-21,csi1000,8852.4337,8510.4958,8224.885076666667,0.01826816220447336,1
|
||||
2026-05-22,csi1000,8578.9002,8692.6655,8233.015678333333,0.040893679868990285,1
|
||||
2026-05-25,csi1000,8756.4578,8799.3116,8241.341363333333,0.03750299617165642,1
|
||||
2026-05-26,csi1000,8755.9075,8687.2528,8245.690053333334,0.03880457747569399,1
|
||||
2026-05-27,csi1000,8679.5357,8546.5142,8246.621668333333,0.029187003708462944,1
|
||||
2026-05-28,csi1000,8527.9088,8637.743,8247.90333,0.03585879776387424,1
|
||||
2026-05-29,csi1000,8673.798,8408.7357,8246.766175,0.022128432936694642,1
|
||||
2026-06-01,csi1000,8393.5182,8345.1291,8250.144096666667,0.00024739109371219037,1
|
||||
2026-06-02,csi1000,8360.8072,8384.7812,8254.981811666667,0.0003381911349589206,1
|
||||
2026-06-03,csi1000,8386.8576,8432.679,8259.341138333333,-0.01654624507249991,0
|
||||
2026-06-04,csi1000,8338.854,8420.0946,8262.1951,-0.03378450423489099,0
|
||||
2026-06-05,csi1000,8380.8523,8340.9631,8264.480006666667,-0.04578202730219483,0
|
||||
2026-06-08,csi1000,8069.482,8081.2614,8259.999536666666,-0.08859110870833464,-1
|
||||
2026-06-09,csi1000,8178.8231,8318.6978,8259.252396666667,-0.05703876927742235,0
|
||||
2026-06-10,csi1000,8232.0235,8198.7232,8256.965986666666,-0.08449874971627602,-1
|
||||
2026-06-11,csi1000,8158.4598,8159.4548,8256.052023333334,-0.07054044212059973,-1
|
||||
2026-06-12,csi1000,8294.8972,8202.7991,8255.90948,-0.05526588092838336,-1
|
||||
2026-06-15,csi1000,8269.3972,8521.233,8264.265748333333,-0.022818272378936744,0
|
||||
2026-06-16,csi1000,8534.2702,8646.4034,8273.429225,-0.0184183957020857,0
|
||||
2026-06-17,csi1000,8581.6499,8704.4677,8286.683115,-0.011856382450063818,0
|
||||
2026-06-18,csi1000,8666.6378,8771.0244,8303.142946666667,0.03061262306245416,1
|
||||
2026-06-22,csi1000,8813.7247,8865.676,8327.419100000001,0.019903043548610055,1
|
||||
2026-06-23,csi1000,8838.7627,8680.0387,8345.405463333334,-0.013554798991321282,0
|
||||
2026-06-24,csi1000,8650.8156,8793.4866,8362.777225,0.0122286990428091,1
|
||||
2026-06-25,csi1000,8806.0709,8825.9201,8382.552956666666,0.03269238118155826,1
|
||||
2026-06-26,csi1000,8771.5979,8601.4075,8396.80453,-0.004206596561161957,0
|
||||
2026-06-29,csi1000,8616.4237,8597.8932,8410.637248333333,0.022495355633546765,1
|
||||
2026-06-30,csi1000,8574.2495,8809.7859,8430.469508333334,0.05568000140345353,1
|
||||
2026-07-01,csi1000,8827.4702,8876.6303,8449.010805,0.058659741771198703,1
|
||||
2026-07-02,csi1000,8688.2905,8625.3336,8465.709418333334,0.022846191583955733,1
|
||||
2026-07-03,csi1000,8627.3819,8620.7886,8483.77923,0.023835124132690844,1
|
||||
2026-07-06,csi1000,8669.123,8472.6028,8498.222333333333,0.01578231415506437,0
|
||||
2026-07-07,csi1000,8436.3894,8301.8035,8503.989585,0.027290553922683314,0
|
||||
2026-07-08,csi1000,8315.9619,8117.8607,8507.263155,-0.02414285322397447,-1
|
||||
2026-07-09,csi1000,8161.8585,8300.077,8512.293905,0.012362144388530893,0
|
||||
2026-07-10,csi1000,8312.4918,8198.3078,8515.172828333332,0.0047617152067562785,0
|
||||
2026-07-13,csi1000,8124.363,7787.8529,8509.224339999999,-0.050585927430552347,-1
|
||||
2026-07-14,csi1000,7799.813,7925.1232,8506.206983333333,-0.06995581507981297,-1
|
||||
2026-07-15,csi1000,7959.3737,7817.8313,8499.287781666666,-0.09582852680688014,-1
|
||||
2026-07-16,csi1000,7713.1352,7631.7622,8488.02655,-0.12323619742997027,-1
|
||||
2026-07-17,csi1000,7599.3879,7167.9959,8468.19625,-0.18276411361938527,-1
|
||||
2026-07-20,csi1000,7256.2669,6965.3757,8445.099911666666,-0.21434353116445948,-1
|
||||
2026-07-21,csi1000,6975.8931,7259.863,8424.743633333333,-0.16361398250447878,-1
|
||||
2026-07-22,csi1000,7196.8632,7158.7622,8404.677333333333,-0.18590173322149606,-1
|
||||
2026-07-23,csi1000,7169.5427,7195.4997,8386.199975,-0.18473092680727976,-1
|
||||
2026-07-24,csi1000,7109.2475,6995.6931,8363.816088333335,-0.1866804241050083,-1
|
||||
2026-07-27,csi1000,6981.1649,7228.7845,8347.184298333334,-0.15923769557872625,-1
|
||||
2026-07-28,csi1000,7135.7349,7026.2761,8325.237814999999,-0.2024464408380231,-1
|
||||
2026-07-29,csi1000,7020.2233,7095.1863,8303.791811666666,-0.20068921874554135,-1
|
||||
2026-07-30,csi1000,7053.0899,6900.6579,8275.893515,-0.19995466610126245,-1
|
||||
2026-07-31,csi1000,7082.7535,7075.5065,8248.57679,-0.17925066623255315,-1
|
||||
2026-08-03,csi1000,7055.2711,7079.7761,8220.887213333333,-0.16439183246026834,-1
|
||||
2026-08-04,csi1000,7128.4935,7279.1927,8194.427438333334,-0.12317935494377819,-1
|
||||
2026-08-05,csi1000,7253.2245,7493.0481,8172.280116666666,-0.07696764247260368,-1
|
||||
2026-08-06,csi1000,7440.008,7530.4251,8148.529746666667,-0.09272828432796454,-1
|
||||
2026-08-07,csi1000,7534.2423,7679.5285,8130.210074999999,-0.06327882688181097,-1
|
||||
2026-08-10,csi1000,7723.3802,7733.8995,8114.397506666666,-0.006927891511664175,-1
|
||||
2026-08-11,csi1000,7686.0417,7698.0479,8097.361418333333,-0.02865258927457437,-1
|
||||
2026-08-12,csi1000,7704.9586,7793.7165,8080.4459516666675,-0.0030845894564135445,-1
|
||||
2026-08-13,csi1000,7847.2382,7715.8946,8062.2290366666675,0.011023980804852673,0
|
||||
2026-08-14,csi1000,7750.9873,7769.8204,8049.884446666666,0.08395993920699651,0
|
||||
2026-08-17,csi1000,7797.1841,7968.383,8037.813071666667,0.14399902362768469,0
|
||||
2026-08-18,csi1000,7969.3738,7945.9644,8023.590618333334,0.09450610844860297,0
|
||||
2026-08-19,csi1000,7795.2592,7517.7684,8004.099211666667,0.0501492003743329,0
|
||||
2026-08-20,csi1000,7602.4984,7589.7793,7988.153630000001,0.054795304904258435,0
|
||||
2026-08-21,csi1000,7555.5478,7601.8044,7970.887986666667,0.08664063607936145,0
|
||||
2026-08-24,csi1000,7614.8889,7491.4899,7955.600556666666,0.03634157305422514,0
|
||||
2026-08-25,csi1000,7420.7673,7527.4984,7941.973378333334,0.07133541194033066,0
|
||||
2026-08-26,csi1000,7536.3744,7544.6696,7927.971518333333,0.06335045776035497,0
|
||||
2026-08-27,csi1000,7551.4431,7732.9452,7916.309288333333,0.1206098479392812,0
|
||||
2026-08-28,csi1000,7734.1914,7705.0293,7904.3915333333325,0.08897211810914163,0
|
||||
2026-08-31,csi1000,7607.2344,7770.4218,7894.882511666667,0.09755191269396213,0
|
||||
2026-09-01,csi1000,7773.0554,7691.3691,7888.384306666666,0.05662391655052623,0
|
||||
2026-09-02,csi1000,7616.2341,7583.7559,7876.135275,0.012105594250756191,0
|
||||
2026-09-03,csi1000,7629.6496,7600.0971,7866.158173333333,0.0092520673235299,0
|
||||
2026-09-04,csi1000,7655.9707,7508.0918,7855.302123333333,-0.022323857512866918,-1
|
||||
2026-09-07,csi1000,7551.0207,7639.3613,7845.911493333333,-0.012223872316934115,-1
|
||||
2026-09-08,csi1000,7650.0645,7659.6069,7831.5510583333335,-0.0049936036381379445,-1
|
||||
2026-09-09,csi1000,7676.8632,7648.798,7814.924301666667,-0.018594273989822496,-1
|
||||
2026-09-10,csi1000,7611.5208,7587.7521,7796.3123749999995,-0.016607601145821715,-1
|
||||
2026-09-11,csi1000,7504.6633,7427.2405,7773.915976666667,-0.04409109636562514,-1
|
||||
2026-09-14,csi1000,7363.4176,7468.2987,7750.626355,-0.06275856720240469,-1
|
||||
2026-09-15,csi1000,7453.4739,7437.7033,7729.920765,-0.06396468375821063,-1
|
||||
2026-09-16,csi1000,7437.8191,7587.4269,7709.81977,0.00926584809396358,0
|
||||
2026-09-17,csi1000,7555.7902,7548.8223,7688.534806666667,-0.005396336096360588,-1
|
||||
2026-09-18,csi1000,7621.2392,7687.594,7673.304581666667,0.011285425865469545,1
|
||||
2026-09-21,csi1000,7723.6824,7766.3348,7659.445275000001,0.03668761537007481,1
|
||||
2026-09-22,csi1000,7819.6225,7759.0312,7641.932696666667,0.03075826625217215,1
|
||||
2026-09-23,csi1000,7762.6781,7745.5576,7623.081485,0.02662648076729557,1
|
||||
2026-09-24,csi1000,7707.866,7570.1448,7605.495005,-0.021052832496472385,-1
|
||||
2026-09-28,csi1000,7551.2173,7294.1735,7583.384753333334,-0.053323067830514326,-1
|
||||
2026-09-29,csi1000,7265.5109,7325.3515,7564.263898333334,-0.057277495540847045,-1
|
||||
2026-09-30,csi1000,7361.1448,7298.8208,7547.547519999999,-0.05103750644342364,-1
|
||||
2026-10-08,csi1000,7306.742,7138.584,7531.226241666666,-0.0587007158286833,-1
|
||||
2026-10-09,csi1000,7107.5391,7155.9114,7512.156815,-0.05844474013364909,-1
|
||||
2026-10-12,csi1000,7132.6819,7021.4723,7492.54289,-0.0648126731748272,-1
|
||||
2026-10-13,csi1000,6894.5954,7023.2205,7479.799016666667,-0.08065344415638509,-1
|
||||
2026-10-14,csi1000,7001.9097,6905.1728,7462.799843333332,-0.09849514601069143,-1
|
||||
2026-10-15,csi1000,6734.3146,6678.6486,7443.813465,-0.12683684416819474,-1
|
||||
2026-10-16,csi1000,6777.3874,6681.9444,7427.983168333334,-0.11937760855418555,-1
|
||||
2026-10-19,csi1000,6639.9381,6698.3026,7420.154946666667,-0.09814383955925488,-1
|
||||
2026-10-20,csi1000,6678.6378,6766.9027,7416.847063333334,-0.09391643641677061,-1
|
||||
2026-10-21,csi1000,6798.9656,6780.2598,7408.853676666667,-0.08839334852198266,-1
|
||||
2026-10-22,csi1000,6782.2825,6578.2722,7399.178843333333,-0.1330035482780071,-1
|
||||
2026-10-23,csi1000,6480.1789,6734.5467,7391.496293333334,-0.10786789881118275,-1
|
||||
2026-04-27,csi2000,3450.7593,3493.789,3434.9224433333334,0.06352006035947388,1
|
||||
2026-04-28,csi2000,3480.9288,3453.1333,3432.7347250000003,0.04730366415053555,1
|
||||
2026-04-29,csi2000,3430.3893,3494.3908,3432.18076,0.07777780039603766,1
|
||||
2026-04-30,csi2000,3495.8377,3512.5554,3431.7698900000005,0.061502147056329504,1
|
||||
2026-05-06,csi2000,3540.0901,3583.9252,3432.9790900000003,0.10239012641393574,1
|
||||
2026-05-07,csi2000,3593.2716,3653.1161,3436.0507816666664,0.14735077336930535,1
|
||||
2026-05-08,csi2000,3636.7594,3689.5483,3439.7984716666665,0.14312237706111364,1
|
||||
2026-05-11,csi2000,3716.6162,3731.607,3445.6359133333335,0.10735192341350519,1
|
||||
2026-05-12,csi2000,3733.248,3698.8677,3449.334861666667,0.10589951071091064,1
|
||||
2026-05-13,csi2000,3682.3414,3753.2471,3453.8751649999995,0.11431941862779516,1
|
||||
2026-05-14,csi2000,3766.3001,3679.3023,3457.8933366666665,0.08905361646203569,1
|
||||
2026-05-15,csi2000,3680.3399,3663.8329,3461.4108083333335,0.0707938983708285,1
|
||||
2026-05-18,csi2000,3649.401,3674.7006,3463.891958333333,0.07904250035486515,1
|
||||
2026-05-19,csi2000,3667.9238,3714.6643,3467.099245,0.07070579925913711,1
|
||||
2026-05-20,csi2000,3697.3226,3700.6371,3470.326958333333,0.061294490982958916,1
|
||||
2026-05-21,csi2000,3712.9904,3570.5252,3471.230938333333,0.01441715107194197,1
|
||||
2026-05-22,csi2000,3595.0746,3664.5212,3474.08655,0.04300559428589379,1
|
||||
2026-05-25,csi2000,3683.7782,3674.8203,3476.3886816666663,0.03753634307558418,1
|
||||
2026-05-26,csi2000,3654.5968,3609.1698,3476.98102,0.035514942173558106,1
|
||||
2026-05-27,csi2000,3602.5287,3534.2034,3475.8529333333336,0.021765740293025138,1
|
||||
2026-05-28,csi2000,3523.2241,3589.6986,3475.167465,0.027451457429169324,1
|
||||
2026-05-29,csi2000,3598.2801,3470.6919,3473.5083050000003,0.0050848312169125,0
|
||||
2026-06-01,csi2000,3461.4289,3468.8676,3474.2936600000003,-0.007304048534010565,-1
|
||||
2026-06-02,csi2000,3467.3825,3460.3172,3474.9727933333334,-0.014871850846822299,-1
|
||||
2026-06-03,csi2000,3457.193,3467.0201,3474.8351949999997,-0.03261929127315488,-1
|
||||
2026-06-04,csi2000,3435.6415,3462.2428,3473.8400783333336,-0.05224944808077692,-1
|
||||
2026-06-05,csi2000,3454.0529,3466.5158,3473.4049816666666,-0.06044981170188224,-1
|
||||
2026-06-08,csi2000,3350.601,3354.7062,3469.8341116666666,-0.10100227596314404,-1
|
||||
2026-06-09,csi2000,3397.2962,3429.466,3467.67113,-0.07283355930789304,-1
|
||||
2026-06-10,csi2000,3395.2187,3368.0292,3465.1717100000005,-0.1026359015903856,-1
|
||||
2026-06-11,csi2000,3343.2002,3346.8774,3463.0947083333335,-0.09034998293018759,-1
|
||||
2026-06-12,csi2000,3394.0889,3363.5154,3461.116986666667,-0.08196812141732768,-1
|
||||
2026-06-15,csi2000,3387.6042,3480.167,3462.533316666667,-0.05293862580260289,0
|
||||
2026-06-16,csi2000,3482.2114,3537.9445,3464.0263016666668,-0.047573558665853,0
|
||||
2026-06-17,csi2000,3516.6065,3547.9501,3467.1533266666665,-0.041259652290682625,0
|
||||
2026-06-18,csi2000,3534.8231,3561.7105,3471.956186666667,-0.0024687404530850943,0
|
||||
2026-06-22,csi2000,3575.1163,3589.0089,3480.1541466666667,-0.020606320956746083,0
|
||||
2026-06-23,csi2000,3582.7163,3571.3476,3486.126571666667,-0.02815721356497347,0
|
||||
2026-06-24,csi2000,3550.3895,3569.4094,3490.8433433333335,-0.01101649470745325,0
|
||||
2026-06-25,csi2000,3571.8424,3538.0935,3495.9036583333336,0.0011007006557688381,1
|
||||
2026-06-26,csi2000,3517.475,3446.9849,3498.6014383333336,-0.03975645754771728,-1
|
||||
2026-06-29,csi2000,3446.7638,3415.0058,3500.5654466666665,-0.01604466821154593,-1
|
||||
2026-06-30,csi2000,3407.7019,3494.5864,3504.7715833333336,0.00741417746817441,0
|
||||
2026-07-01,csi2000,3497.9884,3545.3819,3508.710578333333,0.02458291973926552,1
|
||||
2026-07-02,csi2000,3488.6372,3481.7066,3512.554858333334,0.004236058510303842,0
|
||||
2026-07-03,csi2000,3480.4876,3487.715,3517.6174833333334,0.00735713855770026,0
|
||||
2026-07-06,csi2000,3496.2247,3413.5572,3520.716675,-0.015277184082068795,-1
|
||||
2026-07-07,csi2000,3399.7375,3313.1095,3519.7710433333336,-0.012399506102799718,-1
|
||||
2026-07-08,csi2000,3316.5086,3233.4737,3517.91779,-0.05714950957379372,-1
|
||||
2026-07-09,csi2000,3242.9279,3277.0738,3516.3990733333335,-0.027005525961592003,-1
|
||||
2026-07-10,csi2000,3276.7552,3272.9877,3514.641535,-0.0220772054572419,-1
|
||||
2026-07-13,csi2000,3249.745,3088.0007,3509.0814766666667,-0.0819127214342471,-1
|
||||
2026-07-14,csi2000,3087.4574,3143.758,3504.71878,-0.09666461408317473,-1
|
||||
2026-07-15,csi2000,3149.3483,3118.7468,3498.87522,-0.1184862283735656,-1
|
||||
2026-07-16,csi2000,3084.044,3060.6182,3491.7703766666664,-0.13735590587928515,-1
|
||||
2026-07-17,csi2000,3048.5357,2871.411,3480.9642266666665,-0.1938112319909212,-1
|
||||
2026-07-20,csi2000,2898.6364,2754.7279,3468.319286666667,-0.23245442495280522,-1
|
||||
2026-07-21,csi2000,2758.3459,2821.8145,3456.318338333333,-0.20987402626392349,-1
|
||||
2026-07-22,csi2000,2798.526,2786.2781,3444.666531666667,-0.2194008061949968,-1
|
||||
2026-07-23,csi2000,2785.497,2832.8432,3434.2319599999996,-0.1993305999403352,-1
|
||||
2026-07-24,csi2000,2799.5232,2754.6389,3421.912791666667,-0.2008555360947476,-1
|
||||
2026-07-27,csi2000,2748.1107,2851.7202,3411.8892399999995,-0.1649442586598242,-1
|
||||
2026-07-28,csi2000,2822.9398,2803.3707,3400.372238333333,-0.19779613976635413,-1
|
||||
2026-07-29,csi2000,2801.4676,2815.1152,3388.7482349999996,-0.20597687938780296,-1
|
||||
2026-07-30,csi2000,2801.3448,2722.1273,3374.384936666667,-0.2181629261925746,-1
|
||||
2026-07-31,csi2000,2779.5447,2809.2143,3360.3199066666666,-0.19454017888502928,-1
|
||||
2026-08-03,csi2000,2810.6173,2839.1571,3346.14672,-0.16827024313522565,-1
|
||||
2026-08-04,csi2000,2861.3918,2920.8145,3332.6335116666664,-0.11840689237708568,-1
|
||||
2026-08-05,csi2000,2917.7951,3000.2908,3320.9905633333333,-0.07211529198459221,-1
|
||||
2026-08-06,csi2000,2987.5005,3036.4679,3309.0442433333333,-0.07342095866135212,-1
|
||||
2026-08-07,csi2000,3037.3191,3085.257,3299.1434883333336,-0.05735759410278263,-1
|
||||
2026-08-10,csi2000,3096.2316,3120.8289,3290.0934216666665,0.010630891372531037,0
|
||||
2026-08-11,csi2000,3104.4221,3105.7378,3280.6107083333336,-0.012093869820768655,-1
|
||||
2026-08-12,csi2000,3108.2789,3159.9817,3271.3659983333337,0.013221624788520847,0
|
||||
2026-08-13,csi2000,3176.389,3124.7932,3261.7686000000003,0.020967986140839168,0
|
||||
2026-08-14,csi2000,3132.8166,3149.1391,3254.745498333333,0.09672182073551983,0
|
||||
2026-08-17,csi2000,3156.9745,3225.6361,3247.4307466666664,0.170945449821015,0
|
||||
2026-08-18,csi2000,3227.6389,3217.1122,3239.8022783333336,0.14008635223895838,0
|
||||
2026-08-19,csi2000,3169.0538,3037.1112,3230.267968333333,0.0900244307989213,0
|
||||
2026-08-20,csi2000,3074.9188,3084.5852,3222.7743316666665,0.08886549033140989,0
|
||||
2026-08-21,csi2000,3066.1217,3091.3694,3214.4688450000003,0.12224124911617285,0
|
||||
2026-08-24,csi2000,3094.646,3045.137,3207.376263333333,0.06782460635513954,0
|
||||
2026-08-25,csi2000,3017.8411,3094.2935,3201.1333616666666,0.10377607214058426,0
|
||||
2026-08-26,csi2000,3098.8601,3091.3397,3194.983736666667,0.09812191700005735,0
|
||||
2026-08-27,csi2000,3089.1708,3152.4541,3189.7409700000003,0.15808474497133163,0
|
||||
2026-08-28,csi2000,3152.1555,3149.1759,3184.523188333333,0.12101661307932265,0
|
||||
2026-08-31,csi2000,3113.4061,3180.13,3179.750091666667,0.12009652442268881,1
|
||||
2026-09-01,csi2000,3181.6336,3174.6163,3176.7485933333332,0.0868941865359818,0
|
||||
2026-09-02,csi2000,3148.8395,3154.3944,3172.1640666666667,0.05136288789073373,0
|
||||
2026-09-03,csi2000,3169.8589,3153.7786,3168.593223333333,0.038633933854528735,0
|
||||
2026-09-04,csi2000,3170.4125,3120.61,3164.8221,0.011458688854769639,0
|
||||
2026-09-07,csi2000,3131.1888,3172.3544,3161.636083333333,0.01651019701849088,1
|
||||
2026-09-08,csi2000,3178.0346,3189.7567,3156.7959116666666,0.027052798855073945,1
|
||||
2026-09-09,csi2000,3192.1086,3181.8688,3150.8613166666664,0.006926337579739927,1
|
||||
2026-09-10,csi2000,3164.0865,3130.9604,3143.911488333333,0.001973634607243646,0
|
||||
2026-09-11,csi2000,3100.8143,3073.668,3135.777446666667,-0.023965629209582895,-1
|
||||
2026-09-14,csi2000,3058.0966,3104.5704,3127.7034716666667,-0.03753234904582081,-1
|
||||
2026-09-15,csi2000,3099.4351,3068.612,3119.324545,-0.04615947183937197,-1
|
||||
2026-09-16,csi2000,3063.9349,3132.9682,3112.0505249999997,0.031561900005505183,1
|
||||
2026-09-17,csi2000,3123.5179,3136.5773,3105.3585883333335,0.01685545920404463,1
|
||||
2026-09-18,csi2000,3159.8902,3192.2066,3101.1122833333334,0.032618942271991136,1
|
||||
2026-09-21,csi2000,3202.8124,3256.5305,3098.4710283333334,0.06942002937798852,1
|
||||
2026-09-22,csi2000,3272.4214,3258.6651,3094.539006666667,0.053120882036561845,1
|
||||
2026-09-23,csi2000,3258.6887,3259.7898,3089.7791383333333,0.054490970371195324,1
|
||||
2026-09-24,csi2000,3248.513,3209.6326,3085.2445716666666,0.018137773996455664,1
|
||||
2026-09-28,csi2000,3207.8689,3104.8441,3078.86339,-0.014077270183605939,0
|
||||
2026-09-29,csi2000,3094.772,3128.9542,3074.1200066666665,-0.016092361004109934,0
|
||||
2026-09-30,csi2000,3145.939,3107.2648,3070.6892616666664,-0.02121563478395805,0
|
||||
2026-10-08,csi2000,3117.0728,3064.0022,3067.864736666667,-0.028655960079056797,-1
|
||||
2026-10-09,csi2000,3055.4601,3065.2988,3064.3351533333334,-0.028055171659798872,0
|
||||
2026-10-12,csi2000,3059.2899,3000.9452,3059.8011116666667,-0.03834660531114109,-1
|
||||
2026-10-13,csi2000,2952.5599,3024.9508,3058.75028,-0.04646504816738006,-1
|
||||
2026-10-14,csi2000,3018.7484,2960.1874,3055.69077,-0.07197078698823645,-1
|
||||
2026-10-15,csi2000,2884.142,2862.5847,3051.421401666667,-0.10034483508559511,-1
|
||||
2026-10-16,csi2000,2907.3274,2868.9849,3048.2275133333333,-0.08367256896637854,-1
|
||||
2026-10-19,csi2000,2850.5329,2855.6636,3047.9650566666664,-0.07092646310531925,-1
|
||||
2026-10-20,csi2000,2847.413,2902.7,3050.431258333333,-0.06502361808255341,-1
|
||||
2026-10-21,csi2000,2916.1688,2902.2333,3051.7715716666667,-0.05421952987213774,-1
|
||||
2026-10-22,csi2000,2902.9189,2804.4573,3052.0745583333332,-0.10485612334016026,-1
|
||||
2026-10-23,csi2000,2758.7035,2856.2698,3052.465001666667,-0.08936731768096384,-1
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
{
|
||||
"created_at_beijing": "2026-10-29T10:14:25.454221+08:00",
|
||||
"protocol_sha256": "65976e8169cb806ed0ca4c54162644256401a91da6d6b17de907b78b3fcb7c0d",
|
||||
"files_sha256": {
|
||||
".gitignore": "fba3161fc0773b7851ddc424b0e52a8a9bdd249cf70e6c274c84ea365c19f396",
|
||||
"account_daily.csv.gz": "560372a7ad6e1c17715171868a8c546eaab51c972d822c574e2fb8cc063d3c8f",
|
||||
"accounts.csv": "ada2bb595ae034bdd2c54a469b8e856414035fe2200cd8a61ce34f4690c1ae1e",
|
||||
"audit.json": "79d8e4bc3919c3b2fc2146c9a3df4899845f3833960b27ba39fba5be8876550f",
|
||||
"audit.py": "df896d7590a02c458532a3cd1c0b6e15bcb61d82de55a83ea68913ced7d047fe",
|
||||
"batch_choices.csv": "3c87119acc808e7b7af4b3975eef9894ddcbdb803a6179d350059b88b87805d3",
|
||||
"browser_check.py": "376ed7d8555897a3eb321a2dae8290ca9c8fb55d0424248accb14730521106d0",
|
||||
"browser_checks.json": "31393f64551a5b18dbcb66fb86e8dd7bd1c15ae834554014fa26ee3c37c20678",
|
||||
"build_dashboard.py": "46bd764efceade76196ef14be828c01787d709a35a301911c2e08ed0b00b45a0",
|
||||
"calculation_checks.json": "9dc3e93f2f8029849de8c38bca03ca406f820182625d1aff7f876a25e607385c",
|
||||
"calibrate.py": "ef277890e5307e913ad593e5d95020f82500c69631ae599bc5757cf2641b574a",
|
||||
"check_source.py": "259a43dce738ab7f73128c2aa0d0783eaf96c261d7d54f08175291d0e2929668",
|
||||
"common.py": "2393aabf43339823da86b7c4655157c03e1a626525905eec495dbbb5ff678948",
|
||||
"concentration.csv": "c627961765a963fdb82d07e5f0502195a04e64ac110da34d424092ef097fb9a5",
|
||||
"configurations.csv": "e211429b5eca834f11a399fffdfe26f820c7e0526f4fa79814be8524d32fa95b",
|
||||
"coverage.json": "3ad66aba2e908ea4ff923686a5d82771449b3887c9eb53d72f2aa1b0eab12c43",
|
||||
"current_window_comparison.csv": "d5143e915a46067d208e562b794a9660ebe6603dbf4018a5ec906d79973b39d9",
|
||||
"daily_coverage.csv": "dc8e681893c0f1d3533f441e5970abdd97d11e28c27cdaae551d5c1304008996",
|
||||
"dashboard.html.tpl": "f3c2b60e96578a9558a1ad0e17d351eb26efa9f0e47913456b29a5fd676333dd",
|
||||
"dashboard_manifest.json": "53884725247517c5ef81689467f9d4c1b53c195dac62df0f6aa8bd592db2a521",
|
||||
"diagnostics.py": "3686b262269923d0aab65a8fb329ab27bfb1b32964172d511654c5130a81b8b0",
|
||||
"engine.py": "6e8f7b5fc97ba1353eaeda346111ff214ce53b33a846bddf2486167362be479d",
|
||||
"figures/热度市场阶段.png": "9932ad29a3d133e9e14eda0234e465b4b4fd18b56d552c8cee5593154825dd38",
|
||||
"figures/热度指数对照.png": "fa0de0f21ca24b6f8ed78270bc431ef73b6c5c03df902eef3b35be173e96c218",
|
||||
"figures/热度样本覆盖.png": "9fb0a4d8c52969f390c777993576a3fee78302e2abc150100fe43613c8f71c56",
|
||||
"figures/热度阈值与持有期.png": "4dc3fbe5a429e7f7d759a75dfa75e2d249394de4e5a01f9326c3195546e86e9e",
|
||||
"figures/热度阈值与频次.png": "e6bfc007c659b8b7a9d622d43ce29d401e1312669732f2c4ae94419e35b72c69",
|
||||
"figures/热度频次与持有期.png": "f1d6168407595b78426cc37eeec3d38e05289383d080251b475251dce5b344c1",
|
||||
"finalize.py": "2b7e72f3232ccdcb48f2985beca0b99ddfe6a14b0dfa6e78d453371467af9fdd",
|
||||
"focus_grid.csv": "918f527214df749ec746033d6cb1d4fed1d1fc9fdf5f4f7cdbb79807fca76ddf",
|
||||
"grid.csv.gz": "75eec5840cf59a9ef4f6eea6ce7fdb6e3da5856b200f4a22e30b843f6036e361",
|
||||
"index_stages.csv": "7c6596c1884b86ba210496b31cc6122b85f44c0c1547c292c17fe93988023bc8",
|
||||
"prepare.py": "817ee9c6fe562998f44580cf7567c03cee7667223a20f58cd8bbc59072bf6cd5",
|
||||
"protocol.json": "65976e8169cb806ed0ca4c54162644256401a91da6d6b17de907b78b3fcb7c0d",
|
||||
"protocol.sha256": "f74e9c59eae1a2f64c9a36e7da749bf77715aff384ab5520fd6e593f7e24d901",
|
||||
"report.py": "edea595a49fe6f9ecafe80de2a8afbf840ca62b1cc6d548c56f479f5b9c0c93d",
|
||||
"requirements-research.txt": "5b2f983fc693c6b94ad19800535c91df6802d9fde1fae882e11f42f591078c31",
|
||||
"result_summary.json": "c665693d2cd88b24276763f0054ac34bd8f1f4ca84bc8f930040e2fbc78c7565",
|
||||
"source_check.json": "d9b1ae0fd749f33814940865d4d5737ff34ac48424a939324e427c74186a9b98",
|
||||
"test_recurrence.py": "61a05d3144c09d73ee15f18dade037e21d9f885e67f78656a1d910414e4c37a4",
|
||||
"uncertainty.json": "4727b7342b83b67415d49f6537eaa7a8719a55f27622bc1ed074969f8c873db9",
|
||||
"vendor/LICENSE-Chart.js.md": "41a84aa2caba645f966a18d9c2056b73e6d3a81d80bc0046bc0011a2634d4cce",
|
||||
"vendor/README.md": "c9867f9b937f9eba14677088f7d1341f0d660fc3455ae0a8b3aff7dd635198d3",
|
||||
"vendor/chart.umd.js": "48444a82d4edcb5bec0f1965faacdde18d9c17db3063d042abada2f705c9f54a",
|
||||
"window_examples.csv": "53f79026f46d01de3b6a58dbfc68b0dfdbf40e0e5c43a0356470db4e349ebdb0",
|
||||
"热度反复活跃与持有期矩阵研究.md": "4e6ebd95ab3864d459b9ff1cf802e47cd5c83029f9c23d5e8a7a9c5cf1900905",
|
||||
"热度反复活跃矩阵浏览器.html": "927cbc33258d72d427af0d6959712109c5ace710c1e04c43c61afa69e81dd7d6"
|
||||
},
|
||||
"runtime": {
|
||||
"python": "3.12.14",
|
||||
"numpy": "2.3.5",
|
||||
"pandas": "2.2.3",
|
||||
"matplotlib": "3.11.2"
|
||||
},
|
||||
"grid_rows": 536640,
|
||||
"parameter_combinations": 10320,
|
||||
"accounts": 72,
|
||||
"phase_partitions_checked": [
|
||||
"csi300",
|
||||
"csi500",
|
||||
"csi1000",
|
||||
"csi2000"
|
||||
],
|
||||
"cash_and_event_audit": "audit.json和calculation_checks.json",
|
||||
"local_links_checked": 43,
|
||||
"figures_checked": 6,
|
||||
"browser_checks": 10,
|
||||
"new_database_access": "仅155只读核对最新热度与参数,收益计算未追加数据",
|
||||
"live_strategy_changes": false
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
"""从原始热度批次按选股截止重建历史窗,不把晚到记录提前使用。"""
|
||||
import datetime as dt,sys
|
||||
from collections import defaultdict
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
from common import *
|
||||
|
||||
def choose(batches,deadline=None,offset=8):
|
||||
good=[b for b in batches if deadline is None or b['created']+dt.timedelta(hours=offset)<deadline]
|
||||
return max(good,key=lambda b:b['batch']) if good else None
|
||||
|
||||
def reconstruct(groups,dates,n,thresholds,offset=8):
|
||||
t=len(dates);today=np.full((t,n),np.nan);counts=np.full((len(thresholds),t,n),-1,np.int8);full=np.zeros((t,n),bool)
|
||||
used=[]
|
||||
for i in range(t-1):
|
||||
deadline=dt.datetime.fromisoformat(str(dates[i+1])+'T09:25:00')
|
||||
cur=choose(groups.get(str(dates[i]),[]),deadline,offset)
|
||||
if cur is not None:today[i]=cur['values']
|
||||
if i<20:continue
|
||||
history=[]
|
||||
for day in dates[i-20:i]:
|
||||
b=choose(groups.get(str(day),[]),deadline,offset)
|
||||
history.append(np.full(n,np.nan) if b is None else b['values'])
|
||||
used.append({'signal_date':str(dates[i]),'history_date':str(day),'batch':None if b is None else b['batch'],'created_max':None if b is None else b['created'].isoformat()})
|
||||
history=np.array(history);full[i]=np.isfinite(history).all(0)
|
||||
for qi,q in enumerate(thresholds):counts[qi,i]=(history>=q).sum(0)
|
||||
return today,counts,full,used
|
||||
|
||||
def main():
|
||||
sys.addaudithook(offline);p=read(ROOT/'protocol.json');assert digest(ROOT/'protocol.json')==(ROOT/'protocol.sha256').read_text().split()[0]
|
||||
sources={}
|
||||
def track(path):sources[str(path.relative_to(ROOT.parent))]=digest(path);return path
|
||||
oldcov=read(track(PREVIOUS/'coverage.json'));panel=dict(np.load(track(PREVIOUS/'cache/panel.npz')))
|
||||
assert digest(PREVIOUS/'cache/panel.npz')==oldcov['panel_sha256']
|
||||
track(PREVIOUS/'protocol.json');track(ROOT.parent/'score_recurrence_20261029/engine.py');assert digest(ROOT/'engine.py')==digest(ROOT.parent/'score_recurrence_20261029/engine.py')
|
||||
dates=panel['dates'];t,n=panel['open'].shape;ci={c:i for i,c in enumerate(panel['codes'])};raw=defaultdict(list)
|
||||
for path in sorted((PREVIOUS/'raw').glob('2026*.json.gz')):
|
||||
d=read(track(path))['data'];assert d['ok']
|
||||
for row in d['rows']:
|
||||
if row['trade_date']<=str(dates[-1]):raw[(row['trade_date'],int(row['batch_no']))].append(row)
|
||||
groups=defaultdict(list)
|
||||
for (day,batch),rr in raw.items():
|
||||
v=np.full(n,np.nan);seen=set()
|
||||
for row in rr:
|
||||
c=row['stock_code'];c=c[2:]+'.'+c[:2] if c[:2] in ['SH','SZ','BJ'] else c
|
||||
assert c not in seen;seen.add(c);score=float(row['score']);assert 0<=score<=1;v[ci[c]]=score
|
||||
groups[day].append({'batch':batch,'values':v,'created':max(dt.datetime.fromisoformat(r['create_time']) for r in rr)})
|
||||
today,counts,full,used=reconstruct(groups,dates,n,p['thresholds']);rawtoday,rawcounts,rawfull,_=reconstruct(groups,dates,n,p['thresholds'],0)
|
||||
assert np.allclose(today[:-1],panel['asof'][:-1],equal_nan=True)
|
||||
latest=panel['heat'];strict=panel['asof'];window=(np.arange(t)>=20)&(dates<='2026-10-08')
|
||||
features={'window':window};group_keys=[];allcounts=[];daily=[];stats={}
|
||||
for field in p['scores']:
|
||||
value=today if field=='available' else strict if field=='strict' else latest
|
||||
complete=full if field=='available' else previous_counts(np.isfinite(value))==20
|
||||
base=panel['eligible']&complete&np.isfinite(value)&window[:,None]
|
||||
features['base_'+field]=base;features['today_'+field]=value;features['history_observed_'+field]=complete
|
||||
for qi,q in enumerate(p['thresholds']):
|
||||
group_keys.append(field+':'+str(q));allcounts.append(counts[qi] if field=='available' else previous_counts(value>=q).astype(np.int8))
|
||||
ds=dates[base.any(1)];stats[field]={'usable_days':len(ds),'first_signal':str(ds[0]) if len(ds) else None,'last_signal':str(ds[-1]) if len(ds) else None,'stock_days':int(base.sum()),'by_month':{m:int(np.sum(base.any(1)&np.char.startswith(dates,m))) for m in sorted(set(str(d)[:7] for d in dates))},'signal_dates':ds.tolist()}
|
||||
daily.extend({'date':str(d),'basis':field,'calendar_window':bool(window[i]),'current_eligible':int((panel['eligible'][i]&np.isfinite(value[i])).sum()),'common_eligible':int(base[i].sum())} for i,d in enumerate(dates))
|
||||
rawbase=panel['eligible']&rawfull&np.isfinite(rawtoday)&window[:,None]
|
||||
sensitivity={'base_differing_stock_days':int(np.sum(rawbase!=features['base_available'])),'configuration_mask_differences':0}
|
||||
for qi,q in enumerate(p['thresholds']):
|
||||
for k in range(21):
|
||||
a=features['base_available']&(counts[qi]>=k);b=rawbase&(rawcounts[qi]>=k)
|
||||
sensitivity['configuration_mask_differences']+=int(np.sum(a!=b))+int(np.sum((a&(today>=q))!=(b&(rawtoday>=q))))
|
||||
export=read(track(OLD/'raw/export.json'))['data']['index_daily'];small=read(track(OLD/'raw/csi2000.json'))['data']['daily']['rows'];stages=[];opens=[];rows=[]
|
||||
for key,symbol in p['phase_indices'].items():
|
||||
rr=small if key=='csi2000' else export[symbol]['rows'];r=regime(rr,dates.tolist());op={v['timestamp'][:10]:v['open'] for v in rr};aa=np.array([op[str(d)] for d in dates],float);assert np.isfinite(aa).all() and (aa>0).all()
|
||||
stages.append(r.stage.to_numpy());opens.append(aa);rows.extend({'date':str(d),'index':key,'open':float(aa[i]),'close':float(r.close.iloc[i]),'ma60':float(r.ma60.iloc[i]),'return20':float(r.return20.iloc[i]),'stage':int(r.stage.iloc[i])} for i,d in enumerate(dates))
|
||||
features.update(counts=allcounts,group_keys=group_keys,index_names=list(p['phase_indices']),index_opens=opens,stages=stages)
|
||||
np.savez_compressed(ROOT/'cache/features.npz',**features)
|
||||
pd.DataFrame(rows).to_csv(ROOT/'index_stages.csv',index=False);pd.DataFrame(daily).to_csv(ROOT/'daily_coverage.csv',index=False);pd.DataFrame(used).to_csv(ROOT/'batch_choices.csv',index=False)
|
||||
pd.DataFrame(configuration()).to_csv(ROOT/'configurations.csv',index=False)
|
||||
cov={'created_at_beijing':dt.datetime.now(dt.timezone(dt.timedelta(hours=8))).isoformat(),'source_sha256':sources,'features_sha256':digest(ROOT/'cache/features.npz'),'panel_shape':[t,n],'raw_heat_rows':oldcov['raw_heat_rows'],'raw_heat_first':oldcov['raw_heat_first'],'raw_heat_last':oldcov['raw_heat_last'],'first_calendar_signal':str(dates[window][0]),'last_calendar_signal':str(dates[window][-1]),'calendar_days':int(window.sum()),'basis_coverage':stats,'timestamp_sensitivity':sensitivity,'configurations':len(configuration()),'combinations':len(configuration())*10,'previous_quality':oldcov['quality'],'availability':'available只使用截至选股次日09:25已整批入库的观测;包含此前回填历史。strict逐日及时入库;latest含未来入库,仅诊断。'}
|
||||
dump(ROOT/'coverage.json',cov);print({k:v for k,v in cov.items() if k not in ['source_sha256','basis_coverage']});print(stats)
|
||||
if __name__=='__main__':main()
|
||||
|
|
@ -0,0 +1,118 @@
|
|||
{
|
||||
"version": "1.0",
|
||||
"frozen_at_beijing": "2026-10-29T09:57:06.078548+08:00",
|
||||
"question": "现有系统热度值的独立阈值、前20日次数与持有1至10日矩阵",
|
||||
"data_snapshot": "沿用2026-10-28热度原始批次及行情快照;新只读核对仅确认运行读源与最新日,不混入回测",
|
||||
"scores": [
|
||||
"available",
|
||||
"strict",
|
||||
"latest"
|
||||
],
|
||||
"thresholds": [
|
||||
0.5,
|
||||
0.6,
|
||||
0.7,
|
||||
0.75,
|
||||
0.8,
|
||||
0.85,
|
||||
0.9,
|
||||
0.95
|
||||
],
|
||||
"lookback": 20,
|
||||
"min_occurrences": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
17,
|
||||
18,
|
||||
19,
|
||||
20
|
||||
],
|
||||
"holds": [
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10
|
||||
],
|
||||
"count_definition": "信号日t之前的20个交易日[t-20,t-1]中,原始分数>=阈值的日数;不含t,不要求连续;一次交易日最多计1次",
|
||||
"modes": {
|
||||
"current": "只要求当天该分数>=阈值",
|
||||
"frequency": "只要求此前20日达标次数>=K,当天不额外要求该分数达阈值",
|
||||
"both": "此前20日达标次数>=K,且当天该分数>=阈值"
|
||||
},
|
||||
"eligibility": "沿用原热度当日沪深资格;当天与前20日均有相应热度记录;历史计数只看分数,缺失不作0;主网格不加涨跌幅门槛,隔离热度效应",
|
||||
"signal_window": "完整20日预热后至2026-10-08;所有H共同末日",
|
||||
"outcome_cutoff": "2026-10-23",
|
||||
"periods": [
|
||||
"full",
|
||||
"2026-08",
|
||||
"2026-09",
|
||||
"2026-10"
|
||||
],
|
||||
"fees_bps_per_side": [
|
||||
0,
|
||||
30,
|
||||
60
|
||||
],
|
||||
"execution": "信号后下一交易日开盘买;买后H交易日开盘卖,H=1遵循T+1;受阻卖出顺延,未退出不纳入完成事件,但账户保留;重复信号独立批次不展期",
|
||||
"phase_indices": {
|
||||
"csi300": "000300.SH",
|
||||
"csi500": "000905.SH",
|
||||
"csi1000": "000852.SH",
|
||||
"csi2000": "932000.CSI"
|
||||
},
|
||||
"phase_rule": "截至信号日:收盘>=MA60且20日涨幅>0为上涨;收盘<MA60且20日涨幅<0为下跌;其他震荡。仅分组,不依阶段停止交易;均线含当日",
|
||||
"index_isolation": "阶段分类指数与收益对照指数是独立选择。股票池始终全市场,不假装已按历史成分股筛选。同期指数使用每只股票实际买入和卖出日的开盘比,先按同批股票再按信号日等权;指数差额是价格收益对照,不是beta中性alpha或可交易ETF收益",
|
||||
"metrics": "每批先等权,再对信号日等权;展示毛收益、30/60bp净收益、股票胜率、日均入选、有效信号日、完成/受阻/未退出笔数、相对同日K=0对照、四指数同期毛超额。无样本为缺值,不画成0",
|
||||
"isolation_controls": "frequency的K=0是完整历史合格池;both的K=0和current完全一致;增量按两组都有完成事件的同日相减;分阶段与指数对照不混用为同一变量",
|
||||
"figure_support": "有效成交信号日>=20且完成交易>=100的格子正常着色,其余灰色并可查看实际数值;图上区分净收益和超额;同组图使用一致色标",
|
||||
"fixed_focus": {
|
||||
"threshold": 0.8,
|
||||
"occurrence": 5,
|
||||
"phase_primary": "csi300",
|
||||
"phase_sensitivity": "csi2000"
|
||||
},
|
||||
"accounts": "三个数据口径分别运行q=.8:current、frequency K5、both K5及共同池K0;H1/5/10、每边30/60bp,共72条;另独立复现旧热度基线与统计41日单日样本",
|
||||
"selection": "不训练、不择优;全部为已见历史描述,固定q=.8、K=5;任何稀疏高收益格仅观察",
|
||||
"limitations": [
|
||||
"热度回填与缺日导致20日完整窗口严重缩水",
|
||||
"数据仅沪深市场,非北交所",
|
||||
"热度生成公式和历史不可改写版本未获得,create_time时区未知",
|
||||
"整手最低佣金开盘容量未模拟",
|
||||
"已见多参数共享行情,不是独立样本外或显著性证据"
|
||||
],
|
||||
"outputs": [
|
||||
"可独立打开的矩阵浏览器",
|
||||
"可导出PNG热力图",
|
||||
"协议、数据摘要、完整压缩CSV与逐日复现缓存",
|
||||
"中文报告与测试审计"
|
||||
],
|
||||
"heat_source": "stock_fund_heat_scores.score;不以total_score或smart_score替换、不重算热度",
|
||||
"availability": {
|
||||
"available": "选股截止(次日09:25)时,每个历史日取已整批入库的最大批次,允许使用此前已入库的回填记录;当天也必须已入库。此为入库时间支持口径,不保证不可变历史。",
|
||||
"strict": "历史20个交易日每一天均须在其自身次日09:25前整批入库,彻底排除当日迟到与回填历史;与available作数据质量敏感性。",
|
||||
"latest": "每个历史日最大批次,忽略入库时间,仅作含回填诊断。"
|
||||
},
|
||||
"timestamp": "create_time时区语义尚未核实;沿用原值+8小时,并检查原值敏感性;批次最晚入库必须严格早于截止",
|
||||
"account_plan": "三个数据口径分别运行q=.8:current、frequency K5、both K5及共同池K0;H1/5/10、每边30/60bp,共72条;另独立复现旧热度基线与统计41日单日样本"
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
65976e8169cb806ed0ca4c54162644256401a91da6d6b17de907b78b3fcb7c0d protocol.json
|
||||
|
|
@ -0,0 +1,175 @@
|
|||
"""绘制热度矩阵并生成完整中文报告;所有切片均在冻结参数范围内。"""
|
||||
import sys
|
||||
from pathlib import Path
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
import matplotlib
|
||||
matplotlib.use('Agg')
|
||||
import matplotlib.pyplot as plt
|
||||
from matplotlib import font_manager
|
||||
from common import *
|
||||
BASIS={'available':'选股时已入库','strict':'逐日及时入库','latest':'含回填诊断'}
|
||||
MODE={'current':'仅当天达标','frequency':'仅历史频次','both':'历史频次且当天达标'}
|
||||
INDEX={'csi300':'沪深300','csi500':'中证500','csi1000':'中证1000','csi2000':'中证2000'}
|
||||
STAGE={99:'全部',-1:'下跌',0:'震荡',1:'上涨'}
|
||||
K=[0,1,3,5,8,10,15,20]
|
||||
def pct(v):return '—' if not np.isfinite(v) else f'{v*100:+.2f}%'
|
||||
def pp(v):return '—' if not np.isfinite(v) else f'{v*100:+.3f}'
|
||||
def table(headers,rows):return '\n'.join(['| '+' | '.join(headers)+' |','| '+' | '.join(['---']*len(headers))+' |']+['| '+' | '.join(map(str,r))+' |' for r in rows])
|
||||
def main():
|
||||
sys.addaudithook(offline);p=read(ROOT/'protocol.json');cov=read(ROOT/'coverage.json');g=pd.read_csv(ROOT/'grid.csv.gz');accounts=pd.read_csv(ROOT/'accounts.csv');conc=pd.read_csv(ROOT/'concentration.csv');comp=pd.read_csv(ROOT/'current_window_comparison.csv');unc=read(ROOT/'uncertainty.json');summary=read(ROOT/'result_summary.json')
|
||||
for path in ['/System/Library/Fonts/STHeiti Light.ttc','/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc']:
|
||||
if Path(path).exists():font_manager.fontManager.addfont(path);plt.rcParams['font.family']=font_manager.FontProperties(fname=path).get_name();break
|
||||
plt.rcParams.update({'axes.unicode_minus':False,'font.size':11,'savefig.dpi':150,'axes.spines.top':False,'axes.spines.right':False})
|
||||
def select(score='available',threshold=.8,mode='frequency',period='full',phase_index='all',stage=99,**extra):
|
||||
z=g
|
||||
for k,v in dict(score=score,threshold=threshold,mode=mode,period=period,phase_index=phase_index,stage=stage,**extra).items():
|
||||
if v is not None:z=z[z[k]==v]
|
||||
return z
|
||||
def row(**kwargs):return select(**kwargs).iloc[0]
|
||||
def heat(ax,z,y='k',x='hold',value='mean_net30',limit=3,title='',ylabel='此前20日达标次数下限 K',xlabel='持有交易日 H'):
|
||||
matrix=z.pivot(index=y,columns=x,values=value)*100;support=z.pivot(index=y,columns=x,values='supported');cmap=plt.get_cmap('RdBu_r').copy();cmap.set_bad('#e2e6eb');im=ax.imshow(matrix.where(support),cmap=cmap,vmin=-limit,vmax=limit,aspect='auto')
|
||||
ax.set_xticks(range(len(matrix.columns)),[f'{v:g}' for v in matrix.columns]);ax.set_yticks(range(len(matrix.index)),[f'{v:g}' for v in matrix.index]);ax.set_xlabel(xlabel);ax.set_ylabel(ylabel);ax.set_title(title)
|
||||
for i in range(len(matrix.index)):
|
||||
for j in range(len(matrix.columns)):
|
||||
v=matrix.iloc[i,j];ok=bool(support.iloc[i,j]);label='—' if not np.isfinite(v) else f'{v:+.2f}'+('' if ok else '*');ax.text(j,i,label,ha='center',va='center',fontsize=9,color='white' if ok and abs(v)>limit*.58 else '#293847')
|
||||
return im
|
||||
footer='灰格:不足20个有效信号日或100笔完成交易;*为实际值,—为无样本。前20日不含当天,未叠加涨跌幅。信号截至2026-10-08,行情截至10-23。'
|
||||
def save(fig,axes,im,name,title,label='平均每批净收益(%,每边30基点)'):
|
||||
fig.colorbar(im,ax=axes,label=label,shrink=.8);fig.suptitle(title,fontsize=16);fig.supxlabel(footer,fontsize=10);fig.savefig(ROOT/'figures'/name);plt.close(fig)
|
||||
fig,axes=plt.subplots(1,2,figsize=(17,7),layout='constrained')
|
||||
for ax,b in zip(axes,['available','latest']):im=heat(ax,select(score=b,threshold=None,mode='current'),y='threshold',limit=3,title=f'{BASIS[b]} · {cov["basis_coverage"][b]["usable_days"]}日',ylabel='当天热度下限')
|
||||
save(fig,axes,im,'热度阈值与持有期.png','单日热度阈值 × 持有期\n两种数据口径样本日期不同,不将差异全部归因于热度')
|
||||
fig,axes=plt.subplots(1,2,figsize=(17,8),layout='constrained')
|
||||
for ax,mode in zip(axes,['frequency','both']):im=heat(ax,select(mode=mode).query('k in @K'),limit=6,title=MODE[mode])
|
||||
save(fig,axes,im,'热度频次与持有期.png','固定系统热度≥0.80:次数 × 持有期\n选股时已入库口径,24个可用选股日;静态图8档次数,浏览器提供全部0至20次')
|
||||
fig,axes=plt.subplots(1,3,figsize=(22,7),layout='constrained')
|
||||
for ax,h in zip(axes,[1,5,10]):im=heat(ax,select(threshold=None,hold=h).query('k in @K'),y='threshold',x='k',limit=4,title=f'持有{h}个交易日',ylabel='热度下限',xlabel='此前20日达标次数下限 K')
|
||||
save(fig,axes,im,'热度阈值与频次.png','热度阈值 × 历史达标次数\n选股时已入库口径,仅历史频次,不额外要求当天达标')
|
||||
fig,axes=plt.subplots(2,3,figsize=(23,12),layout='constrained')
|
||||
for i,ix in enumerate(['csi300','csi2000']):
|
||||
for j,stage in enumerate([1,0,-1]):im=heat(axes[i,j],select(phase_index=ix,stage=stage).query('k in @K'),limit=4,title=f'{INDEX[ix]}划分 · {STAGE[stage]}')
|
||||
save(fig,axes,im,'热度市场阶段.png','固定热度≥0.80,按市场阶段隔离\n选股时已入库口径,各阶段样本均少于20日,不支持稳健阶段结论')
|
||||
fig,axes=plt.subplots(2,2,figsize=(17,12),layout='constrained')
|
||||
for ax,ix in zip(axes.flat,INDEX):im=heat(ax,select().query('k in @K'),value='excess_'+ix,limit=3,title='相对'+INDEX[ix]+'的同期毛收益差')
|
||||
save(fig,axes,im,'热度指数对照.png','固定热度≥0.80,仅历史频次,选股时已入库\n指数按各股票实际买卖日对齐,股票池仍为全市场','股票毛收益减同期指数价格收益(百分点)')
|
||||
# 时间覆盖图使用每个日历交易日,直观呈现回填与漏日对20日窗口的影响。
|
||||
daily=pd.read_csv(ROOT/'daily_coverage.csv');ds=sorted(daily.date.unique());fig,ax=plt.subplots(figsize=(17,3.8),layout='constrained');mat=np.array([daily[daily.basis==b].set_index('date').loc[ds].common_eligible.to_numpy()>0 for b in BASIS]);ax.imshow(mat,cmap=matplotlib.colors.ListedColormap(['#e2e6eb','#306b93']),aspect='auto',vmin=0,vmax=1);ax.set_yticks(range(3),[BASIS[b] for b in BASIS]);ticks=[i for i,d in enumerate(ds) if i==0 or d[:7]!=ds[i-1][:7]]+[len(ds)-1];ax.set_xticks(ticks,[ds[i] for i in ticks],rotation=30,ha='right');ax.set_title('完整20日历史可观察性:选股时已入库24日,逐日及时4日,含回填诊断71日');fig.supxlabel('蓝色表示该日有合格观察池;灰色不可形成完整信号。行情截至10月23日,统一信号截至10月8日。');fig.savefig(ROOT/'figures/热度样本覆盖.png');plt.close(fig)
|
||||
holdtable=table(['持有日','仅当天热度≥0.80','历史次数≥5','次数≥5每边60bp','次数≥5相对K0,百分点','次数≥5且当天达标*'],[[h,pct(row(mode='current',k=0,hold=h).mean_net30),pct(row(k=5,hold=h).mean_net30),pct(row(k=5,hold=h).mean_net60),pp(row(k=5,hold=h).delta_k0_net30),pct(row(mode='both',k=5,hold=h).mean_net30)] for h in range(1,11)])
|
||||
stage_table=table(['划分指数','阶段','有效日','平均每批净收益','相对K0,百分点'],[[INDEX[ix],STAGE[st],int(row(k=5,hold=5,phase_index=ix,stage=st).active_days),pct(row(k=5,hold=5,phase_index=ix,stage=st).mean_net30),pp(row(k=5,hold=5,phase_index=ix,stage=st).delta_k0_net30)] for ix in INDEX for st in [1,0,-1]])
|
||||
coverage_table=table(['数据口径','有效选股日','实际信号范围','8月 / 9月 / 10月','含义'],[[BASIS[b],v['usable_days'],v['first_signal']+'至'+v['last_signal'],' / '.join(str(v['by_month'][m]) for m in ['2026-08','2026-09','2026-10']),{'available':'历史回填已在本次选股截止前入库,可作为当时可查信息','strict':'历史每一天均要求及时入库;全部格子样本不足','latest':'含后来入库的历史分数,仅诊断'}[b]] for b,v in cov['basis_coverage'].items()])
|
||||
count_table=table(['数据口径','全部组合','达到最低样本量','30bp正收益格','60bp正收益格'],[[BASIS[b],v['combinations'],v['supported'],v['positive30_supported'],v['positive60_supported']] for b,v in summary.items()])
|
||||
ixrow=row(k=5,hold=5);indextable=table(['指数','同期毛收益差,百分点','30bp净收益减指数价格收益,百分点'],[[INDEX[ix],pp(ixrow['excess_'+ix]),pp(ixrow['excess_'+ix]+ixrow.mean_net30-ixrow.mean_gross)] for ix in INDEX])
|
||||
acrows=[]
|
||||
for mode,label in [('universe','共同全市场池'),('current','仅当天热度≥0.80'),('frequency','前20日次数≥5'),('both','次数≥5且当天达标')]:
|
||||
z=accounts[(accounts.name=='available_'+mode)&(accounts.hold==5)];a=z[z.fee_bps==30].iloc[0];b=z[z.fee_bps==60].iloc[0];acrows.append([label,pct(a['return']),pct(a.max_drawdown),pct(b['return']),int(a.open_lots)])
|
||||
accounttable=table(['规则(5日)','账户累计收益30bp','最大回撤','账户累计收益60bp','期末残仓笔数'],acrows)
|
||||
oldsingle=comp[(comp.condition=='仅当天完整样本')&(comp.hold==5)].iloc[0];u=next(x for x in unc if x['mode']=='frequency' and x['block_sessions']==10)
|
||||
report=f'''# 系统热度的反复活跃与持有期矩阵研究
|
||||
|
||||
核验日期:2026年10月29日。行情与退出估值截至2026年10月23日,所有持有期共用10月8日信号末日。仅做研究,未修改运行策略。
|
||||
|
||||
## 结果与入口
|
||||
|
||||
**[打开热度反复活跃矩阵浏览器](热度反复活跃矩阵浏览器.html)**。沿用上一轮的阈值×持有日、次数×持有日、阈值×次数三种矩阵;可切换历史数据口径、月份、市场阶段、阶段划分指数、同期收益对照指数及费用。点击格子查看同条件持有1至10日,支持PNG和CSV导出。浏览器依赖与数据内嵌,可离线打开。
|
||||
|
||||
**当前热度的“反复活跃”没有在本样本中形成稳定正收益。** 固定热度≥0.80、前20日达标至少5次,在选股时已入库的24日样本中,持有1至10日的平均每批净收益全部为负。5日为−1.42%,每边60基点为−2.01%,相对同日共同股票池减少1.416个百分点;相同完整历史池中仅当天热度≥0.80为−0.86%。这里是批次收益,不是账户累计收益。
|
||||
|
||||
更大的限制是可用历史太短。20日完整观察要求把原来单日可用的41日压缩为24日;彻底排除历史回填后仅剩4日。不同市场阶段更少,不能据局部红格推断某种行情中策略有效。
|
||||
|
||||

|
||||
|
||||
## 当前系统使用的热度
|
||||
|
||||
2026年10月29日09:58在155模拟系统只读核对,实际镜像为`pms:micro50-9e14f92`,空表前缀,仅挂载日志。运行代码的`heat_of`读取`stock_fund_heat_scores`最新交易日最大批次的`score`,ParamStore的`PMS_AUTO_HEAT_TH`为0.80。最新数据日期为10月28日、批次124,5,208只股票中341只达到0.80,约6.55%;分数范围0.0062至1.0。证据见[source_check.json](source_check.json)。
|
||||
|
||||
本次研究直接使用这个热度字段,不用total_score或smart_score替代,也没有根据当前横截面重新计算分位数。0.80是数值阈值,不固定等于全市场前20%。源算法的完整计算公式和历史版本仍未拿到,不能宣称已经验证了算法本身。PMS当前把热度用于策略挂载判断;本次“全市场选股、固定期限持有”是研究策略,并非复现PMS全部实盘动作。
|
||||
|
||||
最新只读核对不混入历史收益计算。为保持对照,回测继续使用10月28日导出的原热度批次和截至10月23日行情;10月28日的新热度尚未获得1至10日后续收益。
|
||||
|
||||
## 固定口径与变量隔离
|
||||
|
||||
协议于{p['frozen_at_beijing'][:16].replace('T',' ')}北京时间冻结,见[protocol.json](protocol.json)。共8个热度下限:0.50、0.60、0.70、0.75、0.80、0.85、0.90、0.95。每个阈值包含“仅当天”1组、“仅历史次数”21组和“次数且当天”21组,乘以10个持有期,得到3,440组参数。三个数据口径共10,320次参数评估、536,640行分组结果;这些并非独立统计样本。
|
||||
|
||||
历史窗口为信号日之前的20个交易日,不含当天。次数下限K取0至20,要求次数≥K,不要求连续;“超过5次”应选择K=6。历史每个交易日最多记一次,整批选版本,不拼接各批的股票。缺失热度不能算作没达标,必须排除不完整观察窗。[window_examples.csv](window_examples.csv)列出8月31日按股票代码顺序取的3个例子,未按后续收益挑选。
|
||||
|
||||
为隔离热度,本轮主矩阵不再加涨跌幅门槛,也不叠加其他分数。资格沿用原实验:沪深市场、上市至少120个交易日,排除历史ST和退市整理名称,剔除缺有效上市日期或名称等记录。历史频次只对原始热度计数,当天再检查股票资格,不把当前股票名单倒套到历史。
|
||||
|
||||
同一数据口径内,三种筛选方式都使用当天及此前20日可观察的相同股票日池。“仅历史次数”的K=0是这个共同池;“次数且当天”的K=0与“仅当天”完全一致。相对K=0、相对仅当天、相对共同池的增量均采用两种条件都有完成交易的同日配对差。主表均值先在信号日内等权,再对有完成交易的信号日等权;胜率按完成股票事件统计,两者权重不同。日均入选以所选时间及阶段的统一日历天数为分母,包含缺数据日。浓度表另给按24个可用日计算的入选数。
|
||||
|
||||
收盘信号后下一交易日开盘买,买入后H个交易日开盘卖,H=1仍遵循T+1。开盘触及涨跌停、零量或缺价格等按原引擎放弃买入;不能卖出时顺延,可能超过计划10日。重复信号独立成批,不延长旧批。未完成事件不计完成收益,但账户保留残仓并估值。费用每边0、30、60基点;展示线为至少20个有完成交易的信号日及100笔完成事件,未达标灰色、无样本为“—”。此线仅控制展示,不代表显著性。
|
||||
|
||||
## 数据可用性决定了能比较多少历史
|
||||
|
||||
{coverage_table}
|
||||
|
||||
原始快照636,116行,交易日期4月27日至10月27日。4月27日至8月3日的分数在8月4日集中入库。对8月4日之后的选股,已经入库的早期分数可以作为历史观测,所以“选股时已入库”不把它们全部丢掉;但也不将其用于入库之前的选股。每个信号时点重建历史20日的可用最大批次,保留[batch_choices.csv](batch_choices.csv)审计轨迹。
|
||||
|
||||
`create_time`时区语义仍未知,主口径沿用原值加8小时,整批最晚时间须早于选股次日09:25;以原值计算的敏感性检查,在本共同信号窗口中股票日与所有频次条件的差异均为0。这并不证明源时间戳不可被改写。
|
||||
|
||||
9月7日全日缺热度,9月8日至10月8日的20日窗口都包含缺日,因此不形成新批次。严格逐日及时口径从8月4日预热20日后,到9月缺日前只剩9月1日至4日。10月没有完整可用窗口,浏览器会显示缺值。没有2025年热度历史,不能沿用评分实验的2025/2026年度验证。
|
||||
|
||||

|
||||
|
||||
## 固定0.80,看持有1至10日
|
||||
|
||||
以下均为“选股时已入库”口径。仅当天和仅历史次数K≥5都有24个有效信号日,分别完成4,859笔和558笔。仅历史次数涉及96只不同股票,每个有效日完成中位数21只;按24个可用日计算日均入选23.42只。重复股票日不能当558个独立时间样本。
|
||||
|
||||
{holdtable}
|
||||
|
||||
带星的“次数且当天”只有13个有效日、28笔完成事件,22只股票,未满足展示门槛;不能因−5.78%等数值很大就认定高频热度必然反转。热度≥0.80、次数≥10在主口径没有样本,≥15或20同样无样本,这些格子不是0收益。
|
||||
|
||||

|
||||
|
||||
仅当天热度≥0.80、不要求完整20日的原单日观察池为41日,5日平均批次净收益{pct(oldsingle.mean_net30)};加入统一历史观察要求后,单日基线变为24日、−0.86%。样本改变本身影响收益,不能把这个差异归因于频次。完整比较在[current_window_comparison.csv](current_window_comparison.csv)。原先“热度≥0.80、涨幅[0%,5%)、5日”的旧基线另行精确复现,账户仍为−9.1838%,不是拿新股票池冒充旧实验。
|
||||
|
||||
固定K≥5、H5的循环分块自助法:10日块下平均净收益95%区间为[{pct(u['mean_net30_95pct'][0])}, {pct(u['mean_net30_95pct'][1])}],同日K0增量区间为[{pp(u['increment_vs_control_95pct'][0])}, {pp(u['increment_vs_control_95pct'][1])}]个百分点。5日块下净收益区间跨0。仅24日且重叠持有,块长变化会影响结果,不能以一条区间包装成充分统计结论。详见[uncertainty.json](uncertainty.json)。
|
||||
|
||||
## 全部参数与费用
|
||||
|
||||
{count_table}
|
||||
|
||||
主口径38个30基点正收益格包含16个重复的K=0共同池格,即同一收益被8个热度门槛重复展示。其余22格也共享日期和股票,并非22次独立成功;没有任何当前热度筛选组合被升格为新的独立样本外候选。主口径达标格的最高平均每批净收益仅约+0.317%,费用每边提高到60基点后所有达标格转为非正。含回填口径虽然留下9个60基点正收益格,但其中存在当时不可取得的历史数据,不能作为交易依据。
|
||||
|
||||

|
||||
|
||||
## 市场阶段与指数对照
|
||||
|
||||
阶段依据为信号日及以前:指数收盘≥60日均线且20日涨幅>0为上涨,收盘<60日均线且20日涨幅<0为下跌,其余震荡。四个指数分别分类;股票池始终全市场,没有使用历史指数成分股筛选。选哪个指数划分阶段,与选哪个指数作收益对照是两个独立开关。
|
||||
|
||||
固定热度0.80、前20日至少5次、持有5日:
|
||||
|
||||
{stage_table}
|
||||
|
||||
每种阶段都不足20个有效日。按中证2000划分的下跌阶段显示+1.66%,但仅5日,且相对同日共同池减少0.458个百分点;这说明局部正收益不能自动归因于热度选股。
|
||||
|
||||

|
||||
|
||||
同期指数以各股票实际买入和实际卖出日的开盘计算;卖出受阻时也使用延后的实际日。先在同批股票中等权,再按信号日等权,不能用一段指数区间涨幅直接相减。
|
||||
|
||||
{indextable}
|
||||
|
||||
这些是价格收益差,未做市场风险回归、风险敞口中性化或ETF可交易收益建模。
|
||||
|
||||

|
||||
|
||||
## 固定账户结果
|
||||
|
||||
协议事先固定三个数据口径、热度0.80的三种规则及共同池,H=1/5/10、每边30/60基点,共72条账户。每日预算为前日净资产/H,先卖后买且不超过现金,买入失败份额保留现金。以下为选股时已入库、H5账户;10月8日后仅处理退出,最终估值截至10月23日。
|
||||
|
||||
{accounttable}
|
||||
|
||||
账户累计收益与每批收益不是同一指标。采用可分割复权单位,未模拟整手、最低佣金和真实开盘容量;历史上市、ST、退市覆盖仍有局限,原缓存78只缺有效上市日期被排除。完整账户见[accounts.csv](accounts.csv)。
|
||||
|
||||
## 验证与复现
|
||||
|
||||
开发机使用12项内存隔离测试,验证20日边界、排除当天、缺分处理、整批截止、迟到回填和后续修订不可提前使用、T+1及受阻买卖。真实快照独立核对2,400个历史窗口、36项实际买卖日指数比较、三种规则的逐笔现金持仓与事件收益;72账户现金守恒、36账户截断前缀一致;H1/5/10旧事件基线和H5旧账户精确复现。四指数阶段加总、费用顺序和无样本缺值另作整表检查。
|
||||
|
||||
浏览器用本机独立无头Chrome、阻断外部请求验收:数值与CSV一致,点击切换1至10日明细、三种矩阵、月份、阶段和对照指数、严格口径灰格、无样本缺值、CSV/PNG导出以及430像素视口。图已检查标签、单位、色标与样本提示。结果见[audit.json](audit.json)、[calculation_checks.json](calculation_checks.json)、[browser_checks.json](browser_checks.json)与[manifest.json](manifest.json)。
|
||||
|
||||
从仓库根目录使用`/tmp/micro-calibration-venv/bin/python`或安装了[依赖版本](requirements-research.txt)的环境,依次运行本目录`prepare.py`、`calibrate.py`,再经`scripts/unit_test_guard.py`运行`test_recurrence.py`及`audit.py`,随后运行`diagnostics.py`、`build_dashboard.py`、`report.py`、`browser_check.py`、`finalize.py`。原缓存不入Git,路径与SHA-256见[coverage.json](coverage.json)。不需要重新执行源表核对来复现收益。
|
||||
|
||||
本轮没有部署、参数修改、真实委托或账本变化。当前证据支持继续观察数据完整性,尚不足以给出可上线的热度频次参数;研究结果不会自动写入ParamStore。
|
||||
'''
|
||||
(ROOT/'热度反复活跃与持有期矩阵研究.md').write_text(report);print('报告与6张图完成')
|
||||
if __name__=='__main__':main()
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
numpy==2.3.5
|
||||
pandas==2.2.3
|
||||
matplotlib==3.11.2
|
||||
# 仅本地浏览器核验使用;计算和HTML浏览不需要此依赖。
|
||||
playwright==1.64.1
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"available": {
|
||||
"combinations": 3440,
|
||||
"supported": 1240,
|
||||
"positive30_supported": 38,
|
||||
"positive60_supported": 0,
|
||||
"available_net_min": -0.0583788086588249,
|
||||
"available_net_max": 0.0031690270120403
|
||||
},
|
||||
"strict": {
|
||||
"combinations": 3440,
|
||||
"supported": 0,
|
||||
"positive30_supported": 0,
|
||||
"positive60_supported": 0,
|
||||
"available_net_min": null,
|
||||
"available_net_max": null
|
||||
},
|
||||
"latest": {
|
||||
"combinations": 3440,
|
||||
"supported": 1580,
|
||||
"positive30_supported": 20,
|
||||
"positive60_supported": 9,
|
||||
"available_net_min": -0.1017358088434753,
|
||||
"available_net_max": 0.0259021425948489
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
{
|
||||
"checked_at_beijing": "2026-10-29T09:58:51.541191+08:00",
|
||||
"host": "155",
|
||||
"prefix": "",
|
||||
"data": {
|
||||
"latest_date": {
|
||||
"ok": true,
|
||||
"rows": [
|
||||
{
|
||||
"trade_date": "2026-10-28"
|
||||
}
|
||||
],
|
||||
"seconds": 0.266
|
||||
},
|
||||
"latest_batch": {
|
||||
"ok": true,
|
||||
"rows": [
|
||||
{
|
||||
"batch": 124
|
||||
}
|
||||
],
|
||||
"seconds": 0.019
|
||||
},
|
||||
"latest_summary": {
|
||||
"ok": true,
|
||||
"rows": [
|
||||
{
|
||||
"rows_count": 5208,
|
||||
"min_score": 0.0062,
|
||||
"max_score": 1.0,
|
||||
"above_08": 341.0,
|
||||
"first_create": "2026-10-28T13:40:02",
|
||||
"last_create": "2026-10-28T13:40:09"
|
||||
}
|
||||
],
|
||||
"seconds": 0.035
|
||||
},
|
||||
"heat_threshold_paramstore": 0.8,
|
||||
"heat_of_source": "def heat_of(dot_codes):\n \"\"\"({点式: score}, meta)。meta.stale=True 表示热度表停更, 调用方按热度不可用处理。\"\"\"\n meta = {\"td\": None, \"batch\": None, \"stale\": True}\n if not dot_codes:\n return {}, meta\n r = fetch_one(\"SELECT MAX(trade_date) AS td FROM stock_fund_heat_scores\")\n tdd = (r or {}).get(\"td\")\n if tdd is None:\n return {}, meta\n r2 = fetch_one(\"SELECT MAX(batch_no) AS b FROM stock_fund_heat_scores \"\n \"WHERE trade_date = :td\", {\"td\": tdd})\n rev = _variants(dot_codes)\n p = {\"td\": tdd, \"b\": (r2 or {}).get(\"b\")}\n rows = fetch_all(\n \"SELECT stock_code, score FROM stock_fund_heat_scores \"\n f\"WHERE trade_date = :td AND batch_no = :b AND stock_code IN ({_in(list(rev), 'c', p)})\",\n p)\n out = {}\n for x in rows:\n dot = rev.get(str(x.get(\"stock_code\") or \"\").strip())\n v = _f(x.get(\"score\"))\n if dot and v is not None:\n out[dot] = v\n age = _age_days_of(_ymd_of(tdd), td.ymd())\n meta.update({\"td\": str(tdd), \"batch\": (r2 or {}).get(\"b\"),\n \"stale\": age is None or age > HEAT_MAX_AGE_DAYS, \"age_days\": age})\n return out, meta\n",
|
||||
"heat_of_sha256": "52397714c5e7c4a16d23a852e0fe989edd571469a9b62502b6ad8b7ced3d9d06"
|
||||
},
|
||||
"instance": {
|
||||
"host": "155",
|
||||
"prefix": "",
|
||||
"source_image": "pms:micro50-9e14f92",
|
||||
"image_id": "sha256:63c6a88de1f168b29cfe7715b798c2bb19ebe4794651f8cb598234fbeb36adbd",
|
||||
"role": "readonly-research",
|
||||
"mounts": [
|
||||
{
|
||||
"destination": "/app/logs",
|
||||
"type": "bind"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
"""仅内存数据,必须经unit_test_guard隔离运行。"""
|
||||
import unittest
|
||||
import numpy as np
|
||||
from common import previous_counts,aggregate,mask_for,regime
|
||||
from engine import account,future_exits
|
||||
from prepare import choose,reconstruct
|
||||
import datetime as dt
|
||||
class RecurrenceTests(unittest.TestCase):
|
||||
def test_whole_batch_requires_completion_before_deadline(self):
|
||||
end=dt.datetime(2026,8,5,9,25)
|
||||
batches=[{'batch':1,'created':end-dt.timedelta(hours=9)}, {'batch':2,'created':end-dt.timedelta(hours=8)}]
|
||||
self.assertEqual(choose(batches,end,8)['batch'],1)
|
||||
self.assertEqual(choose(batches,None)['batch'],2)
|
||||
def test_backfill_available_only_after_insert(self):
|
||||
dates=np.array([(dt.date(2026,1,1)+dt.timedelta(days=i)).isoformat() for i in range(24)])
|
||||
groups={str(day):[{'batch':i,'created':dt.datetime(2026,1,22,2,0),'values':np.array([.9])}] for i,day in enumerate(dates)}
|
||||
today,counts,full,_=reconstruct(groups,dates,1,[.8],8)
|
||||
self.assertFalse(full[20,0]);self.assertTrue(full[21,0]);self.assertEqual(counts[0,21,0],20)
|
||||
def test_historical_revision_never_reaches_earlier_signal(self):
|
||||
dates=np.array([(dt.date(2026,1,1)+dt.timedelta(days=i)).isoformat() for i in range(25)])
|
||||
groups={str(day):[{'batch':i,'created':dt.datetime(2025,12,31),'values':np.array([.9])}] for i,day in enumerate(dates)}
|
||||
before=reconstruct(groups,dates,1,[.8],8)
|
||||
groups[str(dates[5])].append({'batch':99,'created':dt.datetime(2026,1,24,2),'values':np.array([.1])})
|
||||
after=reconstruct(groups,dates,1,[.8],8)
|
||||
self.assertTrue(np.array_equal(before[1][:,:22],after[1][:,:22]));self.assertEqual(after[1][0,22,0],20);self.assertEqual(after[1][0,23,0],19)
|
||||
def test_excludes_signal_day(self):
|
||||
hits=np.zeros((24,1),bool);hits[0]=True;hits[20]=True
|
||||
c=previous_counts(hits);self.assertEqual(c[19,0],-1);self.assertEqual(c[20,0],1);self.assertEqual(c[21,0],1)
|
||||
hits[20]=False;self.assertEqual(previous_counts(hits)[20,0],1)
|
||||
def test_window_rolls_exactly_twenty(self):
|
||||
hits=np.zeros((43,1),bool);hits[1:21]=True;c=previous_counts(hits)
|
||||
self.assertEqual(c[21,0],20);self.assertEqual(c[22,0],19);self.assertEqual(c[41,0],0)
|
||||
def test_missing_observation_is_not_a_failed_signal(self):
|
||||
v=np.full((42,1),.9);v[20]=np.nan;observed=previous_counts(np.isfinite(v))==20
|
||||
self.assertTrue(observed[20,0]);self.assertFalse(observed[21,0]);self.assertFalse(observed[40,0]);self.assertTrue(observed[41,0])
|
||||
def test_today_gate_is_independent(self):
|
||||
panel={'smart':np.array([[.2,.9]])};f={'base_smart':np.ones((1,2),bool),'counts':np.array([[[5,4]]]),'group_keys':np.array(['smart:0.8'])}
|
||||
c={'score':'smart','threshold':.8,'k':5,'mode':'frequency'};self.assertEqual(mask_for(panel,f,c).tolist(),[[True,False]])
|
||||
c['mode']='both';self.assertEqual(mask_for(panel,f,c).tolist(),[[False,False]])
|
||||
c['mode']='current';self.assertEqual(mask_for(panel,f,c).tolist(),[[False,True]])
|
||||
def test_bin_accumulation_and_boundary(self):
|
||||
counts=np.array([[0,1,5,20]]);today=np.array([[False,True,False,True]]);ids=today.astype(int)*21+counts
|
||||
result=aggregate(ids,np.ones(ids.shape,bool),None,1)
|
||||
for k in range(21):self.assertEqual(result[0,k+1],(counts>=k).sum());self.assertEqual(result[0,k+22],((counts>=k)&today).sum())
|
||||
self.assertEqual(result[0,0],result[0,22]);self.assertEqual(result[0,1],4)
|
||||
def test_future_scores_do_not_change_past_counts(self):
|
||||
rng=np.random.default_rng(8);hits=rng.random((90,4))>.5;a=previous_counts(hits);hits[60:]=False
|
||||
self.assertTrue(np.array_equal(a[:61],previous_counts(hits)[:61]));self.assertTrue(np.array_equal(a[:60],previous_counts(hits[:60])))
|
||||
def test_phase_prefix_uses_no_future(self):
|
||||
import pandas as pd
|
||||
ds=pd.bdate_range('2024-01-01',periods=100).strftime('%Y-%m-%d').tolist();rows=[{'timestamp':d,'close':100+i} for i,d in enumerate(ds)]
|
||||
self.assertTrue(regime(rows,ds[60:80]).equals(regime(rows[:80],ds[60:80])))
|
||||
def test_t_plus_one_fee_and_delayed_sell(self):
|
||||
t=8;p={k:np.full((t,1),10.) for k in ['open','close','mark']};p.update(can_buy=np.ones((t,1),bool),can_sell=np.ones((t,1),bool),dates=np.arange(t).astype(str))
|
||||
p['can_sell'][2:4]=False;p['open'][4]=12;m=np.zeros((t,1),bool);m[0]=True
|
||||
a=account(p,m,1,.003,detail=True);ex,gr=future_exits(p,1)
|
||||
self.assertEqual([(x['day'],x['side']) for x in a['journal']],[(1,'buy'),(4,'sell')]);self.assertEqual(ex[0,0],4)
|
||||
self.assertAlmostEqual(a['summary']['return'],1.2*.997/1.003-1);self.assertAlmostEqual(gr[0,0],1.2)
|
||||
def test_blocked_buy_retains_allocation(self):
|
||||
t=8;p={k:np.full((t,2),10.) for k in ['open','close','mark']};p.update(can_buy=np.ones((t,2),bool),can_sell=np.ones((t,2),bool),dates=np.arange(t).astype(str))
|
||||
p['can_buy'][1,0]=False;m=np.zeros((t,2),bool);m[0]=True;a=account(p,m,1,0)
|
||||
self.assertAlmostEqual(a['daily'][1]['cash'],.5)
|
||||
if __name__=='__main__':unittest.main()
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
[
|
||||
{
|
||||
"mode": "current",
|
||||
"hold": 5,
|
||||
"block_sessions": 5,
|
||||
"observations": 24,
|
||||
"mean_net30_95pct": [
|
||||
-0.027631590769949827,
|
||||
0.009743813438661087
|
||||
],
|
||||
"increment_vs_control_95pct": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"note": "24日短样本循环分块自助法,描述不确定性,不据此认定显著或独立样本外"
|
||||
},
|
||||
{
|
||||
"mode": "current",
|
||||
"hold": 5,
|
||||
"block_sessions": 10,
|
||||
"observations": 24,
|
||||
"mean_net30_95pct": [
|
||||
-0.026372005621070685,
|
||||
0.005967630256626308
|
||||
],
|
||||
"increment_vs_control_95pct": [
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"note": "24日短样本循环分块自助法,描述不确定性,不据此认定显著或独立样本外"
|
||||
},
|
||||
{
|
||||
"mode": "frequency",
|
||||
"hold": 5,
|
||||
"block_sessions": 5,
|
||||
"observations": 24,
|
||||
"mean_net30_95pct": [
|
||||
-0.03150570023191764,
|
||||
0.0016684446982918703
|
||||
],
|
||||
"increment_vs_control_95pct": [
|
||||
-0.02346724971751167,
|
||||
-0.005280209079754156
|
||||
],
|
||||
"note": "24日短样本循环分块自助法,描述不确定性,不据此认定显著或独立样本外"
|
||||
},
|
||||
{
|
||||
"mode": "frequency",
|
||||
"hold": 5,
|
||||
"block_sessions": 10,
|
||||
"observations": 24,
|
||||
"mean_net30_95pct": [
|
||||
-0.02707311252076009,
|
||||
-0.002288634296886361
|
||||
],
|
||||
"increment_vs_control_95pct": [
|
||||
-0.020661623513088367,
|
||||
-0.006874888997726343
|
||||
],
|
||||
"note": "24日短样本循环分块自助法,描述不确定性,不据此认定显著或独立样本外"
|
||||
},
|
||||
{
|
||||
"mode": "both",
|
||||
"hold": 5,
|
||||
"block_sessions": 5,
|
||||
"observations": 24,
|
||||
"mean_net30_95pct": [
|
||||
-0.09527520026730453,
|
||||
-0.026633353502968773
|
||||
],
|
||||
"increment_vs_control_95pct": [
|
||||
-0.06789239049651978,
|
||||
-0.02078900595360437
|
||||
],
|
||||
"note": "24日短样本循环分块自助法,描述不确定性,不据此认定显著或独立样本外"
|
||||
},
|
||||
{
|
||||
"mode": "both",
|
||||
"hold": 5,
|
||||
"block_sessions": 10,
|
||||
"observations": 24,
|
||||
"mean_net30_95pct": [
|
||||
-0.08876315445943778,
|
||||
-0.0312206370607569
|
||||
],
|
||||
"increment_vs_control_95pct": [
|
||||
-0.06584671924500783,
|
||||
-0.02775829909888701
|
||||
],
|
||||
"note": "24日短样本循环分块自助法,描述不确定性,不据此认定显著或独立样本外"
|
||||
}
|
||||
]
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2024 Chart.js Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# 本地绘图依赖
|
||||
|
||||
Chart.js固定为4.5.1,用于可离线打开的研究热力图。源文件在构建浏览器时内嵌,不从用户浏览器请求远程资源。
|
||||
|
||||
- 来源:https://cdn.jsdelivr.net/npm/chart.js@4.5.1/dist/chart.umd.min.js
|
||||
- SHA-384:`jb8JQMbMoBUzgWatfe6COACi2ljcDdZQ2OxczGA3bGNeWe+6DChMTBJemed7ZnvJ`
|
||||
- 构建程序验证上述摘要。保留原版权头,完整许可证见[LICENSE-Chart.js.md](LICENSE-Chart.js.md)。
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,61 @@
|
|||
signal_date,stock,historical_date,heat,hit_ge_0_8,prior20_hits,signal_day_score
|
||||
2026-08-31,000017.SZ,2026-08-03,0.4962,False,5,0.1838
|
||||
2026-08-31,000017.SZ,2026-08-04,0.4999,False,5,0.1838
|
||||
2026-08-31,000017.SZ,2026-08-05,0.569,False,5,0.1838
|
||||
2026-08-31,000017.SZ,2026-08-06,0.5043,False,5,0.1838
|
||||
2026-08-31,000017.SZ,2026-08-07,0.5324,False,5,0.1838
|
||||
2026-08-31,000017.SZ,2026-08-10,0.5505,False,5,0.1838
|
||||
2026-08-31,000017.SZ,2026-08-11,0.4855,False,5,0.1838
|
||||
2026-08-31,000017.SZ,2026-08-12,0.4665,False,5,0.1838
|
||||
2026-08-31,000017.SZ,2026-08-13,0.4441,False,5,0.1838
|
||||
2026-08-31,000017.SZ,2026-08-14,0.5047,False,5,0.1838
|
||||
2026-08-31,000017.SZ,2026-08-17,0.4988,False,5,0.1838
|
||||
2026-08-31,000017.SZ,2026-08-18,0.495,False,5,0.1838
|
||||
2026-08-31,000017.SZ,2026-08-19,0.4917,False,5,0.1838
|
||||
2026-08-31,000017.SZ,2026-08-20,0.8925,True,5,0.1838
|
||||
2026-08-31,000017.SZ,2026-08-21,0.9719,True,5,0.1838
|
||||
2026-08-31,000017.SZ,2026-08-24,0.5311,False,5,0.1838
|
||||
2026-08-31,000017.SZ,2026-08-25,0.5192,False,5,0.1838
|
||||
2026-08-31,000017.SZ,2026-08-26,0.9745,True,5,0.1838
|
||||
2026-08-31,000017.SZ,2026-08-27,0.904,True,5,0.1838
|
||||
2026-08-31,000017.SZ,2026-08-28,0.8672,True,5,0.1838
|
||||
2026-08-31,002437.SZ,2026-08-03,0.5091,False,5,0.256
|
||||
2026-08-31,002437.SZ,2026-08-04,0.6036,False,5,0.256
|
||||
2026-08-31,002437.SZ,2026-08-05,0.4054,False,5,0.256
|
||||
2026-08-31,002437.SZ,2026-08-06,0.3853,False,5,0.256
|
||||
2026-08-31,002437.SZ,2026-08-07,1.0,True,5,0.256
|
||||
2026-08-31,002437.SZ,2026-08-10,0.9687,True,5,0.256
|
||||
2026-08-31,002437.SZ,2026-08-11,0.9769,True,5,0.256
|
||||
2026-08-31,002437.SZ,2026-08-12,1.0,True,5,0.256
|
||||
2026-08-31,002437.SZ,2026-08-13,0.9674,True,5,0.256
|
||||
2026-08-31,002437.SZ,2026-08-14,0.6365,False,5,0.256
|
||||
2026-08-31,002437.SZ,2026-08-17,0.7556,False,5,0.256
|
||||
2026-08-31,002437.SZ,2026-08-18,0.286,False,5,0.256
|
||||
2026-08-31,002437.SZ,2026-08-19,0.4309,False,5,0.256
|
||||
2026-08-31,002437.SZ,2026-08-20,0.6564,False,5,0.256
|
||||
2026-08-31,002437.SZ,2026-08-21,0.3602,False,5,0.256
|
||||
2026-08-31,002437.SZ,2026-08-24,0.3283,False,5,0.256
|
||||
2026-08-31,002437.SZ,2026-08-25,0.6843,False,5,0.256
|
||||
2026-08-31,002437.SZ,2026-08-26,0.4667,False,5,0.256
|
||||
2026-08-31,002437.SZ,2026-08-27,0.7009,False,5,0.256
|
||||
2026-08-31,002437.SZ,2026-08-28,0.6758,False,5,0.256
|
||||
2026-08-31,003040.SZ,2026-08-03,0.5007,False,5,0.1316
|
||||
2026-08-31,003040.SZ,2026-08-04,0.4929,False,5,0.1316
|
||||
2026-08-31,003040.SZ,2026-08-05,0.5126,False,5,0.1316
|
||||
2026-08-31,003040.SZ,2026-08-06,0.9207,True,5,0.1316
|
||||
2026-08-31,003040.SZ,2026-08-07,0.4057,False,5,0.1316
|
||||
2026-08-31,003040.SZ,2026-08-10,0.3445,False,5,0.1316
|
||||
2026-08-31,003040.SZ,2026-08-11,0.4995,False,5,0.1316
|
||||
2026-08-31,003040.SZ,2026-08-12,0.4039,False,5,0.1316
|
||||
2026-08-31,003040.SZ,2026-08-13,0.4891,False,5,0.1316
|
||||
2026-08-31,003040.SZ,2026-08-14,0.4842,False,5,0.1316
|
||||
2026-08-31,003040.SZ,2026-08-17,0.5005,False,5,0.1316
|
||||
2026-08-31,003040.SZ,2026-08-18,0.4943,False,5,0.1316
|
||||
2026-08-31,003040.SZ,2026-08-19,0.4859,False,5,0.1316
|
||||
2026-08-31,003040.SZ,2026-08-20,0.7011,False,5,0.1316
|
||||
2026-08-31,003040.SZ,2026-08-21,0.8736,True,5,0.1316
|
||||
2026-08-31,003040.SZ,2026-08-24,0.8835,True,5,0.1316
|
||||
2026-08-31,003040.SZ,2026-08-25,0.5669,False,5,0.1316
|
||||
2026-08-31,003040.SZ,2026-08-26,0.8057,True,5,0.1316
|
||||
2026-08-31,003040.SZ,2026-08-27,0.9611,True,5,0.1316
|
||||
2026-08-31,003040.SZ,2026-08-28,0.298,False,5,0.1316
|
||||
|
|
|
@ -0,0 +1,147 @@
|
|||
# 系统热度的反复活跃与持有期矩阵研究
|
||||
|
||||
核验日期:2026年10月29日。行情与退出估值截至2026年10月23日,所有持有期共用10月8日信号末日。仅做研究,未修改运行策略。
|
||||
|
||||
## 结果与入口
|
||||
|
||||
**[打开热度反复活跃矩阵浏览器](热度反复活跃矩阵浏览器.html)**。沿用上一轮的阈值×持有日、次数×持有日、阈值×次数三种矩阵;可切换历史数据口径、月份、市场阶段、阶段划分指数、同期收益对照指数及费用。点击格子查看同条件持有1至10日,支持PNG和CSV导出。浏览器依赖与数据内嵌,可离线打开。
|
||||
|
||||
**当前热度的“反复活跃”没有在本样本中形成稳定正收益。** 固定热度≥0.80、前20日达标至少5次,在选股时已入库的24日样本中,持有1至10日的平均每批净收益全部为负。5日为−1.42%,每边60基点为−2.01%,相对同日共同股票池减少1.416个百分点;相同完整历史池中仅当天热度≥0.80为−0.86%。这里是批次收益,不是账户累计收益。
|
||||
|
||||
更大的限制是可用历史太短。20日完整观察要求把原来单日可用的41日压缩为24日;彻底排除历史回填后仅剩4日。不同市场阶段更少,不能据局部红格推断某种行情中策略有效。
|
||||
|
||||

|
||||
|
||||
## 当前系统使用的热度
|
||||
|
||||
2026年10月29日09:58在155模拟系统只读核对,实际镜像为`pms:micro50-9e14f92`,空表前缀,仅挂载日志。运行代码的`heat_of`读取`stock_fund_heat_scores`最新交易日最大批次的`score`,ParamStore的`PMS_AUTO_HEAT_TH`为0.80。最新数据日期为10月28日、批次124,5,208只股票中341只达到0.80,约6.55%;分数范围0.0062至1.0。证据见[source_check.json](source_check.json)。
|
||||
|
||||
本次研究直接使用这个热度字段,不用total_score或smart_score替代,也没有根据当前横截面重新计算分位数。0.80是数值阈值,不固定等于全市场前20%。源算法的完整计算公式和历史版本仍未拿到,不能宣称已经验证了算法本身。PMS当前把热度用于策略挂载判断;本次“全市场选股、固定期限持有”是研究策略,并非复现PMS全部实盘动作。
|
||||
|
||||
最新只读核对不混入历史收益计算。为保持对照,回测继续使用10月28日导出的原热度批次和截至10月23日行情;10月28日的新热度尚未获得1至10日后续收益。
|
||||
|
||||
## 固定口径与变量隔离
|
||||
|
||||
协议于2026-10-29 09:57北京时间冻结,见[protocol.json](protocol.json)。共8个热度下限:0.50、0.60、0.70、0.75、0.80、0.85、0.90、0.95。每个阈值包含“仅当天”1组、“仅历史次数”21组和“次数且当天”21组,乘以10个持有期,得到3,440组参数。三个数据口径共10,320次参数评估、536,640行分组结果;这些并非独立统计样本。
|
||||
|
||||
历史窗口为信号日之前的20个交易日,不含当天。次数下限K取0至20,要求次数≥K,不要求连续;“超过5次”应选择K=6。历史每个交易日最多记一次,整批选版本,不拼接各批的股票。缺失热度不能算作没达标,必须排除不完整观察窗。[window_examples.csv](window_examples.csv)列出8月31日按股票代码顺序取的3个例子,未按后续收益挑选。
|
||||
|
||||
为隔离热度,本轮主矩阵不再加涨跌幅门槛,也不叠加其他分数。资格沿用原实验:沪深市场、上市至少120个交易日,排除历史ST和退市整理名称,剔除缺有效上市日期或名称等记录。历史频次只对原始热度计数,当天再检查股票资格,不把当前股票名单倒套到历史。
|
||||
|
||||
同一数据口径内,三种筛选方式都使用当天及此前20日可观察的相同股票日池。“仅历史次数”的K=0是这个共同池;“次数且当天”的K=0与“仅当天”完全一致。相对K=0、相对仅当天、相对共同池的增量均采用两种条件都有完成交易的同日配对差。主表均值先在信号日内等权,再对有完成交易的信号日等权;胜率按完成股票事件统计,两者权重不同。日均入选以所选时间及阶段的统一日历天数为分母,包含缺数据日。浓度表另给按24个可用日计算的入选数。
|
||||
|
||||
收盘信号后下一交易日开盘买,买入后H个交易日开盘卖,H=1仍遵循T+1。开盘触及涨跌停、零量或缺价格等按原引擎放弃买入;不能卖出时顺延,可能超过计划10日。重复信号独立成批,不延长旧批。未完成事件不计完成收益,但账户保留残仓并估值。费用每边0、30、60基点;展示线为至少20个有完成交易的信号日及100笔完成事件,未达标灰色、无样本为“—”。此线仅控制展示,不代表显著性。
|
||||
|
||||
## 数据可用性决定了能比较多少历史
|
||||
|
||||
| 数据口径 | 有效选股日 | 实际信号范围 | 8月 / 9月 / 10月 | 含义 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| 选股时已入库 | 24 | 2026-08-04至2026-09-04 | 20 / 4 / 0 | 历史回填已在本次选股截止前入库,可作为当时可查信息 |
|
||||
| 逐日及时入库 | 4 | 2026-09-01至2026-09-04 | 0 / 4 / 0 | 历史每一天均要求及时入库;全部格子样本不足 |
|
||||
| 含回填诊断 | 71 | 2026-05-28至2026-09-04 | 21 / 4 / 0 | 含后来入库的历史分数,仅诊断 |
|
||||
|
||||
原始快照636,116行,交易日期4月27日至10月27日。4月27日至8月3日的分数在8月4日集中入库。对8月4日之后的选股,已经入库的早期分数可以作为历史观测,所以“选股时已入库”不把它们全部丢掉;但也不将其用于入库之前的选股。每个信号时点重建历史20日的可用最大批次,保留[batch_choices.csv](batch_choices.csv)审计轨迹。
|
||||
|
||||
`create_time`时区语义仍未知,主口径沿用原值加8小时,整批最晚时间须早于选股次日09:25;以原值计算的敏感性检查,在本共同信号窗口中股票日与所有频次条件的差异均为0。这并不证明源时间戳不可被改写。
|
||||
|
||||
9月7日全日缺热度,9月8日至10月8日的20日窗口都包含缺日,因此不形成新批次。严格逐日及时口径从8月4日预热20日后,到9月缺日前只剩9月1日至4日。10月没有完整可用窗口,浏览器会显示缺值。没有2025年热度历史,不能沿用评分实验的2025/2026年度验证。
|
||||
|
||||

|
||||
|
||||
## 固定0.80,看持有1至10日
|
||||
|
||||
以下均为“选股时已入库”口径。仅当天和仅历史次数K≥5都有24个有效信号日,分别完成4,859笔和558笔。仅历史次数涉及96只不同股票,每个有效日完成中位数21只;按24个可用日计算日均入选23.42只。重复股票日不能当558个独立时间样本。
|
||||
|
||||
| 持有日 | 仅当天热度≥0.80 | 历史次数≥5 | 次数≥5每边60bp | 次数≥5相对K0,百分点 | 次数≥5且当天达标* |
|
||||
| --- | --- | --- | --- | --- | --- |
|
||||
| 1 | -0.88% | -0.49% | -1.09% | -0.156 | -1.82% |
|
||||
| 2 | -0.81% | -0.62% | -1.21% | -0.501 | -2.23% |
|
||||
| 3 | -0.70% | -0.64% | -1.24% | -0.682 | -4.86% |
|
||||
| 4 | -0.73% | -1.01% | -1.61% | -1.077 | -3.82% |
|
||||
| 5 | -0.86% | -1.42% | -2.01% | -1.416 | -5.78% |
|
||||
| 6 | -0.99% | -1.90% | -2.49% | -1.854 | -5.63% |
|
||||
| 7 | -1.13% | -2.42% | -3.00% | -2.214 | -6.19% |
|
||||
| 8 | -1.17% | -2.76% | -3.34% | -2.494 | -8.24% |
|
||||
| 9 | -1.28% | -2.82% | -3.40% | -2.528 | -8.46% |
|
||||
| 10 | -1.64% | -2.75% | -3.33% | -2.401 | -9.48% |
|
||||
|
||||
带星的“次数且当天”只有13个有效日、28笔完成事件,22只股票,未满足展示门槛;不能因−5.78%等数值很大就认定高频热度必然反转。热度≥0.80、次数≥10在主口径没有样本,≥15或20同样无样本,这些格子不是0收益。
|
||||
|
||||

|
||||
|
||||
仅当天热度≥0.80、不要求完整20日的原单日观察池为41日,5日平均批次净收益-1.40%;加入统一历史观察要求后,单日基线变为24日、−0.86%。样本改变本身影响收益,不能把这个差异归因于频次。完整比较在[current_window_comparison.csv](current_window_comparison.csv)。原先“热度≥0.80、涨幅[0%,5%)、5日”的旧基线另行精确复现,账户仍为−9.1838%,不是拿新股票池冒充旧实验。
|
||||
|
||||
固定K≥5、H5的循环分块自助法:10日块下平均净收益95%区间为[-2.71%, -0.23%],同日K0增量区间为[-2.066, -0.687]个百分点。5日块下净收益区间跨0。仅24日且重叠持有,块长变化会影响结果,不能以一条区间包装成充分统计结论。详见[uncertainty.json](uncertainty.json)。
|
||||
|
||||
## 全部参数与费用
|
||||
|
||||
| 数据口径 | 全部组合 | 达到最低样本量 | 30bp正收益格 | 60bp正收益格 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| 选股时已入库 | 3440 | 1240 | 38 | 0 |
|
||||
| 逐日及时入库 | 3440 | 0 | 0 | 0 |
|
||||
| 含回填诊断 | 3440 | 1580 | 20 | 9 |
|
||||
|
||||
主口径38个30基点正收益格包含16个重复的K=0共同池格,即同一收益被8个热度门槛重复展示。其余22格也共享日期和股票,并非22次独立成功;没有任何当前热度筛选组合被升格为新的独立样本外候选。主口径达标格的最高平均每批净收益仅约+0.317%,费用每边提高到60基点后所有达标格转为非正。含回填口径虽然留下9个60基点正收益格,但其中存在当时不可取得的历史数据,不能作为交易依据。
|
||||
|
||||

|
||||
|
||||
## 市场阶段与指数对照
|
||||
|
||||
阶段依据为信号日及以前:指数收盘≥60日均线且20日涨幅>0为上涨,收盘<60日均线且20日涨幅<0为下跌,其余震荡。四个指数分别分类;股票池始终全市场,没有使用历史指数成分股筛选。选哪个指数划分阶段,与选哪个指数作收益对照是两个独立开关。
|
||||
|
||||
固定热度0.80、前20日至少5次、持有5日:
|
||||
|
||||
| 划分指数 | 阶段 | 有效日 | 平均每批净收益 | 相对K0,百分点 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| 沪深300 | 上涨 | 0 | — | — |
|
||||
| 沪深300 | 震荡 | 7 | -2.35% | -1.437 |
|
||||
| 沪深300 | 下跌 | 17 | -1.04% | -1.408 |
|
||||
| 中证500 | 上涨 | 0 | — | — |
|
||||
| 中证500 | 震荡 | 13 | -2.29% | -1.747 |
|
||||
| 中证500 | 下跌 | 11 | -0.40% | -1.026 |
|
||||
| 中证1000 | 上涨 | 0 | — | — |
|
||||
| 中证1000 | 震荡 | 16 | -1.87% | -1.514 |
|
||||
| 中证1000 | 下跌 | 8 | -0.53% | -1.222 |
|
||||
| 中证2000 | 上涨 | 1 | -2.18% | -1.452 |
|
||||
| 中证2000 | 震荡 | 18 | -2.24% | -1.680 |
|
||||
| 中证2000 | 下跌 | 5 | +1.66% | -0.458 |
|
||||
|
||||
每种阶段都不足20个有效日。按中证2000划分的下跌阶段显示+1.66%,但仅5日,且相对同日共同池减少0.458个百分点;这说明局部正收益不能自动归因于热度选股。
|
||||
|
||||

|
||||
|
||||
同期指数以各股票实际买入和实际卖出日的开盘计算;卖出受阻时也使用延后的实际日。先在同批股票中等权,再按信号日等权,不能用一段指数区间涨幅直接相减。
|
||||
|
||||
| 指数 | 同期毛收益差,百分点 | 30bp净收益减指数价格收益,百分点 |
|
||||
| --- | --- | --- |
|
||||
| 沪深300 | -0.371 | -0.964 |
|
||||
| 中证500 | -0.511 | -1.105 |
|
||||
| 中证1000 | -0.974 | -1.568 |
|
||||
| 中证2000 | -1.628 | -2.221 |
|
||||
|
||||
这些是价格收益差,未做市场风险回归、风险敞口中性化或ETF可交易收益建模。
|
||||
|
||||

|
||||
|
||||
## 固定账户结果
|
||||
|
||||
协议事先固定三个数据口径、热度0.80的三种规则及共同池,H=1/5/10、每边30/60基点,共72条账户。每日预算为前日净资产/H,先卖后买且不超过现金,买入失败份额保留现金。以下为选股时已入库、H5账户;10月8日后仅处理退出,最终估值截至10月23日。
|
||||
|
||||
| 规则(5日) | 账户累计收益30bp | 最大回撤 | 账户累计收益60bp | 期末残仓笔数 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| 共同全市场池 | -0.14% | -4.78% | -2.97% | 0 |
|
||||
| 仅当天热度≥0.80 | -4.10% | -7.71% | -6.79% | 0 |
|
||||
| 前20日次数≥5 | -6.75% | -10.16% | -9.38% | 0 |
|
||||
| 次数≥5且当天达标 | -14.37% | -14.54% | -15.66% | 0 |
|
||||
|
||||
账户累计收益与每批收益不是同一指标。采用可分割复权单位,未模拟整手、最低佣金和真实开盘容量;历史上市、ST、退市覆盖仍有局限,原缓存78只缺有效上市日期被排除。完整账户见[accounts.csv](accounts.csv)。
|
||||
|
||||
## 验证与复现
|
||||
|
||||
开发机使用12项内存隔离测试,验证20日边界、排除当天、缺分处理、整批截止、迟到回填和后续修订不可提前使用、T+1及受阻买卖。真实快照独立核对2,400个历史窗口、36项实际买卖日指数比较、三种规则的逐笔现金持仓与事件收益;72账户现金守恒、36账户截断前缀一致;H1/5/10旧事件基线和H5旧账户精确复现。四指数阶段加总、费用顺序和无样本缺值另作整表检查。
|
||||
|
||||
浏览器用本机独立无头Chrome、阻断外部请求验收:数值与CSV一致,点击切换1至10日明细、三种矩阵、月份、阶段和对照指数、严格口径灰格、无样本缺值、CSV/PNG导出以及430像素视口。图已检查标签、单位、色标与样本提示。结果见[audit.json](audit.json)、[calculation_checks.json](calculation_checks.json)、[browser_checks.json](browser_checks.json)与[manifest.json](manifest.json)。
|
||||
|
||||
从仓库根目录使用`/tmp/micro-calibration-venv/bin/python`或安装了[依赖版本](requirements-research.txt)的环境,依次运行本目录`prepare.py`、`calibrate.py`,再经`scripts/unit_test_guard.py`运行`test_recurrence.py`及`audit.py`,随后运行`diagnostics.py`、`build_dashboard.py`、`report.py`、`browser_check.py`、`finalize.py`。原缓存不入Git,路径与SHA-256见[coverage.json](coverage.json)。不需要重新执行源表核对来复现收益。
|
||||
|
||||
本轮没有部署、参数修改、真实委托或账本变化。当前证据支持继续观察数据完整性,尚不足以给出可上线的热度频次参数;研究结果不会自动写入ParamStore。
|
||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue