Пример #1
0
        /// <summary>
        /// To calculate commission.
        /// </summary>
        /// <param name="message">The message containing the information about the order or own trade.</param>
        /// <returns>The commission. If the commission can not be calculated then <see langword="null" /> will be returned.</returns>
        protected override decimal?OnProcessExecution(ExecutionMessage message)
        {
            if (message.HasTradeInfo() && message.SecurityId.BoardCode.CompareIgnoreCase(BoardCode))
            {
                return((decimal)Value);
            }

            return(null);
        }
Пример #2
0
        /// <summary>
        /// To calculate commission.
        /// </summary>
        /// <param name="message">The message containing the information about the order or own trade.</param>
        /// <returns>The commission. If the commission can not be calculated then <see langword="null" /> will be returned.</returns>
        protected override decimal?OnProcessExecution(ExecutionMessage message)
        {
            if (message.HasTradeInfo() && message.SecurityId.SecurityType == SecurityType)
            {
                return((decimal)Value);
            }

            return(null);
        }
Пример #3
0
        /// <summary>
        /// To calculate commission.
        /// </summary>
        /// <param name="message">The message containing the information about the order or own trade.</param>
        /// <returns>The commission. If the commission can not be calculated then <see langword="null" /> will be returned.</returns>
        protected override decimal?OnProcessExecution(ExecutionMessage message)
        {
            if (message.HasTradeInfo())
            {
                return((decimal)(message.TradePrice * message.TradeVolume * Value));
            }

            return(null);
        }
Пример #4
0
        /// <summary>
        /// To calculate commission.
        /// </summary>
        /// <param name="message">The message containing the information about the order or own trade.</param>
        /// <returns>The commission. If the commission can not be calculated then <see langword="null" /> will be returned.</returns>
        protected override decimal?OnProcessExecution(ExecutionMessage message)
        {
            if (message.HasTradeInfo())
            {
                return((decimal)Value);
            }

            return(null);
        }
Пример #5
0
        /// <inheritdoc />
        protected override decimal?OnProcessExecution(ExecutionMessage message)
        {
            if (message.HasTradeInfo())
            {
                return(GetValue(message.TradePrice));
            }

            return(null);
        }
Пример #6
0
        /// <summary>
        /// To calculate commission.
        /// </summary>
        /// <param name="message">The message containing the information about the order or own trade.</param>
        /// <returns>The commission. If the commission can not be calculated then <see langword="null" /> will be returned.</returns>
        protected override decimal?OnProcessExecution(ExecutionMessage message)
        {
            if (!message.HasTradeInfo())
            {
                return(null);
            }

            if (++_currentCount < Count)
            {
                return(null);
            }

            _currentCount = 0;
            return((decimal)Value);
        }
Пример #7
0
        /// <summary>
        /// To calculate commission.
        /// </summary>
        /// <param name="message">The message containing the information about the order or own trade.</param>
        /// <returns>The commission. If the commission can not be calculated then <see langword="null" /> will be returned.</returns>
        protected override decimal?OnProcessExecution(ExecutionMessage message)
        {
            if (!message.HasTradeInfo())
            {
                return(null);
            }

            _currentTurnOver += message.GetTradePrice() * message.SafeGetVolume();

            if (_currentTurnOver < TurnOver)
            {
                return(null);
            }

            return((decimal)Value);
        }
		private void ProcessTransactionMessage(Order order, Security security, ExecutionMessage message, long transactionId)
		{
			var processed = false;

			if (message.HasOrderInfo())
			{
				processed = true;
				ProcessOrderMessage(order, security, message, transactionId);
			}

			if (message.HasTradeInfo())
			{
				processed = true;
				ProcessMyTradeMessage(order, security, message, transactionId);
			}

			if (!processed)
				throw new ArgumentOutOfRangeException(LocalizedStrings.Str1695Params.Put(message.ExecutionType));
		}