Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

realtime的latest_trade_price股價為 '-' #94

Open
aga4gavin opened this issue Jul 9, 2021 · 0 comments
Open

realtime的latest_trade_price股價為 '-' #94

aga4gavin opened this issue Jul 9, 2021 · 0 comments

Comments

@aga4gavin
Copy link

您好,

謝謝開發這麼好用的library,我發現realtime取得的即時股價latest_trade_price,很多股票都是 '-',請問可以修正嗎,不知是否資料來源就這樣回報了。

程式碼如下:

import twstock
import pandas as pd
tickers= ['2603', "2727" ]
rt_data= twstock.realtime.get(tickers) 
rt_data
    

從以下輸出看出來,2603股價是正常的,但2727股價為'-'

{'2603': {'timestamp': 1625798400.0,
  'info': {'code': '2603',
   'channel': '2603.tw',
   'name': '長榮',
   'fullname': '長榮海運股份有限公司',
   'time': '2021-07-09 10:40:00'},
  'realtime': {'latest_trade_price': '196.0000',
   'trade_volume': '4445',
   'accumulate_trade_volume': '34286',
   'best_bid_price': ['196.0000',
    '195.5000',
    '195.0000',
    '194.5000',
    '194.0000'],
   'best_bid_volume': ['237', '98', '1182', '39', '215'],
   'best_ask_price': ['196.5000',
    '197.0000',
    '197.5000',
    '198.0000',
    '198.5000'],
   'best_ask_volume': ['34', '876', '53', '741', '130'],
   'open': '187.0000',
   'high': '201.5000',
   'low': '187.0000'},
  'success': True},
 '2727': {'timestamp': 1625799246.0,
  'info': {'code': '2727',
   'channel': '2727.tw',
   'name': '王品',
   'fullname': '王品餐飲股份有限公司',
   'time': '2021-07-09 10:54:06'},
  'realtime': {'latest_trade_price': '-',
   'trade_volume': '-',
   'accumulate_trade_volume': '3881',
   'best_bid_price': ['168.0000',
    '167.5000',
    '167.0000',
    '166.5000',
    '166.0000'],
   'best_bid_volume': ['194', '27', '36', '26', '75'],
   'best_ask_price': ['168.5000',
    '169.0000',
    '169.5000',
    '170.0000',
    '170.5000'],
   'best_ask_volume': ['10', '33', '7', '45', '11'],
   'open': '173.5000',
   'high': '177.5000',
   'low': '168.0000'},
  'success': True},
 'success': True}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant