// CollateralReport message handler private void OnCollateralReport(CollateralReport collateralReport) { Console.WriteLine("OnCollateralReport()"); Console.WriteLine("\tRequestId = {0}", collateralReport.getRequestID()); Console.WriteLine("\tgetAccount() = " + collateralReport.getAccount()); Console.WriteLine("\tgetCashOutstanding() = " + collateralReport.getCashOutstanding()); Console.WriteLine("\tgetStartCash() = " + collateralReport.getStartCash()); Console.WriteLine("\tgetEndCash() = " + collateralReport.getEndCash()); Console.WriteLine("\tgetFXCMMarginCall() = " + collateralReport.getFXCMMarginCall()); Console.WriteLine("\tgetFXCMUsedMargin() = " + collateralReport.getFXCMUsedMargin()); Console.WriteLine("\tgetFXCMUsedMargin3() = " + collateralReport.getFXCMUsedMargin3()); Console.WriteLine("\tgetQuantity() = " + collateralReport.getQuantity()); Console.WriteLine("\tgetParties() = " + collateralReport.getParties()); Console.WriteLine(); // add the trading account to the account list _accounts[collateralReport.getAccount()] = collateralReport; if (collateralReport.getRequestID() == _currentRequest) { // set the state of the request to be completed only if this is the last collateral report requested if (collateralReport.isLastRptRequested()) { _requestAccountListEvent.Set(); } } }
public void OnMessage(CollateralReport message) { Debug.NotNull(this.tradingGateway, nameof(this.tradingGateway)); var inquiryId = message.GetField(Tags.CollRptID); var accountNumber = message.GetField(Tags.Account); this.Logger.LogDebug($"{Received}{Fix} {nameof(CollateralReport)}(InquiryId={inquiryId}, AccountNumber={accountNumber})."); var cashBalance = message.GetDecimal(Tags.CashOutstanding); var cashStartDay = message.GetDecimal(Tags.StartCash); var cashDaily = message.GetDecimal(FxcmTags.CashDaily); var marginUsedMaintenance = message.GetDecimal(FxcmTags.UsedMarginMaintenance); var marginUsedLiq = message.GetDecimal(FxcmTags.UsedMarginLiquidation); var marginRatio = message.GetDecimal(Tags.MarginRatio); var marginCallStatus = message.GetField(FxcmTags.MarginCall); var accountEvent = new AccountStateEvent( this.accountId, this.accountCurrency, Money.Create(cashBalance, this.accountCurrency), Money.Create(cashStartDay, this.accountCurrency), Money.Create(cashDaily, this.accountCurrency), Money.Create(marginUsedLiq, this.accountCurrency), Money.Create(marginUsedMaintenance, this.accountCurrency), marginRatio, marginCallStatus, this.NewGuid(), this.TimeNow()); this.tradingGateway?.Send(accountEvent); }
/// <summary> /// CollateralReport message handler /// </summary> private void OnCollateralReport(CollateralReport message) { // add the trading account to the account list _accounts[message.getAccount()] = message; if (message.getRequestID() == _currentRequest) { // set the state of the request to be completed only if this is the last collateral report requested if (message.isLastRptRequested()) { _mapRequestsToAutoResetEvents[_currentRequest].Set(); _mapRequestsToAutoResetEvents.Remove(_currentRequest); } } }
public virtual void onMessage(CollateralReport message, QuickFix.SessionID session) { throw new QuickFix.UnsupportedMessageType(); }
// CollateralReport message handler private void OnCollateralReport(CollateralReport collateralReport) { Console.WriteLine("OnCollateralReport()"); Console.WriteLine("\tRequestId = {0}", collateralReport.getRequestID()); Console.WriteLine("\tgetAccount() = " + collateralReport.getAccount()); Console.WriteLine("\tgetCashOutstanding() = " + collateralReport.getCashOutstanding()); Console.WriteLine("\tgetStartCash() = " + collateralReport.getStartCash()); Console.WriteLine("\tgetEndCash() = " + collateralReport.getEndCash()); Console.WriteLine("\tgetFXCMMarginCall() = " + collateralReport.getFXCMMarginCall()); Console.WriteLine("\tgetFXCMUsedMargin() = " + collateralReport.getFXCMUsedMargin()); Console.WriteLine("\tgetFXCMUsedMargin3() = " + collateralReport.getFXCMUsedMargin3()); Console.WriteLine("\tgetQuantity() = " + collateralReport.getQuantity()); Console.WriteLine("\tgetParties() = " + collateralReport.getParties()); Console.WriteLine(); // add the trading account to the account list _accounts[collateralReport.getAccount()] = collateralReport; if (collateralReport.getRequestID() == _currentRequest) { // set the state of the request to be completed only if this is the last collateral report requested if (collateralReport.isLastRptRequested()) _requestAccountListEvent.Set(); } }
/// <summary> /// Handles <see cref="CollateralReport"/> messages. /// </summary> /// <param name="message">The FIX message.</param> /// <param name="sessionId">The session identifier.</param> public void OnMessage(CollateralReport message, SessionID sessionId) { this.FixMessageHandler.OnMessage(message); }