/// <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; }
/// <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; }
/// <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; }
/// <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; }
/// <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; }
/// <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; }