def test(self): self.market = XFinApi_TradeApi.XFinApi_CreateMarketApi("XTA_W32/Api/ESITap_v9.3.0.1_20160406/XFinApi.ESITapTradeApi.dll") if isinstance(self.market,int): print("* Market XFinApiCreateError={};".format(StrCreateErrors[self.market])) return else: self.market = self.market[0] self.marketEvent = MarketEvent(self.market,self.cfg) self.market.SetListener(self.marketEvent) openParams = XFinApi_TradeApi.OpenParams() openParams.HostAddress = self.cfg.MarketAddress openParams.UserID = self.cfg.MarketUserName openParams.Password = self.cfg.MarketPassword openParams.IsUTF8 = True self.market.Open(openParams)
def test(self): self.market = XFinApi_TradeApi.XFinApi_CreateMarketApi( "XTA_W32/Api/ZDCTP_v20180404/XFinApi.ZDCTPTradeApi.dll") if isinstance(self.market, int): print("* Market XFinApiCreateError={};".format( StrCreateErrors[self.market])) return else: self.market = self.market[0] self.marketEvent = MarketEvent(self.market, self.cfg) self.market.SetListener(self.marketEvent) openParams = XFinApi_TradeApi.OpenParams() openParams.HostAddress = self.cfg.MarketAddress openParams.Configs["LoginAddress"] = self.cfg.TradeAddress openParams.UserID = self.cfg.UserName openParams.Password = self.cfg.Password openParams.IsUTF8 = True self.market.Open(openParams)
def test15(self): self.market = XFinApi_TradeApi.XFinApi_CreateMarketApi( "XTA_W32/Api/CTP_v6.3.15_20190220/XFinApi.CTPTradeApiSE.dll") if isinstance(self.market, int): print("* Market XFinApiCreateError={};".format( StrCreateErrors[self.market])) return else: self.market = self.market[0] self.marketEvent = MarketEvent(self.market, self.cfgSE) self.market.SetListener(self.marketEvent) openParams = XFinApi_TradeApi.OpenParams() openParams.HostAddress = self.cfgSE.MarketAddress openParams.BrokerID = self.cfgSE.BrokerID openParams.UserID = self.cfgSE.UserName openParams.Password = self.cfgSE.Password openParams.IsUTF8 = True self.market.Open(openParams)
def test(self): self.market = XFinApi_TradeApi.XFinApi_CreateMarketApi( "XTA_W32/Api/XTP_v1.1.18.13_20180516/XFinApi.XTPTradeApi.dll") if isinstance(self.market, int): print("* Market XFinApiCreateError={};".format( StrCreateErrors[self.market])) return else: self.market = self.market[0] self.marketEvent = MarketEvent(self.market, self.cfg) self.market.SetListener(self.marketEvent) openParams = XFinApi_TradeApi.OpenParams() openParams.HostAddress = self.cfg.MarketAddress openParams.UserID = self.cfg.UserName openParams.Password = self.cfg.Password openParams.Configs["AuthCode"] = self.cfg.AuthCode openParams.Configs["ClientID"] = self.cfg.ClientID #可选 openParams.IsUTF8 = True self.market.Open(openParams)
def test(self): self.market = XFinApi_TradeApi.XFinApi_CreateMarketApi( "XTA_W32/Api/UFX_V1.0.0.100/XFinApi.UFXTradeApi.dll") if isinstance(self.market, int): print("* Market XFinApiCreateError={};".format( StrCreateErrors[self.market])) return else: self.market = self.market[0] self.marketEvent = MarketEvent(self.market, self.cfg) self.market.SetListener(self.marketEvent) openParams = XFinApi_TradeApi.OpenParams() openParams.HostAddress = self.cfg.HostAddress openParams.UserID = self.cfg.UserName openParams.Password = self.cfg.Password openParams.Configs["LicenseFile"] = self.cfg.LicenseFile openParams.Configs["LicensePwd"] = self.cfg.LicensePwd openParams.Configs["SendQueueSize"] = self.cfg.SendQueueSize openParams.IsUTF8 = True self.market.Open(openParams)