本文主要說明查詢股票報價。
# 取得長榮股票報價,長榮代號:2603
contract_2603_TW = api.Contracts.Stocks["2603"]
print (contract_2603_TW)
exchange=<Exchange.TSE: 'TSE'> code='2603' symbol='TSE2603' name='長榮' category='15' unit=1000 limit_up=136.0 limit_down=112.0 reference=124.0 update_date='2021/09/17' margin_trading_balance=1010 short_selling_balance=285 day_trade=<DayTrade.Yes: 'Yes'>
exchange (Exchange): Attributes of industry.
{OES, OTC, TSE ...etc} 上市別 TSE: 證券交易所上市股票 OTC:櫃買中心掛牌
code (str): Id.
symbol (str): Symbol.
name (str): Name.
category (str): Category. 產業別
limit_up (float): Limit up. 漲停價
limit_down (float): Limit down. 跌停價
reference (float): Reference price. 參考價
update_date (str): Update date.
margin_trading_balance (int): Margin trading balance.
short_selling_balance (int): Short selling balance.
day_trade (DayTrade): Day trade.
{Yes, No, OnlyBuy}
使用shioaji函式庫Contracts查詢股票報價。