Revert "fix(models): 修复美股分钟K线 datetime 时区拼接错位,还原为北京时间"

This reverts commit 5408903a4c.
This commit is contained in:
openbot-coder committed 2026-10-13 16:42:41 +08:00
1 parent 5408903a4c
commit 8193d560da
11 files changed
+10 -250

No files matched your search

-17
View File
@@ -99,23 +99,6 @@
2. **是否含未收盘的那根** —— 盘中最后一根是动态的
3. 分钟线注意**数据来源深度**不同
??? question "美股分钟 K 线的时间为什么跨了两个日期?"
**已在上游修好(v0.6.2)**。通达信 EX 通道对美股返回的原生时间戳把两个时区拼在一起:
日期分量是**美东交易日**、时分分量是**北京时间**。修复前,同一交易日的 390 根会全部
落在同一个北京自然日里,并且下午半场被排在上午半场**之前**。
现在 `SecurityBar.datetime` 已统一为**北京时间**(凌晨段日期自动 +1 天),可直接排序 /
过滤 / 做增量水位线。但要注意**美股一个交易日横跨两个北京自然日**:
```python
bars = await td.get_bars("usAAPL", KlinePeriod.MIN_1, count=390)
print(bars[0].datetime, bars[-1].datetime) # 2026-10-12 21:31:00 → 2026-10-13 04:00:00
print({b.trading_date for b in bars}) # {'2026-10-12'} —— 同一个交易日
```
按**交易日**聚合(分钟线合成日线、日内统计)请用 `b.trading_date`,不要用
`b.datetime.date()`。A股 / 港股 / 期货原始即为北京时间,不受影响。
??? question "缓存会不会返回过期数据?"
缓存按数据类型分级 TTL,不会返回超出 TTL 的数据: