Exemple #1
0
        protected PortfolioModel SerializePortfolio(Core.PortfolioModel model, CalculationTicket ticket)
        {
            var result = new PortfolioModel(
                this.serializer.SerializeBroadGlobalActivePorfolio(model.Portfolio),
                this.serializer.SerializeNullableExpression(model.PortfolioTargetTotal, ticket)
                );

            return(result);
        }
        protected Core.PortfolioModel DeserializePortfolio(PortfolioModel model, IEnumerable <Core.SecurityModel> securities)
        {
            var broadGlobalActiveProfolio      = this.deserializer.DeserializeBroadGlobalActivePorfolio(model.BroadGlobalActivePortfolio);
            var portfolioTargetTotalExpression = this.modelBuilder.CreatePortfolioTargetTotalExpression(broadGlobalActiveProfolio, securities);
            var result = new Core.PortfolioModel(
                broadGlobalActiveProfolio,
                portfolioTargetTotalExpression
                );

            return(result);
        }