예제 #1
0
 protected override void OnRtnOrder(CLRDFITCOrderRtnField RtnOrderData)
 {
     if (ProgramTradeEvents.RspEventHandler.ContainsKey(RspSpiModules.RtnOrder) && null != ProgramTradeEvents.RspEventHandler[RspSpiModules.RtnOrder])
     {
         TypedRspEventArgs <CLRDFITCOrderRtnField, object> evt = new TypedRspEventArgs <CLRDFITCOrderRtnField, object> {
             RequestID = -1, ErrorID = 0, Message = RtnOrderData.statusMsg, Data = RtnOrderData, Error = null, IsLast = true
         };
         Parallel.ForEach(ProgramTradeEvents.RspEventHandler[RspSpiModules.RtnOrder].GetInvocationList(), handler =>
         {
             (handler as EventHandler <RspEventArgs>).BeginInvoke(this, evt, null, null);
         });
     }
 }
예제 #2
0
 protected override void OnRspQryOrderInfo(CLRDFITCOrderCommRtnField OrderData, CLRDFITCErrorRtnField ErrorInfo, bool bIsLast)
 {
     if (ProgramTradeEvents.RspEventHandler.ContainsKey(RspSpiModules.QryOrders) && null != ProgramTradeEvents.RspEventHandler[RspSpiModules.QryOrders])
     {
         TypedRspEventArgs <CLRDFITCOrderCommRtnField, CLRDFITCErrorRtnField> evt = new TypedRspEventArgs <CLRDFITCOrderCommRtnField, CLRDFITCErrorRtnField> {
             RequestID = OrderData.lRequestID, ErrorID = ErrorInfo.nErrorID, Message = ErrorInfo.errorMsg, Data = OrderData, Error = ErrorInfo, IsLast = bIsLast
         };
         Parallel.ForEach(ProgramTradeEvents.RspEventHandler[RspSpiModules.QryOrders].GetInvocationList(), handler =>
         {
             (handler as EventHandler <RspEventArgs>).BeginInvoke(this, evt, null, null);
         });
     }
 }
예제 #3
0
 protected override void OnFrontConnected()
 {
     if (ProgramTradeEvents.RspEventHandler.ContainsKey(RspSpiModules.FrontConnected) && null != ProgramTradeEvents.RspEventHandler[RspSpiModules.FrontConnected])
     {
         TypedRspEventArgs <object, object> evt = new TypedRspEventArgs <object, object> {
             RequestID = -1, ErrorID = 0, Message = "交易前置连接成功", Data = null, Error = null, IsLast = true
         };
         Parallel.ForEach(ProgramTradeEvents.RspEventHandler[RspSpiModules.FrontConnected].GetInvocationList(), handler =>
         {
             (handler as EventHandler <RspEventArgs>).BeginInvoke(this, evt, null, null);
         });
     }
 }
예제 #4
0
 protected override void OnMarketData(CLRDFITCDepthMarketDataField MarketDataField)
 {
     if (ProgramTradeEvents.RspEventHandler.ContainsKey(RspSpiModules.RtnMarket) && null != ProgramTradeEvents.RspEventHandler[RspSpiModules.RtnMarket])
     {
         TypedRspEventArgs <CLRDFITCDepthMarketDataField, object> evt = new TypedRspEventArgs <CLRDFITCDepthMarketDataField, object> {
             RequestID = 0, ErrorID = 0, Message = MarketDataField.instrumentID, Data = MarketDataField, Error = null, IsLast = true
         };
         Parallel.ForEach(ProgramTradeEvents.RspEventHandler[RspSpiModules.RtnMarket].GetInvocationList(), handler =>
         {
             (handler as EventHandler <RspEventArgs>).BeginInvoke(this, evt, null, null);
         });
     }
 }
예제 #5
0
 protected override void OnRspCancelOrder(CLRDFITCOrderRspDataRtnField RspOrderCancel, CLRDFITCErrorRtnField ErrorInfo)
 {
     if (ProgramTradeEvents.RspEventHandler.ContainsKey(RspSpiModules.CancelOrder) && null != ProgramTradeEvents.RspEventHandler[RspSpiModules.CancelOrder])
     {
         TypedRspEventArgs <CLRDFITCOrderRspDataRtnField, CLRDFITCErrorRtnField> evt = new TypedRspEventArgs <CLRDFITCOrderRspDataRtnField, CLRDFITCErrorRtnField> {
             RequestID = RspOrderCancel.lRequestID, ErrorID = ErrorInfo.nErrorID, Message = ErrorInfo.errorMsg, Data = RspOrderCancel, Error = ErrorInfo, IsLast = true
         };
         Parallel.ForEach(ProgramTradeEvents.RspEventHandler[RspSpiModules.CancelOrder].GetInvocationList(), handler =>
         {
             (handler as EventHandler <RspEventArgs>).BeginInvoke(this, evt, null, null);
         });
     }
 }
예제 #6
0
 protected override void OnRspSubMarketData(CLRDFITCSpecificInstrumentField SpecificInstrument, CLRDFITCErrorRtnField RspInfo)
 {
     if (ProgramTradeEvents.RspEventHandler.ContainsKey(RspSpiModules.SubMarket) && null != ProgramTradeEvents.RspEventHandler[RspSpiModules.SubMarket])
     {
         TypedRspEventArgs <CLRDFITCSpecificInstrumentField, CLRDFITCErrorRtnField> evt = new TypedRspEventArgs <CLRDFITCSpecificInstrumentField, CLRDFITCErrorRtnField> {
             RequestID = SpecificInstrument.lRequestID, ErrorID = RspInfo.nErrorID, Message = RspInfo.errorMsg, Data = SpecificInstrument, Error = RspInfo, IsLast = true
         };
         Parallel.ForEach(ProgramTradeEvents.RspEventHandler[RspSpiModules.SubMarket].GetInvocationList(), handler =>
         {
             (handler as EventHandler <RspEventArgs>).BeginInvoke(this, evt, null, null);
         });
     }
 }