Ejemplo n.º 1
0
        private void InitCallbacks()
        {
            //由于回调函数可能被GC回收,所以用成员变量将回调函数保存下来
            _fnOnConnect_Holder = OnConnect;
            _fnOnDisconnect_Holder = OnDisconnect;
            _fnOnErrRtnOrderAction_Holder = OnErrRtnOrderAction;
            _fnOnErrRtnOrderInsert_Holder = OnErrRtnOrderInsert;
            _fnOnRspError_Holder = OnRspError;
            _fnOnRspOrderAction_Holder = OnRspOrderAction;
            _fnOnRspOrderInsert_Holder = OnRspOrderInsert;
            _fnOnRspQryDepthMarketData_Holder = OnRspQryDepthMarketData;
            _fnOnRspQryInstrument_Holder = OnRspQryInstrument;
            _fnOnRspQryInstrumentCommissionRate_Holder = OnRspQryInstrumentCommissionRate;
            _fnOnRspQryInvestorPosition_Holder = OnRspQryInvestorPosition;
            _fnOnRspQryTradingAccount_Holder = OnRspQryTradingAccount;
            _fnOnRtnInstrumentStatus_Holder = OnRtnInstrumentStatus;
            _fnOnRtnDepthMarketData_Holder = OnRtnDepthMarketData;
            _fnOnRtnOrder_Holder = OnRtnOrder;
            _fnOnRtnTrade_Holder = OnRtnTrade;

#if CTP
            _fnOnRspQryInstrumentMarginRate_Holder = OnRspQryInstrumentMarginRate;
#endif
            
            _fnOnRtnForQuoteRsp_Holder = OnRtnForQuoteRsp;
            _fnOnErrRtnQuoteAction_Holder = OnErrRtnQuoteAction;
            _fnOnErrRtnQuoteInsert_Holder = OnErrRtnQuoteInsert;
            _fnOnRspQuoteAction_Holder = OnRspQuoteAction;
            _fnOnRspQuoteInsert_Holder = OnRspQuoteInsert;
            _fnOnRtnQuote_Holder = OnRtnQuote;
        }
Ejemplo n.º 2
0
 public MdApiWrapper()
 {
     _fnOnConnect_Holder            = OnConnect_callback;
     _fnOnDisconnect_Holder         = OnDisconnect_callback;
     _fnOnRspError_Holder           = OnRspError_callback;
     _fnOnRtnDepthMarketData_Holder = OnRtnDepthMarketData_callback;
 }
Ejemplo n.º 3
0
 public MdApiWrapper()
 {
     _fnOnConnect_Holder = OnConnect_callback;
     _fnOnDisconnect_Holder = OnDisconnect_callback;
     _fnOnRspError_Holder = OnRspError_callback;
     _fnOnRtnDepthMarketData_Holder = OnRtnDepthMarketData_callback;
 }
 private void InitCallbacks()
 {
     //由于回调函数可能被GC回收,所以用成员变量将回调函数保存下来
     _fnOnConnect_Holder = OnConnect;
     _fnOnDisconnect_Holder = OnDisconnect;
     _fnOnMarketData_Holder = OnMarketData;
     //_fnOnErrRtnOrderAction_Holder = OnErrRtnOrderAction;
     //_fnOnErrRtnOrderInsert_Holder = OnErrRtnOrderInsert;
     _fnOnRspArbitrageInstrument_Holder = OnRspArbitrageInstrument;
     _fnOnRspError_Holder = OnRspError;
     _fnOnRspCancelOrder_Holder = OnRspCancelOrder;
     _fnOnRspInsertOrder_Holder = OnRspInsertOrder;
     _fnOnRspQryExchangeInstrument_Holder = OnRspQryExchangeInstrument;
     //_fnOnRspQryDepthMarketData_Holder = OnRspQryDepthMarketData;
     //_fnOnRspQryInstrument_Holder = OnRspQryInstrument;
     //_fnOnRspQryInstrumentCommissionRate_Holder = OnRspQryInstrumentCommissionRate;
     //_fnOnRspQryInstrumentMarginRate_Holder = OnRspQryInstrumentMarginRate;
     //_fnOnRspQryInvestorPosition_Holder = OnRspQryInvestorPosition;
     //_fnOnRspQryTradingAccount_Holder = OnRspQryTradingAccount;
     _fnOnRtnCancelOrder_Holder = OnRtnCancelOrder;
     _fnOnRtnExchangeStatus_Holder = OnRtnExchangeStatus;
     //_fnOnRtnDepthMarketData_Holder = OnRtnDepthMarketData;
     _fnOnRtnMatchedInfo_Holder = OnRtnMatchedInfo;
     _fnOnRtnOrder_Holder = OnRtnOrder;
     //_fnOnRtnTrade_Holder = OnRtnTrade;
     _fnOnRspQuoteSubscribe_Holder = OnRspQuoteSubscribe;
     _fnOnRtnQuoteSubscribe_Holder = OnRtnQuoteSubscribe;
 }
