Пример #1
0
 public void Unsubscribe(string inst, string exchange)
 {
     lock (_lockMd)
     {
         if (null != m_pMdApi && IntPtr.Zero != m_pMdApi)
         {
             MdApi.MD_Unsubscribe(m_pMdApi, inst, exchange);
         }
     }
 }
Пример #2
0
 //建立行情
 private void Connect_MD()
 {
     lock (_lockMd)
     {
         if (null == m_pMdApi || IntPtr.Zero == m_pMdApi)
         {
             m_pMdApi = MdApi.MD_CreateMdApi();
             MdApi.CTP_RegOnRtnDepthMarketData(m_pMsgQueue, _fnOnRtnDepthMarketData_Holder);
             MdApi.MD_RegMsgQueue2MdApi(m_pMdApi, m_pMsgQueue);
             MdApi.MD_Connect(m_pMdApi, szPath, szAddresses, szBrokerId, szInvestorId, szPassword);
         }
     }
 }
Пример #3
0
 private void Disconnect_MD()
 {
     lock (_lockMd)
     {
         if (null != m_pMdApi && IntPtr.Zero != m_pMdApi)
         {
             MdApi.MD_RegMsgQueue2MdApi(m_pMdApi, IntPtr.Zero);
             MdApi.MD_ReleaseMdApi(m_pMdApi);
             m_pMdApi = IntPtr.Zero;
         }
         _bMdConnected = false;
     }
 }