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