public OnRspQryTradingAccountArgs(ref CThostFtdcTradingAccountField pTradingAccount, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { this.pTradingAccount = pTradingAccount; this.pRspInfo = pRspInfo; this.nRequestID = nRequestID; this.bIsLast = bIsLast; }
public void FireOnRspQryTradingAccount(CThostFtdcTradingAccountField pTradingAccount) { if (null != OnRspQryTradingAccount) { OnRspQryTradingAccount(pTradingAccount); } }
private void OnRspQryTradingAccount_callback(object sender, ref CThostFtdcTradingAccountField pTradingAccount, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { if (null != OnRspQryTradingAccount) { OnRspQryTradingAccount(this, new OnRspQryTradingAccountArgs(ref pTradingAccount, ref pRspInfo, nRequestID, bIsLast)); } }
private void CTPOnRspQryTradingAccount(ref CThostFtdcTradingAccountField pTradingAccount, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { if (!string.IsNullOrEmpty(pTradingAccount.AccountID)) { TradingAccount.Available = pTradingAccount.Available; //this.TradingAccount.CashIn = pTradingAccount.CashIn; //资金查额 TradingAccount.CloseProfit = pTradingAccount.CloseProfit; TradingAccount.Commission = pTradingAccount.Commission; TradingAccount.CurrMargin = pTradingAccount.CurrMargin; //this.TradingAccount.DeliveryMargin = pTradingAccount.DeliveryMargin; TradingAccount.FrozenCash = pTradingAccount.FrozenCash; TradingAccount.PositionProfit = pTradingAccount.PositionProfit; TradingAccount.PreBalance = pTradingAccount.PreBalance + pTradingAccount.Deposit - pTradingAccount.Withdraw; //this.TradingAccount.Reserve = pTradingAccount.Reserve; //this.TradingAccount.WithdrawQuota = pTradingAccount.WithdrawQuota;//可取 TradingAccount.Fund = TradingAccount.PreBalance //静态权益 + pTradingAccount.CloseProfit + pTradingAccount.PositionProfit - pTradingAccount.Commission; //动态权益 TradingAccount.Risk = TradingAccount.CurrMargin / TradingAccount.Fund; } if (bIsLast) { //首次查询后启动循环查询 if (!IsLogin) { } } }
/// <summary> /// 查询交易账户的回报 /// </summary> /// <param name="pTradingAccount"></param> /// <param name="pRspInfo"></param> /// <param name="nRequestID"></param> /// <param name="bIsLast"></param> private void CTradeApi_OnRspQryTradingAccount(ref CThostFtdcTradingAccountField pTradingAccount, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { this._taf.CThostFtdcTradingAccountFieldInstance = pTradingAccount; if (bIsLast) { this._OnTradingAccount?.Invoke(this._taf); } this._isQryTradingAccountCompleted = bIsLast; }
private void OnRspQryTradingAccount(IntPtr pTraderApi, ref CThostFtdcTradingAccountField pTradingAccount, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLastt) { if (0 == pRspInfo.ErrorID) { m_TradingAccount = pTradingAccount; //有资金信息过来了,重新计时 timerAccount.Enabled = false; timerAccount.Enabled = true; } else { EmitError(nRequestID, pRspInfo.ErrorID, "OnRspQryTradingAccount:" + pRspInfo.ErrorMsg); } }
private void OnRspQryTradingAccount(IntPtr pTraderApi, ref CThostFtdcTradingAccountField pTradingAccount, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLastt) { if (0 == pRspInfo.ErrorID) { m_TradingAccount = pTradingAccount; //有资金信息过来了,重新计时 timerAccount.Enabled = false; timerAccount.Enabled = true; //通知单例,还是使用GetBrokerInfo来取呢? CTPAPI.GetInstance().__RegTradingAccount(m_TradingAccount); CTPAPI.GetInstance().FireOnRspQryTradingAccount(pTradingAccount); } else { tdlog.Error("nRequestID:{0},ErrorID:{1},OnRspQryTradingAccount:{2}", nRequestID, pRspInfo.ErrorID, pRspInfo.ErrorMsg); EmitError(nRequestID, pRspInfo.ErrorID, "OnRspQryTradingAccount:" + pRspInfo.ErrorMsg); } }
public TradeAccount(CThostFtdcTradingAccountField cftaf) { this.CThostFtdcTradingAccountFieldInstance = cftaf; }
private void OnRspQryTradingAccount_3(IntPtr pTraderApi, ref CThostFtdcTradingAccountField pTradingAccount, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { OnRspQryTradingAccount_1(this, pTraderApi, ref pTradingAccount, ref pRspInfo, nRequestID, bIsLast); }
private void OnRspQryTradingAccount_3(ref CThostFtdcTradingAccountField pTradingAccount, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { OnRspQryTradingAccount_1(this, ref pTradingAccount, ref pRspInfo, nRequestID, bIsLast); }
///请求查询资金账户响应 public void OnRspQryTradingAccount(CThostFtdcTradingAccountField pTradingAccount, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { Console.WriteLine("OnRspQryTradingAccount"); }
private void OnRspQryTradingAccount_callback(IntPtr pTraderApi, ref CThostFtdcTradingAccountField pTradingAccount, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { if (null != OnRspQryTradingAccount) { OnRspQryTradingAccount(this, new OnRspQryTradingAccountArgs(pTraderApi, ref pTradingAccount, ref pRspInfo, nRequestID, bIsLast)); } }
public override void OnRspQryTradingAccount(CThostFtdcTradingAccountField pTradingAccount, CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { _callbackApi.OnRspQryTradingAccount(pTradingAccount, pRspInfo, nRequestID, bIsLast); }
void OnRspQryTradingAccount(CThostFtdcTradingAccountField pTradingAccount) { Console.WriteLine("==资金"); Console.WriteLine(pTradingAccount.Balance); Console.WriteLine(pTradingAccount.TradingDay); }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CThostFtdcTradingAccountField obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }
public OnRspQryTradingAccountArgs(IntPtr pTraderApi, ref CThostFtdcTradingAccountField pTradingAccount, ref CThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast) { this.pTraderApi = pTraderApi; this.pTradingAccount = pTradingAccount; this.pRspInfo = pRspInfo; this.nRequestID = nRequestID; this.bIsLast = bIsLast; }
public void __RegTradingAccount(CThostFtdcTradingAccountField pTradingAccount) { TradingAccount = pTradingAccount; }