private void CTPOnRspSubMarketData(ref CThostFtdcSpecificInstrumentField pSpecificInstrument, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { String ID = pSpecificInstrument.InstrumentID; String ERROR = pRspInfo.ErrorMsg; int R_ID = nRequestID; bool IsL = bIsLast; HaiFeng.MarketData tick = DicTick.GetOrAdd(ID, new HaiFeng.MarketData { InstrumentID = ID, }); if (_OnRtnTick == null) { return; } _OnRtnTick(this, new TickEventArgs { Tick = tick }); }
/// <summary> /// 对于订阅市场深度信息查询的回报 /// </summary> /// <param name="pSpecificInstrument"></param> /// <param name="pRspInfo"></param> /// <param name="nRequestID"></param> /// <param name="bIsLast"></param> private void CMdApi_OnRspSubMarketData(ref CThostFtdcSpecificInstrumentField pSpecificInstrument, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { //添加未重复的订阅过的合约代码 if (pRspInfo.ErrorID == 0 && !this._ListSubscribedInstrumentIDs.Contains(pSpecificInstrument.InstrumentID)) { this._ListSubscribedInstrumentIDs.Add(pSpecificInstrument.InstrumentID); } }
public virtual void OnRspUnSubForQuoteRsp(CThostFtdcSpecificInstrumentField pSpecificInstrument, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { if (SwigDerivedClassHasMethod("OnRspUnSubForQuoteRsp", swigMethodTypes9)) { thostmdapiPINVOKE.CThostFtdcMdSpi_OnRspUnSubForQuoteRspSwigExplicitCThostFtdcMdSpi(swigCPtr, CThostFtdcSpecificInstrumentField.getCPtr(pSpecificInstrument), CThostFtdcRspInfoField.getCPtr(pRspInfo), nRequestID, bIsLast); } else { thostmdapiPINVOKE.CThostFtdcMdSpi_OnRspUnSubForQuoteRsp(swigCPtr, CThostFtdcSpecificInstrumentField.getCPtr(pSpecificInstrument), CThostFtdcRspInfoField.getCPtr(pRspInfo), nRequestID, bIsLast); } }
public virtual void OnRspUnSubMarketData(CThostFtdcSpecificInstrumentField pSpecificInstrument, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { if (SwigDerivedClassHasMethod("OnRspUnSubMarketData", swigMethodTypes7)) { CTPMarketCppWrapperPINVOKE.CThostFtdcMdSpi_OnRspUnSubMarketDataSwigExplicitCThostFtdcMdSpi(swigCPtr, CThostFtdcSpecificInstrumentField.getCPtr(pSpecificInstrument), CThostFtdcRspInfoField.getCPtr(pRspInfo), nRequestID, bIsLast); } else { CTPMarketCppWrapperPINVOKE.CThostFtdcMdSpi_OnRspUnSubMarketData(swigCPtr, CThostFtdcSpecificInstrumentField.getCPtr(pSpecificInstrument), CThostFtdcRspInfoField.getCPtr(pRspInfo), nRequestID, bIsLast); } }
public override void OnRspSubMarketData(CThostFtdcSpecificInstrumentField pSpecificInstrument, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { if (pRspInfo.ErrorID != 0) { Console.WriteLine("OnRspSubMarketData Error: {0}", pRspInfo.ErrorMsg); } else { Console.WriteLine("OnRspSubMarketData"); } }
private void CMdApi_OnRspSubMarketData(ref CThostFtdcSpecificInstrumentField pSpecificInstrument, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { if (bIsLast) {//【注】由于效率问题,我最后决定不使用固定数量的处理任务线程! //使用默认数量处理任务来处理行情数据队列。 //Task[] taskProcessors = new Task[_processorNumber]; //for (int i = 0; i < _processorNumber; i++) //{ // string processorId = i.ToString(); // taskProcessors[i] = Task.Run(() => TaskProcessor(this._queueDepthMarketDataField, _cts.Token)); //} } }
public override void OnRspUnSubscribeQuote(uint sessionID, int errorCode, char isLast, TapAPIContract info) { var field = new CThostFtdcSpecificInstrumentField() { InstrumentID = info.Commodity.CommodityNo + info.ContractNo1 }; var rspInfoField = new CThostFtdcRspInfoField() { ErrorID = errorCode }; _callbackApi.OnRspUnSubMarketData(field, rspInfoField, 0, true); }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CThostFtdcSpecificInstrumentField obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }
private void CTPOnRspSubMarketData(ref CThostFtdcSpecificInstrumentField pSpecificInstrument, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { }
/// <summary> /// 订阅行情应答 /// </summary> internal void OnSubMarketData(IntPtr pSpecificInstrument, IntPtr pRspInfo, int nRequestID, bool bIsLast) { CThostFtdcSpecificInstrumentField instrument = PInvokeUtility.GetObjectFromIntPtr <CThostFtdcSpecificInstrumentField>(pSpecificInstrument); }
static void onRspSubMarketDataCallback(ref CThostFtdcSpecificInstrumentField pSpecificInstrument, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { Console.WriteLine(pRspInfo.ErrorID.ToString(), pRspInfo.ErrorMsg.ToString()); }
public void OnRspUnSubForQuoteRsp(CThostFtdcSpecificInstrumentField pSpecificInstrument, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { Console.WriteLine("OnRspUnSubForQuoteRsp"); }
private void CTPOnRspSubForQuoteRsp(ref CThostFtdcSpecificInstrumentField pSpecificInstrument, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { String a = pSpecificInstrument.InstrumentID; }
public override void OnRspUnSubMarketData(CThostFtdcSpecificInstrumentField pSpecificInstrument, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { _callbackApi.OnRspUnSubMarketData(pSpecificInstrument, pRspInfo, nRequestID, bIsLast); }
public override void OnRspSubForQuoteRsp(CThostFtdcSpecificInstrumentField pSpecificInstrument, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { _callbackApi.OnRspSubForQuoteRsp(pSpecificInstrument, pRspInfo, nRequestID, bIsLast); }
/// <summary> /// 退订行情响应 /// </summary> /// <param name="pSpecificInstrument"></param> /// <param name="pRspInfo"></param> /// <param name="nRequestID"></param> /// <param name="bIsLast"></param> public virtual void OnRspUnSubMarketData(ref CThostFtdcSpecificInstrumentField pSpecificInstrument, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { }
public void OnRspSubMarketData(CThostFtdcSpecificInstrumentField pSpecificInstrument, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { Console.WriteLine("OnRspSubMarketData"); }