內期行情 註冊接收即時和查詢
DQuote Objects
class DQuote()
on_error
錯誤事件
on_connected
連線成功事件
on_disonnected
斷線事件
on_tick_data_trade
成交價事件..傳入物件:DTickDataTrade
on_tick_data_high_low
最高最低價事件..傳入物件:DTickDataHighLow
on_index_data
現貨價事件..傳入物件:DIndexData
on_tick_data_bid_offer
五檔事件..傳入物件:DTickDataBidOffer
on_tick_data_before_trade
試搓成交價事件..傳入物件:DTickDataBeforeTrade
on_tick_data_before_bid_offer
試搓五檔事件..傳入物件:DTickDataBeforeBidOffer
on_tick_data_open
開盤價事件..傳入物件:DTickDataOpen
get_current_server
def get_current_server()
目前連結主機IP 和 PORT
Returns
Name | Type | Description |
---|---|---|
host | str | 主機IP |
port | str | 主機Port |
get_server_list
def get_server_list()
透過可連結主機
Returns dict[Server]
Name | Type | Description |
---|---|---|
key | str | servername |
value | Server | Server ip:str / port:int |
set_sever_by_name
def set_sever_by_name(servername) -> Tuple[bool, str]
透過主機名稱連結主機
Parameters
Name | Type | Description |
---|---|---|
servername | str | 主機名稱 |
get_subscribe_trade_bid_offer
def get_subscribe_trade_bid_offer()
查詢已註冊成交.賣賣價量 商品
get_subscribe_highlow
def get_subscribe_highlow()
查詢已註冊最高最低價
get_subscribe_index_data
def get_subscribe_index_data()
查詢已註冊現貨 商品
get_subscribe_open
def get_subscribe_open()
查詢已註冊開盤價 商品
query_tick_data_trade
def query_tick_data_trade(productid) -> DTickDataTradeResponse
查詢最後成交價量
Parameters
Name | Type | Description |
---|---|---|
productid | str | 商品代碼 |
Returns
TickDataTradeResponse
query_tick_data_high_low
def query_tick_data_high_low(productid) -> DTickDataHighLowResponse
查詢最高(低)價
Parameters
Name | Type | Description |
---|---|---|
productid | str | 商品代碼 |
Returns
TickDataHighLowResponse
query_tick_data_before_trade
def query_tick_data_before_trade(productid) -> DTickDataBeforeTradeResponse
查詢最後盤前成交價量
Parameters
Name | Type | Description |
---|---|---|
productid | str | 商品代碼 |
Returns
TickDataBeforeTradeResponse
query_tick_data_open
def query_tick_data_open(productid) -> DTickDataOpenResponse
查詢開盤價
Parameters
Name | Type | Description |
---|---|---|
productid | str | 商品代碼 |
Returns
TickDataOpenResponse
query_index_data
def query_index_data(productid) -> DIndexDataResponse
查詢現貨成交價
Parameters
Name | Type | Description |
---|---|---|
productid | str | 商品代碼 |
Returns
IndexDataResponse
query_tick_data_bid_offer
def query_tick_data_bid_offer(productid) -> DTickDataBidOfferResponse
查詢最後五檔
Parameters
Name | Type | Description |
---|---|---|
productid | str | 商品代碼 |
Returns
TickDataBidOfferResponse
query_tick_data_before_bid_offer
def query_tick_data_before_bid_offer(
productid) -> DTickDataBeforeBidOfferResponse
查詢最後盤前五檔
Parameters
Name | Type | Description |
---|---|---|
productid | str | 商品代碼 |
Returns
TickDataBeforeBidOfferResponse
subscribe_trade_bid_offer
def subscribe_trade_bid_offer(productid) -> Tuple[bool, str]
註冊成交.賣賣價量
Parameters
Name | Type | Description |
---|---|---|
productid | str | 商品代碼 |
Returns
Type | Description |
---|---|
bool | 是否成功 |
str | 錯誤訊息 |
unsubscribe_trade_bid_offer
def unsubscribe_trade_bid_offer(productid) -> Tuple[bool, str]
反註冊成交.賣賣價量
Parameters
Name | Type | Description |
---|---|---|
productid | str | 商品代碼 |
Returns
Type | Description |
---|---|
bool | 是否成功 |
str | 錯誤訊息 |
subscribe_high_low
def subscribe_high_low(productid) -> Tuple[bool, str]
註冊最高最低價
Parameters
Name | Type | Description |
---|---|---|
productid | str | 商品代碼 |
Returns
Type | Description |
---|---|
bool | 是否成功 |
str | 錯誤訊息 |
unsubscribe_high_low
def unsubscribe_high_low(productid) -> Tuple[bool, str]
反註冊最高最低價
Parameters
Name | Type | Description |
---|---|---|
productid | str | 商品代碼 |
Returns
Type | Description |
---|---|
bool | 是否成功 |
str | 錯誤訊息 |
subscribe_open
def subscribe_open(productid) -> Tuple[bool, str]
註冊開盤價
Parameters
Name | Type | Description |
---|---|---|
productid | str | 商品代碼 |
Returns
Type | Description |
---|---|
bool | 是否成功 |
str | 錯誤訊息 |
unsubscribe_open
def unsubscribe_open(productid) -> Tuple[bool, str]
反註冊開盤價
Parameters
Name | Type | Description |
---|---|---|
productid | str | 商品代碼 |
Returns
Type | Description |
---|---|
bool | 是否成功 |
str | 錯誤訊息 |
subscribe_index_data
def subscribe_index_data(kind, index) -> Tuple[bool, str]
註冊現貨價
Parameters
Name | Type | Description |
---|---|---|
index | str | 商品代碼 |
Returns
Type | Description |
---|---|
bool | 是否成功 |
str | 錯誤訊息 |
unsubscribe_index_data
def unsubscribe_index_data(kind, index) -> Tuple[bool, str]
反註冊現貨價
Parameters
Name | Type | Description |
---|---|---|
index | str | 商品代碼 |
Returns
Type | Description |
---|---|
bool | 是否成功 |
str | 錯誤訊息 |
close
def close()
關閉物件
Format Objects
class Format()
I020_HEAD
成交價揭示
I021_HEAD
最高最低價揭示
I022_HEAD
盤前揭示成交價揭示
I023_HEAD
定時開盤價量揭示
I060_HEAD
現貨價
I080_HEAD
委託簿揭示
I082_HEAD
盤前委託簿揭示
I020
成交價揭示
I021
最高最低價揭示
I022
盤前揭示成交價揭示
I023
定時開盤價量揭示
I060
現貨價
I080
委託簿揭示
I082
盤前委託簿揭示
X010
商品基本資料訊息
X020
成交價量揭示訊息
X021
盤中最高低價揭示訊息
X060
現貨標的資訊
X080
委託簿揭示訊息
nav_order: 4 parent: API Reference
title: “dquote” —
內期行情物件
DTickDataTrade Objects
class DTickDataTrade()
成交價揭示
commodityid
商品代號 str
infotime
期交所送出時間 str
matchprice
成交價格 float
matchquantity
成交量 int
matchtotalqty
成交總量 int
matchbuycnt
成交買量 int
matchsellcnt
成交賣量 int
matchtime
成交時間 str
DTickDataHighLow Objects
class DTickDataHighLow()
最高最低價揭示
commodityid
商品代碼 str
showtime
時間 str
dayhighprice
最高價 float
daylowprice
最低價 float
DTickDataBeforeTrade Objects
class DTickDataBeforeTrade()
盤前揭示成交價揭示
commodityid
商品代號 str
infotime
期交所送出時間 str
matchprice
成交價格 int
matchquantity
成交量 int
matchtotalqty
成交總量 int
matchbuycnt
成交買量 int
matchsellcnt
成交賣量 int
matchtime
成交時間 str
DIndexData Objects
class DIndexData()
現貨價
index_kind
現貨代碼 str
index_time
現貨統計時間 str
index_value
現貨價 float
DTickDataBidOffer Objects
class DTickDataBidOffer()
委託簿揭示
commodityid
商品代碼 str
bp1
第一檔委買價格 float
bp2
第二檔委買價格 float
bp3
第三檔委買價格 float
bp4
第四檔委買價格 float
bp5
第五檔委買價格 float
bq1
第一檔委買數量 int
bq2
第二檔委買數量 int
bq3
第三檔委買數量 int
bq4
第四檔委買數量 int
bq5
第五檔委買數量 int
sp1
第一檔委賣價格 float
sp2
第二檔委賣價格 float
sp3
第三檔委賣價格 float
sp4
第四檔委賣價格 float
sp5
第五檔委賣價格 float
sq1
第一檔委買數量 int
sq2
第二檔委賣數量 int
sq3
第三檔委賣數量 int
sq4
第四檔委賣數量 int
sq5
第五檔委賣數量 int
DTickDataBeforeBidOffer Objects
class DTickDataBeforeBidOffer()
盤前委託簿揭示
commodityid
商品代碼 str
bp1
第一檔委買價格 float
bp2
第二檔委買價格 float
bp3
第三檔委買價格 float
bp4
第四檔委買價格 float
bp5
第五檔委買價格 float
bq1
第一檔委買數量 int
bq2
第二檔委買數量 int
bq3
第三檔委買數量 int
bq4
第四檔委買數量 int
bq5
第五檔委買數量 int
sp1
第一檔委賣價格 float
sp2
第二檔委賣價格 float
sp3
第三檔委賣價格 float
sp4
第四檔委賣價格 float
sp5
第五檔委賣價格 float
sq1
第一檔委買數量 int
sq2
第二檔委賣數量 int
sq3
第三檔委賣數量 int
sq4
第四檔委賣數量 int
sq5
第五檔委賣數量 int
DTickDataOpen Objects
class DTickDataOpen()
開盤價揭示
commodityid
商品代碼
opentime
開盤時間
openprice
開盤價
openquantity
開盤量
DTickDataTradeResponse Objects
@dataclass
class DTickDataTradeResponse()
成交價量查詢回覆物件
ok
是否成功 bool
error
錯誤訊息 str
data
回覆物件 TickDataTrade
DTickDataBeforeTradeResponse Objects
@dataclass
class DTickDataBeforeTradeResponse()
試搓成交價量查詢回覆物件
ok
是否成功 bool
error
錯誤訊息 str
data
回覆物件 TickDataBeforeTrade
DTickDataHighLowResponse Objects
@dataclass
class DTickDataHighLowResponse()
最高最低價查詢回覆物件
ok
是否成功 bool
error
錯誤訊息 str
data
回覆物件 TickDataHighLow
DTickDataOpenResponse Objects
@dataclass
class DTickDataOpenResponse()
開盤價查詢回覆物件
ok
是否成功 bool
error
錯誤訊息 str
data
回覆物件 TickDataOpen
DIndexDataResponse Objects
@dataclass
class DIndexDataResponse()
現貨價格查詢回覆物件
ok
是否成功 bool
error
錯誤訊息 str
data
回覆物件 IndexData
DTickDataBidOfferResponse Objects
@dataclass
class DTickDataBidOfferResponse()
最佳買賣價查詢回覆物件
ok
是否成功 bool
error
錯誤訊息 str
data
回覆物件 TickDataBidOffer
DTickDataBeforeBidOfferResponse Objects
@dataclass
class DTickDataBeforeBidOfferResponse()
試搓最佳買賣價查詢回覆物件
ok
是否成功 bool
error
錯誤訊息 str
data
回覆物件 TickDataBeforeBidOffer