Skip to content

Commit

Permalink
0.9.50 优化K线获取
Browse files Browse the repository at this point in the history
  • Loading branch information
zengbin93 committed May 9, 2024
1 parent 94b34f5 commit b97e8cb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion czsc/connectors/tq_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ def get_raw_bars(symbol, freq, sdt, edt, fq="前复权", **kwargs):
- tq_user: str, 天勤账户
- tq_pass: str, 天勤密码
- raw_bars: bool, 是否返回 RawBar 对象列表,默认为 True
:return: RawBar 对象列表 or DataFrame
"""
Expand All @@ -208,7 +209,7 @@ def get_raw_bars(symbol, freq, sdt, edt, fq="前复权", **kwargs):
df = df[["symbol", "dt", "open", "close", "high", "low", "vol", "amount"]].copy()

df = df[(df["dt"] >= pd.to_datetime(sdt)) & (df["dt"] <= pd.to_datetime(edt))].reset_index(drop=True)
return czsc.resample_bars(df, target_freq=freq, raw_bars=raw_bars)
return czsc.resample_bars(df, target_freq=freq, raw_bars=kwargs.get("raw_bars", True))


def get_daily_backup(api: TqApi, **kwargs):
Expand Down

0 comments on commit b97e8cb

Please sign in to comment.