static void test_CTP_Main(string[] args) { //api = new XApi(@"C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\CTP\x86\QuantBox_CTP_Quote.dll"); //api.Server.BrokerID = "1017"; //api.Server.Address = "tcp://ctpmn1-front1.citicsf.com:51213"; api = new XApi(@"C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\CTP\x86\QuantBox_CTP_Trade.dll"); api.Server.BrokerID = "1017"; api.Server.Address = "tcp://ctpmn1-front1.citicsf.com:51205"; api.Server.PrivateTopicResumeType = ResumeType.Undefined; api.User.UserID = "00000015"; api.User.Password = "******"; api.OnConnectionStatus = OnConnectionStatus; api.OnRtnDepthMarketData = OnRtnDepthMarketData; api.OnRspQryInstrument = OnRspQryInstrument; api.Connect(); Thread.Sleep(10 * 1000); //api.Subscribe("IF1502", ""); api.ReqQryInstrument("", ""); Thread.Sleep(300 * 1000); api.Dispose(); Thread.Sleep(5 * 1000); }
static void test_LTS_Main(string[] args) { Queue queue = new Queue(@"QuantBox_Queue.dll"); Queue queue2 = new Queue(@"QuantBox_Queue.dll"); XApi api = new XApi("QuantBox_LTS_Quote.dll", queue); XApi api2 = new XApi("QuantBox_C2LTS_Trade.dll", queue2); api.Server.BrokerID = "2010"; api.Server.Address = "tcp://211.144.195.163:44513"; api.User.UserID = "00000015"; api.User.Password = "******"; api.OnConnectionStatus = OnConnectionStatus; api.OnRtnDepthMarketData = OnRtnDepthMarketData; api2.Server.BrokerID = "2010"; api2.Server.Address = "tcp://211.144.195.163:44505"; api2.User.UserID = "0020090001134"; api2.User.Password = "******"; api2.OnConnectionStatus = OnConnectionStatus2; api2.OnRspQryInstrument = OnRspQryInstrument; api2.OnRspQryTradingAccount = OnRspQryTradingAccount; api2.OnRspQrySettlementInfo = OnRspQrySettlementInfo; api2.OnRtnOrder = OnRtnOrder; api2.OnRtnError = OnRtnError; api2.OnRtnTrade = OnRtnTrade; api.Connect(); api2.Connect(); Console.ReadKey(); api2.ReqQryInstrument("", ""); Console.ReadKey(); api.Dispose(); api2.Dispose(); //queue.Dispose(); }
static void test_TongShi_Main(string[] args) { api = new XApi(@"C:\Program Files\SmartQuant Ltd\OpenQuant 2014\XAPI\TongShi\x86\QuantBox_TongShi_Quote.dll"); api.Server.Address = "D:\\Scengine\\Stock.dll"; api.OnConnectionStatus = OnConnectionStatus; api.OnRtnDepthMarketData = OnRtnDepthMarketData; api.OnFilterSubscribe = OnFilterSubscribe; api.Connect(); Thread.Sleep(10 * 1000); api.ReqQryInstrument("", ""); Thread.Sleep(300 * 1000); api.Dispose(); Thread.Sleep(5 * 1000); }