Ejemplo n.º 5
0
 private void InitCallbacks()
 {
     //由于回调函数可能被GC回收,所以用成员变量将回调函数保存下来
     _fnOnConnect_Holder    = OnConnect;
     _fnOnDisconnect_Holder = OnDisconnect;
     _fnOnMarketData_Holder = OnMarketData;
     //_fnOnErrRtnOrderAction_Holder = OnErrRtnOrderAction;
     //_fnOnErrRtnOrderInsert_Holder = OnErrRtnOrderInsert;
     _fnOnRspArbitrageInstrument_Holder = OnRspArbitrageInstrument;
     _fnOnRspError_Holder                 = OnRspError;
     _fnOnRspCancelOrder_Holder           = OnRspCancelOrder;
     _fnOnRspInsertOrder_Holder           = OnRspInsertOrder;
     _fnOnRspQryExchangeInstrument_Holder = OnRspQryExchangeInstrument;
     //_fnOnRspQryDepthMarketData_Holder = OnRspQryDepthMarketData;
     //_fnOnRspQryInstrument_Holder = OnRspQryInstrument;
     //_fnOnRspQryInstrumentCommissionRate_Holder = OnRspQryInstrumentCommissionRate;
     //_fnOnRspQryInstrumentMarginRate_Holder = OnRspQryInstrumentMarginRate;
     //_fnOnRspQryInvestorPosition_Holder = OnRspQryInvestorPosition;
     //_fnOnRspQryTradingAccount_Holder = OnRspQryTradingAccount;
     _fnOnRtnCancelOrder_Holder      = OnRtnCancelOrder;
     _fnOnRtnInstrumentStatus_Holder = OnRtnInstrumentStatus;
     //_fnOnRtnDepthMarketData_Holder = OnRtnDepthMarketData;
     _fnOnRtnMatchedInfo_Holder = OnRtnMatchedInfo;
     _fnOnRtnOrder_Holder       = OnRtnOrder;
     //_fnOnRtnTrade_Holder = OnRtnTrade;
     _fnOnRspQuoteSubscribe_Holder = OnRspQuoteSubscribe;
     _fnOnRtnQuoteSubscribe_Holder = OnRtnQuoteSubscribe;
 }
