TCore Python API 行情
quote_connect
行情连线
def quote_connect(self,port):Parameters
说明
port
连线port,搜寻 ZMQ log取得。
回复SessionKey
quote_logout
行情断线
def quote_logout(self,SessionKey):Parameters
说明
SessionKey
connect时回传的sessionkey
subquote
订阅行情
def subquote(self,SessionKey,Param):订阅成功,行情会从先前创建的行情callback线程处理函数,推送回来。并借由message["DataType"]判断资料类型,做对应的函数处理。
unsubquote
解阅行情
def unsubquote(self,SessionKey,Param):sub_history
回补历史
def sub_history(self,SessionKey,Param):订阅成功,行情会从先前创建的行情callback线程处理函数,推送回来。并借由判断资料类型message["DataType"],做对应的函数处理。
message["DataType"]="TICKS" 历史ticks message["DataType"]="1K" 历史1K message["DataType"]="DK" 历史日K
回补历史资料 为Json格式。
get_history
分页取得历史资料
def get_history(self,SessionKey,Param):查询需要带入QryIndex(带空则当作0),每次最多回50笔,拿最后一笔QryIndex资讯继续往下查询,直到回空代表已无资料。
QueryInstrumentInfo
查询合约
def QueryInstrumentInfo(self, SessionKey, symbol):Parameters
说明
SessionKey
connect时回传的sessionkey
symbol
合约代码
QueryAllInstrumentInfo
查询全部合约
def QueryAllInstrumentInfo(self, SessionKey, type):Parameters
说明
SessionKey
connect时回传的sessionkey
type
Future or Options or Stock
QuotePong
Pong回复以维持连线
def QuotePong(self, SessionKey):Last updated
Was this helpful?