Skip to content

Commit

Permalink
[Mod] 更新版本号到1.2.64.2
Browse files Browse the repository at this point in the history
  • Loading branch information
vnpy committed Dec 6, 2021
1 parent 199ad22 commit 1dff8b2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</p>

<p align="center">
<img src ="https://img.shields.io/badge/version-1.2.64.1-blueviolet.svg"/>
<img src ="https://img.shields.io/badge/version-1.2.64.2-blueviolet.svg"/>
<img src ="https://img.shields.io/badge/platform-windows|linux|macos-yellow.svg"/>
<img src ="https://img.shields.io/badge/python-3.7-blue.svg"/>
<img src ="https://img.shields.io/github/license/vnpy/vnpy.svg?color=orange"/>
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = vnpy_tushare
version = 1.2.64.1
version = 1.2.64.2
url = https://www.vnpy.com
license = MIT
author = Xiaoyou Chen
Expand Down
12 changes: 10 additions & 2 deletions vnpy_tushare/tushare_datafeed.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,14 @@ def query_bar_history(self, req: HistoryRequest) -> Optional[List[BarData]]:

dt = CHINA_TZ.localize(dt)

turnover = row.get("amount", 0)
if turnover is None:
turnover = 0

open_interest = row.get("oi", 0)
if open_interest is None:
open_interest = 0

bar: BarData = BarData(
symbol=symbol,
exchange=exchange,
Expand All @@ -190,8 +198,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) if row.get("amount", 0) else 0,
open_interest=row.get("oi", 0) if row.get("oi", 0) else 0,
turnover=turnover,
open_interest=open_interest,
gateway_name="TS"
)

Expand Down

0 comments on commit 1dff8b2

Please sign in to comment.