Ejemplo n.º 6
0
        private void InitCallbacks()
        {
            //由于回调函数可能被GC回收,所以用成员变量将回调函数保存下来
            _fnOnConnect_Holder                        = OnConnect;
            _fnOnDisconnect_Holder                     = OnDisconnect;
            _fnOnErrRtnOrderAction_Holder              = OnErrRtnOrderAction;
            _fnOnErrRtnOrderInsert_Holder              = OnErrRtnOrderInsert;
            _fnOnRspError_Holder                       = OnRspError;
            _fnOnRspOrderAction_Holder                 = OnRspOrderAction;
            _fnOnRspOrderInsert_Holder                 = OnRspOrderInsert;
            _fnOnRspQryDepthMarketData_Holder          = OnRspQryDepthMarketData;
            _fnOnRspQryInstrument_Holder               = OnRspQryInstrument;
            _fnOnRspQryInstrumentCommissionRate_Holder = OnRspQryInstrumentCommissionRate;
            _fnOnRspQryInvestorPosition_Holder         = OnRspQryInvestorPosition;
            _fnOnRspQryTradingAccount_Holder           = OnRspQryTradingAccount;
            _fnOnRtnInstrumentStatus_Holder            = OnRtnInstrumentStatus;
            _fnOnRtnDepthMarketData_Holder             = OnRtnDepthMarketData;
            _fnOnRtnOrder_Holder                       = OnRtnOrder;
            _fnOnRtnTrade_Holder                       = OnRtnTrade;

#if CTP
            _fnOnRspQryInstrumentMarginRate_Holder = OnRspQryInstrumentMarginRate;
#endif

            _fnOnRtnForQuoteRsp_Holder    = OnRtnForQuoteRsp;
            _fnOnErrRtnQuoteAction_Holder = OnErrRtnQuoteAction;
            _fnOnErrRtnQuoteInsert_Holder = OnErrRtnQuoteInsert;
            _fnOnRspQuoteAction_Holder    = OnRspQuoteAction;
            _fnOnRspQuoteInsert_Holder    = OnRspQuoteInsert;
            _fnOnRtnQuote_Holder          = OnRtnQuote;
        }
Ejemplo n.º 7
0
 private void InitCallbacks()
 {
     //由于回调函数可能被GC回收,所以用成员变量将回调函数保存下来
     _fnOnConnect_Holder                = OnConnect;
     _fnOnDisconnect_Holder             = OnDisconnect;
     _fnOnErrRtnOrderAction_Holder      = OnErrRtnOrderAction;
     _fnOnErrRtnOrderInsert_Holder      = OnErrRtnOrderInsert;
     _fnOnRspError_Holder               = OnRspError;
     _fnOnRspOrderAction_Holder         = OnRspOrderAction;
     _fnOnRspOrderInsert_Holder         = OnRspOrderInsert;
     _fnOnRspQryInstrument_Holder       = OnRspQryInstrument;
     _fnOnRspQryInvestorPosition_Holder = OnRspQryInvestorPosition;
     _fnOnRspQryTradingAccount_Holder   = OnRspQryTradingAccount;
     _fnOnRtnDepthMarketData_Holder     = OnRtnDepthMarketData;
     _fnOnRtnOrder_Holder               = OnRtnOrder;
     _fnOnRtnTrade_Holder               = OnRtnTrade;
 }
Ejemplo n.º 8
0
 public TraderApiWrapper()
 {
     _fnOnConnect_Holder = OnConnect_callback;
     _fnOnDisconnect_Holder = OnDisconnect_callback;
     _fnOnErrRtnOrderAction_Holder = OnErrRtnOrderAction_callback;
     _fnOnErrRtnOrderInsert_Holder = OnErrRtnOrderInsert_callback;
     _fnOnRspError_Holder = OnRspError_callback;
     _fnOnRspOrderAction_Holder = OnRspOrderAction_callback;
     _fnOnRspOrderInsert_Holder = OnRspOrderInsert_callback;
     _fnOnRspQryDepthMarketData_Holder = OnRspQryDepthMarketData_callback;
     _fnOnRspQryInstrument_Holder = OnRspQryInstrument_callback;
     _fnOnRspQryInstrumentCommissionRate_Holder = OnRspQryInstrumentCommissionRate_callback;
     //_fnOnRspQryInstrumentMarginRate_Holder = OnRspQryInstrumentMarginRate_callback;
     _fnOnRspQryInvestorPosition_Holder = OnRspQryInvestorPosition_callback;
     _fnOnRspQryInvestorPositionDetail_Holder = OnRspQryInvestorPositionDetail_callback;
     _fnOnRspQryOrder_Holder = OnRspQryOrder_callback;
     _fnOnRspQryTrade_Holder = OnRspQryTrade_callback;
     _fnOnRspQryTradingAccount_Holder = OnRspQryTradingAccount_callback;
     _fnOnRtnOrder_Holder = OnRtnOrder_callback;
     _fnOnRtnTrade_Holder = OnRtnTrade_callback;
 }
