コード例 #1
0
ファイル: Program.cs プロジェクト: bingsgit/pyctp-2
        static void Main(string[] args)
        {
            q = new ctp_quote();
            t = new ctp_trade();

            t.SetOnFrontConnected(t_connected);
            t.SetOnRspUserLogin(t_login);
            t.SetOnRtnTradingNotice(t_notice);
            t.SetOnRspAuthenticate(t_auth);

            q.SetOnFrontConnected(connected);
            q.SetOnRspUserLogin(login);

            t.RegisterFront("tcp://180.168.146.187:13030");
            q.RegisterFront("tcp://180.168.146.187:13040");

            //t.ReqUserAuthMethod
            string v = t.GetVersion();

            Console.WriteLine(v);
            t.SubscribePrivateTopic(THOST_TE_RESUME_TYPE.THOST_TERT_QUICK);
            t.SubscribePublicTopic(THOST_TE_RESUME_TYPE.THOST_TERT_QUICK);

            t.Init();
            q.Init();
            Console.ReadLine();
        }
コード例 #2
0
 //响应注册
 void SetCallBack()
 {
     _t.SetOnFrontConnected((DeleOnFrontConnected)AddDele(new DeleOnFrontConnected(CTPOnFrontConnected)));
     _t.SetOnRspUserLogin((DeleOnRspUserLogin)AddDele(new DeleOnRspUserLogin(CTPOnRspUserLogin)));
     _t.SetOnRspSettlementInfoConfirm((DeleOnRspSettlementInfoConfirm)AddDele(new DeleOnRspSettlementInfoConfirm(CTPOnRspSettlementInfoConfirm)));
     _t.SetOnFrontDisconnected((DeleOnFrontDisconnected)AddDele(new DeleOnFrontDisconnected(CTPOnFrontDisconnected)));
     _t.SetOnRspQryInstrument((DeleOnRspQryInstrument)AddDele(new DeleOnRspQryInstrument(CTPOnRspQryInstrument)));
     _t.SetOnRspQryInvestorPosition((DeleOnRspQryInvestorPosition)AddDele(new DeleOnRspQryInvestorPosition(CTPOnRspQryInvestorPosition)));
     _t.SetOnRspQryTradingAccount((DeleOnRspQryTradingAccount)AddDele(new DeleOnRspQryTradingAccount(CTPOnRspQryTradingAccount)));
     _t.SetOnRspOrderInsert((DeleOnRspOrderInsert)AddDele(new DeleOnRspOrderInsert(CTPOnRspOrderInsert)));
     _t.SetOnErrRtnOrderInsert((DeleOnErrRtnOrderInsert)AddDele(new DeleOnErrRtnOrderInsert(CTPOnErrRtnOrderInsert)));
     _t.SetOnErrRtnOrderAction((DeleOnErrRtnOrderAction)AddDele(new DeleOnErrRtnOrderAction(CTPOnErrRtnOrderAction)));
     _t.SetOnRspOrderAction((DeleOnRspOrderAction)AddDele(new DeleOnRspOrderAction(CTPOnRspOrderAction)));
     _t.SetOnRtnOrder((DeleOnRtnOrder)AddDele(new DeleOnRtnOrder(CTPOnRtnOrder)));
     _t.SetOnRtnTrade((DeleOnRtnTrade)AddDele(new DeleOnRtnTrade(CTPOnRtnTrade)));
     _t.SetOnRtnInstrumentStatus((DeleOnRtnInstrumentStatus)AddDele(new DeleOnRtnInstrumentStatus(CTPOnRtnInstrumentStatus)));
     _t.SetOnRtnTradingNotice((DeleOnRtnTradingNotice)AddDele(new DeleOnRtnTradingNotice(CTPOnRtnTradingNotice)));
     _t.SetOnRspUserPasswordUpdate((DeleOnRspUserPasswordUpdate)AddDele(new DeleOnRspUserPasswordUpdate(CTPOnRspUserPasswordUpdate)));
     _t.SetOnRspError((DeleOnRspError)AddDele(new DeleOnRspError(CTPOnRspError)));
 }
コード例 #3
0
        static void Main(string[] args)
        {
            q = new ctp_quote(new FileInfo("../../../dll/ctp_quote.dll").FullName);
            t = new ctp_trade(new FileInfo("../../../dll/ctp_trade.dll").FullName);

            t.SetOnFrontConnected(t_connected);
            t.SetOnRspUserLogin(t_login);

            q.SetOnFrontConnected(connected);
            q.SetOnRspUserLogin(login);

            t.RegisterFront("tcp://180.168.146.187:10000");
            q.RegisterFront("tcp://180.168.146.187:10010");

            t.Init();
            q.Init();
            Console.ReadLine();
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: laoniu2020/ctp_net_core
        static void Main(string[] args)
        {
            q = new ctp_quote("ctp_quote");
            t = new ctp_trade("ctp_trade");

            t.SetOnFrontConnected(t_connected);
            t.SetOnRspUserLogin(t_login);

            q.SetOnFrontConnected(connected);
            q.SetOnRspUserLogin(login);

            t.RegisterFront("tcp://180.168.146.187:10000");
            q.RegisterFront("tcp://180.168.146.187:10010");

            t.Init();
            q.Init();
            Console.ReadLine();
        }