diff --git a/vnpy_tushare/tushare_datafeed.py b/vnpy_tushare/tushare_datafeed.py index 21e029c..f429459 100644 --- a/vnpy_tushare/tushare_datafeed.py +++ b/vnpy_tushare/tushare_datafeed.py @@ -246,8 +246,8 @@ def query_bar_history(self, req: HistoryRequest) -> Optional[List[BarData]]: low_price=round_to(row["low"], 0.000001), close_price=round_to(row["close"], 0.000001), volume=row["vol"], - turnover=row.get("amount", 0), - open_interest=row.get("oi", 0), + turnover=row.get("amount", 0) if row.get("amount", 0) else 0, + open_interest=row.get("oi", 0) if row.get("oi", 0) else 0, gateway_name="TS" )