Ejemplo n.º 9
0
 public TraderApiWrapper()
 {
     _fnOnConnect_Holder                        = OnConnect_callback;
     _fnOnDisconnect_Holder                     = OnDisconnect_callback;
     _fnOnErrRtnOrderAction_Holder              = OnErrRtnOrderAction_callback;
     _fnOnErrRtnOrderInsert_Holder              = OnErrRtnOrderInsert_callback;
     _fnOnRspError_Holder                       = OnRspError_callback;
     _fnOnRspOrderAction_Holder                 = OnRspOrderAction_callback;
     _fnOnRspOrderInsert_Holder                 = OnRspOrderInsert_callback;
     _fnOnRspQryDepthMarketData_Holder          = OnRspQryDepthMarketData_callback;
     _fnOnRspQryInstrument_Holder               = OnRspQryInstrument_callback;
     _fnOnRspQryInstrumentCommissionRate_Holder = OnRspQryInstrumentCommissionRate_callback;
     _fnOnRspQryInstrumentMarginRate_Holder     = OnRspQryInstrumentMarginRate_callback;
     _fnOnRspQryInvestorPosition_Holder         = OnRspQryInvestorPosition_callback;
     _fnOnRspQryInvestorPositionDetail_Holder   = OnRspQryInvestorPositionDetail_callback;
     _fnOnRspQryOrder_Holder                    = OnRspQryOrder_callback;
     _fnOnRspQryTrade_Holder                    = OnRspQryTrade_callback;
     _fnOnRspQryTradingAccount_Holder           = OnRspQryTradingAccount_callback;
     _fnOnRtnInstrumentStatus_Holder            = OnRtnInstrumentStatus_callback;
     _fnOnRtnOrder_Holder                       = OnRtnOrder_callback;
     _fnOnRtnTrade_Holder                       = OnRtnTrade_callback;
 }
Ejemplo n.º 10
0
 public static extern void XSpeed_RegOnRspError(IntPtr pMsgQueue, fnOnRspError pCallback);
Ejemplo n.º 11
0
 private void InitCallbacks()
 {
     //由于回调函数可能被GC回收,所以用成员变量将回调函数保存下来
     _fnOnConnect_Holder = OnConnect;
     _fnOnDisconnect_Holder = OnDisconnect;
     _fnOnErrRtnOrderAction_Holder = OnErrRtnOrderAction;
     _fnOnErrRtnOrderInsert_Holder = OnErrRtnOrderInsert;
     _fnOnRspError_Holder = OnRspError;
     _fnOnRspOrderAction_Holder = OnRspOrderAction;
     _fnOnRspOrderInsert_Holder = OnRspOrderInsert;
     _fnOnRspQryInstrument_Holder = OnRspQryInstrument;
     _fnOnRspQryInvestorPosition_Holder = OnRspQryInvestorPosition;
     _fnOnRspQryTradingAccount_Holder = OnRspQryTradingAccount;
     _fnOnRtnDepthMarketData_Holder = OnRtnDepthMarketData;
     _fnOnRtnOrder_Holder = OnRtnOrder;
     _fnOnRtnTrade_Holder = OnRtnTrade;
 }
Ejemplo n.º 12
0
 public static extern void CTP_RegMDOnRspError(fnOnRspError pCallback);
Ejemplo n.º 13
0
 public static extern void RegisterCallback(fnOnRspError pCallback);