Exemplo n.º 1
0
        public double TotalDayDiff()
        {
            double result = 0;

            foreach (var position in CalculatePosition())
            {
                result += ExchangeRates.ConvertTo(position.Currency, position.DayDiff, TargetCurrency);
            }

            return(result);
        }
Exemplo n.º 2
0
        public double TotalCostPrice()
        {
            double result    = 0;
            var    positions = CalculatePosition();

            foreach (var position in positions)
            {
                if (position is SecurityPosition sec)
                {
                    if (sec.Shares == 0)
                    {
                        continue;
                    }
                    if (sec.Security.Price == 0)
                    {
                        continue;
                    }
                }
                double rate = ExchangeRates.ConvertTo(position.Currency, position.CostPrice, TargetCurrency);
                result += rate;
            }

            return(result);
        }