예제 #1
0
        // 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();
                }
            }
        }
예제 #2
0
        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);
        }
예제 #3
0
        /// <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);
                }
            }
        }
예제 #4
0
        /// <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);
                }
            }
        }
예제 #5
0
 public virtual void onMessage(CollateralReport message, QuickFix.SessionID session)
 {
     throw new QuickFix.UnsupportedMessageType();
 }
예제 #6
0
파일: FxcmTester.cs 프로젝트: Anhmike/FXCM
        // 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();
            }
        }
예제 #7
0
 /// <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);
 }