看股功能更新
This commit is contained in:
@@ -27,12 +27,14 @@ def fetch_daily(code: str, start: str = "20200101", end: str | None = None,
|
||||
|
||||
bars: list[Bar] = []
|
||||
for _, r in df.iterrows():
|
||||
amt = r.get("成交额")
|
||||
bars.append(
|
||||
Bar(
|
||||
ts=datetime.strptime(str(r["日期"]), "%Y-%m-%d"),
|
||||
open=float(r["开盘"]), high=float(r["最高"]),
|
||||
low=float(r["最低"]), close=float(r["收盘"]),
|
||||
volume=float(r["成交量"]) * 100.0, # AKShare 成交量单位为手 -> 股
|
||||
amount=float(amt) if amt is not None and amt == amt else None, # AKShare 成交额单位为元
|
||||
)
|
||||
)
|
||||
return bars
|
||||
|
||||
Reference in New Issue
Block a user