public virtual bool IsExcluded(IAverageHolding holding)
 {
     if (ExcludedInstrumentInfoDetails != null)
     {
         foreach (FeeCalcExcludedInstrumentInfoDetail detail in ExcludedInstrumentInfoDetails)
         {
             if (detail.IsExcluded(holding))
                 return true;
         }
     }
     return false;
 }
Example #2
0
        /// <summary>
        /// Constructor of AverageHoldingFee object
        /// </summary>
        /// <param name="parent">The holding this fee item belongs to</param>
        /// <param name="unit">The holding this fee item belongs to</param>
        /// <param name="feeType">The type of MgtFee</param>
        /// <param name="calculatedAmount">The (total) value calculated</param>
        /// <param name="prevCalcAmount">The value already charged</param>
        /// <param name="calcSource">The source of the calculation</param>
        /// <param name="feePercentageUsed">The fee Percentage Used in the calculation</param>
        public AverageHoldingFee(IAverageHolding parent, IManagementPeriodUnit unit, FeeType feeType, Money calculatedAmount, Money prevCalcAmount, IFeeCalcVersion calcSource, decimal feePercentageUsed)
        {
            this.Parent = parent;
            this.Unit = unit;
            this.FeeType = feeType;
            this.Amount = calculatedAmount - prevCalcAmount;
            this.CalculatedAmount = calculatedAmount;
            this.FeePercentageUsed = feePercentageUsed;

            if (calcSource != null)
            {
                this.calcSource = calcSource;
                calcSourceKey = calcSource.Key;
            }
        }
 public virtual bool IsExcluded(IAverageHolding holding)
 {
     bool excluded = false;
     if ((Instrument != null && holding.Instrument.Equals(Instrument)) ||
         (SecCategory != null && holding.Instrument.SecCategory.Key.Equals(SecCategory.Key)))
     {
         if (SignValue == SignValues.All)
             excluded = true;
         else if (SignValue == SignValues.Negative && !holding.AverageValue.Sign)
             excluded = true;
         else if (SignValue == SignValues.Positive && holding.AverageValue.Sign)
             excluded = true;
     }
     return excluded;
 }
Example #4
0
 protected bool isHoldingIncluded(IAverageHolding holding)
 {
     if (ExcludedInstrumentInfo == null)
         return true;
     else
         return !ExcludedInstrumentInfo.IsExcluded(holding);
 }
Example #5
0
 /// <summary>
 /// Constructor of AverageHoldingFee object
 /// </summary>
 /// <param name="parent">The holding this fee item belongs to</param>
 /// <param name="unit">The holding this fee item belongs to</param>
 /// <param name="feeType">The type of MgtFee</param>
 /// <param name="calculatedAmount">The (total) value calculated</param>
 /// <param name="calcSource">The source of the calculation</param>
 /// <param name="feePercentageUsed">The fee Percentage Used in the calculation</param>
 public AverageHoldingFee(IAverageHolding parent, IManagementPeriodUnit unit, FeeType feeType, Money calculatedAmount, IFeeCalcVersion calcSource, decimal feePercentageUsed)
     : this(parent, unit, feeType, calculatedAmount, null, calcSource, feePercentageUsed)
 {
 }
Example #6
0
        protected void getPreviousCalculatedFeeRecursively(IAverageHolding holding, FeeType feeType, ref Money prevCalcFee)
        {
            if (holding != null)
            {
                if (holding.PreviousHolding != null)
                    getPreviousCalculatedFeeRecursively(holding.PreviousHolding, feeType, ref prevCalcFee);

                if (holding != null && holding.FeeItems != null && holding.FeeItems.Count > 0)
                {
                    foreach (IAverageHoldingFee feeItem in holding.FeeItems)
                    {
                        if (!feeItem.IsIgnored && feeItem.FeeType.Equals(feeType))
                            prevCalcFee += feeItem.Amount;
                    }
                }
            }
        }