public void FireOnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField pInstrumentMarginRate) { if (null != OnRspQryInstrumentMarginRate) { OnRspQryInstrumentMarginRate(pInstrumentMarginRate); } }
void OnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField pInstrumentMarginRate) { Console.WriteLine("==保证金率"); Console.WriteLine(pInstrumentMarginRate.InstrumentID); Console.WriteLine(pInstrumentMarginRate.LongMarginRatioByMoney); Console.WriteLine(pInstrumentMarginRate.LongMarginRatioByVolume); Console.WriteLine(pInstrumentMarginRate.ShortMarginRatioByMoney); Console.WriteLine(pInstrumentMarginRate.ShortMarginRatioByVolume); }
private void OnRspQryInstrumentMarginRate(IntPtr pTraderApi, ref CThostFtdcInstrumentMarginRateField pInstrumentMarginRate, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { if (0 == pRspInfo.ErrorID) { _dictMarginRate[pInstrumentMarginRate.InstrumentID] = pInstrumentMarginRate; tdlog.Info("已经接收保证金率 {0}", pInstrumentMarginRate.InstrumentID); //通知单例 CTPAPI.GetInstance().FireOnRspQryInstrumentMarginRate(pInstrumentMarginRate); } else { tdlog.Error("nRequestID:{0},ErrorID:{1},OnRspQryInstrumentMarginRate:{2}", nRequestID, pRspInfo.ErrorID, pRspInfo.ErrorMsg); EmitError(nRequestID, pRspInfo.ErrorID, "OnRspQryInstrumentMarginRate:" + pRspInfo.ErrorMsg); } }
private void OnRspQryInstrumentMarginRate_callback(IntPtr pTraderApi, ref CThostFtdcInstrumentMarginRateField pInstrumentMarginRate, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { if (null != OnRspQryInstrumentMarginRate) { OnRspQryInstrumentMarginRate(this, new OnRspQryInstrumentMarginRateArgs(pTraderApi, ref pInstrumentMarginRate, ref pRspInfo, nRequestID, bIsLast)); } }
public OnRspQryInstrumentMarginRateArgs(IntPtr pTraderApi, ref CThostFtdcInstrumentMarginRateField pInstrumentMarginRate, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { this.pTraderApi = pTraderApi; this.pInstrumentMarginRate = pInstrumentMarginRate; this.pRspInfo = pRspInfo; this.nRequestID = nRequestID; this.bIsLast = bIsLast; }