mlouielu / twstock

台灣股市股票價格擷取 (含即時股票資訊) - Taiwan Stock Opendata with realtime

Home Page:http://twstock.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

stockcode 1760讀不到

hunixhsu opened this issue · comments

import twstock
twstock.realtime.get('1760');
{'queryTime': {'stockInfo': 1190971, 'sessionFromTime': -1, 'stockInfoItem': 4289, 'sessionLatestTime': -1, 'sysTime': '13:25:20', 'sessionStr': 'UserSession', 'showChart': False, 'sysDate': '20181122'}, 'rtmessage': 'Empty Query.', 'userDelay': 5000, 'rtcode': '5001', 'msgArray': [], 'referer': '', 'success': False}
from twstock import Stock
from twstock import BestFourPoint
stock = Stock('1760');
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3.4/site-packages/twstock/stock.py", line 135, in init
self.fetcher = TWSEFetcher() if codes[sid].market == '上市' else TPEXFetcher()
KeyError: '1760'
print(twstock.codes['1760'])
Traceback (most recent call last):
File "", line 1, in
KeyError: '1760'

可以請你在重測一遍嗎?

目前的版本應可以讀取到這支股票

>>> twstock.__version__
'1.1.1'
>>> twstock.realtime.get('1760')
{'timestamp': 1548129971.0, 'info': {'code': '1760', 'channel': '1760.tw', 'name': '寶齡富錦', 'fullname': '寶齡富錦生技股份有限公司', 'time': '2019-01-22 12:06:11'}, 'realtime': {'latest_trade_price': '91.10', 'trade_volume': '1', 'accumulate_trade_volume': '958', 'best_bid_price': ['91.10', '91.00', '90.90', '90.80', '90.70'], 'best_bid_volume': ['2', '2', '5', '11', '9'], 'best_ask_price': ['91.20', '91.30', '91.40', '91.50', '91.60'], 'best_ask_volume': ['4', '14', '2', '8', '6'], 'open': '90.90', 'high': '92.60', 'low': '89.80'}, 'success': True}

OK, 那我就將這個 issue 關掉了