Пример #1
0
 protected virtual void Dispose(bool disposing)
 {
     if (!m_disposed)
     {
         if (disposing)
         {
             // Release managed resources
         }
         // Release unmanaged resources
         m_Api.Dispose();
         m_disposed = true;
     }
 }
Пример #2
0
        static void test_Linux_Main(string[] args)
        {
            //Console.WriteLine (Path.GetTempPath());
            //return;
            Queue queue = new Queue(@"libQuantBox_Queue.so");
            //Queue queue2 = new Queue(@"libQuantBox_Queue.so");
            MarketDataApi api = new MarketDataApi(@"/home/hetao/works/QuantBox_X/QuantBox.XAPI/bin/libQuantBox_CTP_Quote.so", queue);

            //TraderApi api2 = new TraderApi(@"C:\Program Files\SmartQuant Ltd\OpenQuant 2014\TAPI\CTP\QuantBox.C2CTP.Trade.dll", queue2);

            api.Server.BrokerID = "1017";
            api.Server.Address  = "tcp://ctpmn1-front1.citicsf.com:51213";

            api.User.UserID   = "00000015";
            api.User.Password = "******";

            api.OnConnectionStatus   = OnConnectionStatus;
            api.OnRtnDepthMarketData = OnRtnDepthMarketData;

            /*api2.Server.BrokerID = "1017";
             * api2.Server.Address = "tcp://ctpmn1-front1.citicsf.com:51205";
             * api2.Server.ResumeType = ResumeType.Restart;
             *
             * api2.User.UserID = "00000015";
             * 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();

            api.Subscribe("IF1410", "");

            Console.ReadKey();

            Console.ReadKey();

            api.Dispose();
        }
Пример #3
0
        static void test_LTS_Main(string[] args)
        {
            Queue         queue  = new Queue(@"QuantBox_Queue.dll");
            Queue         queue2 = new Queue(@"QuantBox_Queue.dll");
            MarketDataApi api    = new MarketDataApi("QuantBox_LTS_Quote.dll", queue);
            TraderApi     api2   = new TraderApi("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();
        }