Example #1
0
 public void FireOnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField pInstrumentMarginRate)
 {
     if (null != OnRspQryInstrumentMarginRate)
     {
         OnRspQryInstrumentMarginRate(pInstrumentMarginRate);
     }
 }
 private void OnRspQryInstrumentMarginRate_callback(object sender, ref CThostFtdcInstrumentMarginRateField pInstrumentMarginRate, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
     if (null != OnRspQryInstrumentMarginRate)
     {
         OnRspQryInstrumentMarginRate(this, new OnRspQryInstrumentMarginRateArgs(ref pInstrumentMarginRate, ref pRspInfo, nRequestID, bIsLast));
     }
 }
Example #3
0
 public OnRspQryInstrumentMarginRateArgs(ref CThostFtdcInstrumentMarginRateField pInstrumentMarginRate, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
     this.pInstrumentMarginRate = pInstrumentMarginRate;
     this.pRspInfo   = pRspInfo;
     this.nRequestID = nRequestID;
     this.bIsLast    = bIsLast;
 }
Example #4
0
 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);
            }
        }
Example #6
0
 private void OnRspQryInstrumentMarginRate_3(ref CThostFtdcInstrumentMarginRateField pInstrumentMarginRate, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
     OnRspQryInstrumentMarginRate_1(this, ref pInstrumentMarginRate, ref pRspInfo, nRequestID, bIsLast);
 }
Example #7
0
 private void OnRspQryInstrumentMarginRate_3(IntPtr pTraderApi, ref CThostFtdcInstrumentMarginRateField pInstrumentMarginRate, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
     OnRspQryInstrumentMarginRate_1(this, pTraderApi, ref pInstrumentMarginRate, ref pRspInfo, nRequestID, bIsLast);
 }
Example #8
0
 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));
     }
 }
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CThostFtdcInstrumentMarginRateField obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Example #10
0
 public void SetNativeValue(CThostFtdcInstrumentMarginRateField instrumentMarginRate)
 {
     this.instrumentMarginRate = instrumentMarginRate;
     this.isRefreshMarginRate  = true;
 }
 public override void OnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField pInstrumentMarginRate,
                                                   CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
     _callbackApi.OnRspQryInstrumentMarginRate(pInstrumentMarginRate, pRspInfo, nRequestID, bIsLast);
 }
Example #12
0
 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;
 }
 ///请求查询合约保证金率响应
 public void OnRspQryInstrumentMarginRate(CThostFtdcInstrumentMarginRateField pInstrumentMarginRate,
                                          CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
     Console.WriteLine("OnRspQryInstrumentMarginRate");
 }