g_TradeZMQ = TradeAPI("ZMQ","8076c9867a372d2a9a814ae710c256e2")
g_QuoteZMQ = QuoteAPI("ZMQ","8076c9867a372d2a9a814ae710c256e2")
帶入登入參數
q_data = g_QuoteZMQ.quote_Connect("XXXXX")
XXXXX→連接埠數據
登入報價連線,可從QuoteZMQService的log中抓取到
路徑:C:\TAIFEXTC\APPs\TCoreRelease\Logs
t_data = g_TradeZMQ.trade_Connect("XXXXX")
XXXXX→連接埠數據
登入交易連線,可從TradeZMQService的log中抓取到
路徑:C:\TAIFEXTC\APPs\TCoreRelease\Logs
t1 = threading.Thread(target = trade_sub_th,args=(g_TradeZMQ,t_data["SubPort"],))
建立交易主推子線程
TradeThread.start()
啟動交易主推子線程
t2 = threading.Thread(target = quote_sub_th,args=(g_QuoteZMQ,q_data["SubPort"],))
建立行情主推子線程
QuoteThread.start()
啟動行情主推子線程
QuotePongCheck = g_QuoteZMQ.Pong(QuoteKey)
回應報價伺服器的ping功能
TradePongCheck = g_TradeZMQ.Pong(TradeKey)
回應交易伺服器的ping功能