예제 #1
0
        /// <summary>
        /// 退订行情
        /// </summary>
        /// <param name="symbols"></param>
        public void UnSubscribeMarketData(string exchangeID, 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.StockUnSubscribe(this._instance, handlers, symbols.Length, exchangeID);
        }
예제 #2
0
        /// <summary>
        /// 订阅行情
        /// </summary>
        /// <param name="symbols"></param>
        public void SubscribeMarketData(string exchangeID, string[] symbols)
        {
            IntPtr[] handlers = new IntPtr[symbols.Length];

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

            CTPWrapper.StockSubscribe(this._instance, handlers, symbols.Length, exchangeID);

            //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.CTPStockProcess(handle, type, p1, p2));
 }
예제 #4
0
 protected override unsafe int ProcessRequest(void *hTrader, int type, void *pReqData, int requestID)
 {
     return(CTPWrapper.CTPStockProcessRequest(hTrader, type, pReqData, requestID));
 }