示例#1
0
        /// <summary>
        /// 退订行情
        /// </summary>
        /// <param name="symbols"></param>
        public void UnSubscribeMarketData(string[] symbols)
        {
            if (symbols == null || symbols.Length == 0)
            {
                return;
            }

            IntPtr[] handlers = new IntPtr[symbols.Length];

            for (int i = 0; i < symbols.Length; i++)
            {
                handlers[i] = Marshal.StringToHGlobalAnsi(symbols[i]);
            }

            CTPWrapper.UnSubscribeMarketData(this._instance, handlers, symbols.Length);
        }
示例#2
0
        /// <summary>
        /// 订阅行情
        /// </summary>
        /// <param name="symbols"></param>
        public void SubscribeMarketData(string[] symbols)
        {
            IntPtr[] handlers = new IntPtr[symbols.Length];

            for (int i = 0; i < symbols.Length; i++)
            {
                handlers[i] = Marshal.StringToHGlobalAnsi(symbols[i]);
            }

            CTPWrapper.SubscribeMarketData(this._instance, handlers, symbols.Length);

            //StringBuilder buffer = new StringBuilder();

            //foreach (var item in symbols)
            //{
            //  buffer.Append(item).Append('\0');
            //}

            //CTPWrapper.Process(this._instance, (int)CTPRequestAction.MarketDataSubscribeMarketData, symbols.Length, buffer);
        }
示例#3
0
 protected override int Process(IntPtr handle, int type, int p1, StringBuilder p2)
 {
     return(CTPWrapper.Process(handle, type, p1, p2));
 }
示例#4
0
 protected override unsafe int ProcessRequest(void *hTrader, int type, void *pReqData, int requestID)
 {
     return(CTPWrapper.ProcessRequest(hTrader, type, pReqData, requestID));
 }