Ejemplo n.º 1
0
        public FundViewModel GetFundInformation(string accountCode, string customerCode = null, Currency currency = null)
        {
            List <FundInformation> results = _portfolioManager.GetFundInformation(customerCode, accountCode, currency);
            FundInformation        fund    = results.First();

            FundViewModel result = Mapper.Map <FundInformation, FundViewModel>(fund);

            List <OptionPositionViewModel> positions = GetOptionPositions(customerCode, accountCode);
            decimal floatingPL = 0;

            foreach (OptionPositionViewModel position in positions)
            {
                floatingPL += position.OptionFloatingPL;
            }
            result.FloatingPL = floatingPL;

            RiskLevelInformation riskLevel = _portfolioManager.GetAccountRiskLevelInformation(accountCode, currency);

            result.UsedMargin = riskLevel.UsedMargin;
            result.MarginRate = 0;
            if (fund.AvailableFund != 0)
            {
                result.MarginRate = riskLevel.UsedMargin / fund.AvailableFund;
            }

            return(result);
        }
Ejemplo n.º 2
0
        public object GetFundInformation(string accountCode, string customerCode = null, Currency currency = null)
        {
            EntityResponse <List <FundInformation> > result = _portfolioManager.GetFundInformation(customerCode, accountCode, currency);

            return(result);
        }