コード例 #1
0
ファイル: CTPAPI.cs プロジェクト: shalang/OpenQuant-CTP
 public void FireOnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField pInstrumentMarginRate)
 {
     if (null != OnRspQryInstrumentMarginRate)
     {
         OnRspQryInstrumentMarginRate(pInstrumentMarginRate);
     }
 }
コード例 #2
0
ファイル: CTP_code.cs プロジェクト: vcfriend/OpenQuant
 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);
 }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
ファイル: TraderApiWrapper.cs プロジェクト: nanwsn/CTP
 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));
     }
 }
コード例 #5
0
ファイル: EventArgs.cs プロジェクト: fouvy/CTP
 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;
 }