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