Пример #1
0
 public static void _client_RspError(CTP_CLI.CThostFtdcRspInfoField_M pRspInfo, int nRequestID, bool bIsLast)
 {
     throw new NotImplementedException();
 }
Пример #2
0
 /// <summary>
 /// 提交报单请求响应处理函数, 当报单内容有问题时,通过该函数响应
 /// </summary>
 /// <param name="pInputOrderAction">报单请求内容</param>
 /// <param name="pRspInfo">返回信息</param>
 /// <param name="nRequestID"></param>
 /// <param name="bIsLast"></param>
 public static void _client_RspOrderAction(CTP_CLI.CThostFtdcInputOrderActionField_M pInputOrderAction,
                                           CTP_CLI.CThostFtdcRspInfoField_M pRspInfo, int nRequestID, bool bIsLast)
 {
     GlobalErrorLog.LogInstance.LogEvent("期货报单失败," + pRspInfo.ErrorMsg);
 }
Пример #3
0
 /// <summary>
 /// 登陆成功回掉函数
 /// </summary>
 /// <param name="pRspUserLogin">用户登录信息结构</param>
 /// <param name="pRspInfo">返回用户响应信息</param>
 /// <param name="nRequestID">返回用户登录请求的ID,该ID 由用户在登录时指定。</param>
 /// <param name="bIsLast">指示该次返回是否为针对nRequestID的最后一次返回。</param>
 public static void _client_RspUserLogin(CTP_CLI.CThostFtdcRspUserLoginField_M pRspUserLogin, CTP_CLI.CThostFtdcRspInfoField_M pRspInfo, int nRequestID, bool bIsLast)
 {
     if (pRspInfo.ErrorID == 0 && bIsLast == true)
     {
         status = FutureTradeThreadStatus.LOGIN;
     }
     //throw new NotImplementedException();
 }
Пример #4
0
 /// <summary>
 /// 交易提交出现问题回掉函数
 /// </summary>
 /// <param name="pInputOrder"></param>
 /// <param name="pRspInfo"></param>
 /// <param name="nRequestID"></param>
 /// <param name="bIsLast"></param>
 public static void _client_RspOrderInsert(CTP_CLI.CThostFtdcInputOrderField_M pInputOrder, CTP_CLI.CThostFtdcRspInfoField_M pRspInfo, int nRequestID, bool bIsLast)
 {
     TradeRecord.GetInstance().MarkFailure(Convert.ToInt16(pInputOrder.OrderRef), pRspInfo.ErrorMsg);
     if (pInputOrder.CombOffsetFlag_0 == (byte)(FutureTradeOffSet.Open))
     {
         //只有开仓涉及冻结资金
         //交易失败,需要释放冻结掉的期货交易资金
         accountMonitor.UpdateRiskFrozonAccount(pInputOrder.UserID, pInputOrder.InstrumentID, pInputOrder.VolumeTotalOriginal * (-1), pInputOrder.VolumeTotalOriginal * pInputOrder.LimitPrice * (-1), "F", pInputOrder.Direction.ToString());
     }
 }