Skip to main content

Trades

Subscribe to the latest stock trade information

Parameters

NameTypeDescription
channel*stringChannel:trades, books, indices
symbol*stringStock Number
intradayOddLotbooleanintradayOddLot true: intradayOddLot, false: Common Stock, default: false

Response

NameTypeDescription
symbol*stringStock NUmber
type*stringTicker Type
exchange*stringExchange
marketstringMarket Type
time*numberTime
serial*numberSerial Number
bidnumberBid Price
asknumberAsk Price
pricenumberTrading Price
sizenumberTrading Volume
volumenumberTotal Trading Volume
isLimitDownPricebooleanLast Matched is Fall Stop Price:true
isLimitUpPricebooleanLast Matched is Rise Stop Price:true
isLimitDownBidbooleanOptimal position purchase Fall remarks:true
isLimitUpBidbooleanOptimal position purchase Rise remarks:true
isLimitDownAskbooleanOptimal position sale Fall remarks:true
isLimitUpAskbooleanOptimal position sale Fall remarkstrue
isLimitDownHaltbooleanHeld Match And Instantaneous Fall Trend:true
isLimitUpHaltbooleanHeld Match And Instantaneous Rise Trend:true
isTrialbooleanTrial:true
isDelayedOpenbooleanDelayed Open:true
isDelayedClosebooleanDelayed Close:true
isContinuousbooleanLast Matched is Continuous Market:true
isOpenbooleanOpen Mark:true
isClosebooleanClose Mark:true
timenumberTrading Time
info

'*' Indicates mandatory disclosure fields.

Example

Subscribe channel

from fubon_neo.sdk import FubonSDK

def handle_message(message):
print(message)


sdk = FubonSDK()
accounts = sdk.login("Your ID", "Your password", "Your cert path", "Your cert password") # 需登入後,才能取得行情權限

sdk.init_realtime() # Establish market-data

stock = sdk.marketdata.websocket_client.stock
stock.on('message', handle_message)
stock.connect()
stock.subscribe({
'channel': 'trades',
'symbol': '2330'
})

Receive data

{
"event": "data",
"data": {
"symbol": "2330",
"type": "EQUITY",
"exchange": "TWSE",
"market": "TSE",
"bid": 567,
"ask": 568,
"price": 568,
"size": 4778,
"volume": 54538,
"isClose": true,
"time": 1685338200000000,
"serial": 6652422
},
"id": "<CHANNEL_ID>",
"channel": "trades"
}