Пример #1
0
        public void CanRecordResearchValuesAndGetRatingForAsset()
        {
            var repo    = new EdisRepository();
            var adviser = repo.CreateAdviser("Test", "Adviser").Result;

            adviser.CreateNewClientGroup(new ClientGroupRegistration()
            {
                AdviserNumber = adviser.AdviserNumber,
                FirstName     = "client first name",
                LastName      = "client last name",
                Address       = "668 Bourke Street, Melbourne, 3000, Victoria",
                Dob           = DateTime.Now,
                Phone         = "03699999",
                Email         = "Email"
            }).Wait();

            var groups = adviser.GetAllClientGroups().Result;

            groups[0].AddAccount("group account", AccountType.GenenralPurpose).Wait();
            var account = groups[0].GetAccounts()[0];

            account.MakeTransaction(new EquityTransactionCreation()
            {
                EquityType      = EquityTypes.AustralianEquity,
                FeesRecords     = new List <TransactionFeeRecordCreation>(),
                Name            = "Test Stock",
                NumberOfUnits   = 1000,
                Price           = 29.64,
                Sector          = "Test Sector",
                Ticker          = "Test Ticker 01",
                TransactionDate = DateTime.Now,
            }).Wait();


            account.MakeTransaction(new EquityTransactionCreation()
            {
                EquityType      = EquityTypes.AustralianEquity,
                FeesRecords     = new List <TransactionFeeRecordCreation>(),
                Name            = "Test Stock",
                NumberOfUnits   = 1000,
                Price           = 29.64,
                Sector          = "Test Sector",
                Ticker          = "Test Ticker 02",
                TransactionDate = DateTime.Now,
            }).Wait();

            #region set up research values (this portion is optional, default values will be used if no research values available. Absent of research values will always generate 'Danger' rating)
            //record Australian equity f0 values
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.Beta), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.EarningsStability), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.FiveYearInformation), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.FiveYearReturn), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.Frank), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.InterestCover), 0, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.OneYearReturn), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.PayoutRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.ThreeYearReturn), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.BetaFiveYears), 1.1036, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.Capitalisation), 57225467107, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.CurrentRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.DebtEquityRatio), 0, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.DividendYield), 0.0621, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.EpsGrowth), 0.0772, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.FiveYearAlphaRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.FiveYearSharpRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.FiveYearSkewnessRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.FiveYearStandardDeviation), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.FiveYearTrackingErrorRatio), 1.1036, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.FundSize), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.GlobalCategory), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.CurrentRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.PriceEarningRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.QuickRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.ReturnOnAsset), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Ratios> .Property(r => r.ReturnOnEquity), 1, "Test Ticker 01", "Test Issuer").Wait();

            //record Australian Equity f1 research values
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.FinancialLeverage), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.Frank), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.InterestCover), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.IntrinsicValue), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.OneYearReturn), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.OneYearRevenueGrowth), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.PriceEarningRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.ReturnOnAsset), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.ReturnOnEquity), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.CreditRating), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.DebtEquityRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.DividendYield), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.EpsGrowth), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.FairValueVariation), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.FiveYearTotalReturn), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.MaxManagementExpenseRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.MorningStarAnalyst), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.MorningstarRecommendation), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.OneYearAlpha), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.OneYearInformationRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.OneYearBeta), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.OneYearSharpRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.OneYearTrackingError), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.PerformanceFee), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof <Recommendation> .Property(r => r.YearsSinceInception), 1, "Test Ticker 01", "Test Issuer").Wait();
            #endregion
            var assets = account.GetAssets();
            var equityWithResearchValues    = assets.OfType <Equity>().First(a => a.Ticker == "Test Ticker 01");
            var equityWithNoResearchValues  = assets.OfType <Equity>().First(a => a.Ticker == "Test Ticker 02");
            var rating_withResearchValues   = equityWithResearchValues.GetRating();
            var rating_withNoResearchValues = equityWithNoResearchValues.GetRating();
            Assert.IsTrue(rating_withNoResearchValues.SuitabilityRating == SuitabilityRating.Danger);
            Assert.IsTrue(rating_withResearchValues != null);
        }
Пример #2
0
        public void CanRecordResearchValuesAndGetRatingForAsset()
        {
            var repo = new EdisRepository();
            var adviser = repo.CreateAdviser("Test", "Adviser").Result;
            adviser.CreateNewClientGroup(new ClientGroupRegistration()
            {
                AdviserNumber = adviser.AdviserNumber,
                FirstName = "client first name",
                LastName = "client last name",
                Address = "668 Bourke Street, Melbourne, 3000, Victoria",
                Dob = DateTime.Now,
                Phone = "03699999",
                Email = "Email"
            }).Wait();

            var groups = adviser.GetAllClientGroups().Result;
            groups[0].AddAccount("group account", AccountType.GenenralPurpose).Wait();
            var account = groups[0].GetAccounts()[0];
            account.MakeTransaction(new EquityTransactionCreation()
            {
                EquityType = EquityTypes.AustralianEquity,
                FeesRecords = new List<TransactionFeeRecordCreation>(),
                Name = "Test Stock",
                NumberOfUnits = 1000,
                Price = 29.64,
                Sector = "Test Sector",
                Ticker = "Test Ticker 01",
                TransactionDate = DateTime.Now,
            }).Wait();

            account.MakeTransaction(new EquityTransactionCreation()
            {
                EquityType = EquityTypes.AustralianEquity,
                FeesRecords = new List<TransactionFeeRecordCreation>(),
                Name = "Test Stock",
                NumberOfUnits = 1000,
                Price = 29.64,
                Sector = "Test Sector",
                Ticker = "Test Ticker 02",
                TransactionDate = DateTime.Now,
            }).Wait();

            #region set up research values (this portion is optional, default values will be used if no research values available. Absent of research values will always generate 'Danger' rating)
            //record Australian equity f0 values
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.Beta), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.EarningsStability), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.FiveYearInformation), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.FiveYearReturn), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.Frank), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.InterestCover), 0, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.OneYearReturn), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.PayoutRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.ThreeYearReturn), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.BetaFiveYears), 1.1036, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.Capitalisation), 57225467107, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.CurrentRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.DebtEquityRatio), 0, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.DividendYield), 0.0621, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.EpsGrowth), 0.0772, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.FiveYearAlphaRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.FiveYearSharpRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.FiveYearSkewnessRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.FiveYearStandardDeviation), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.FiveYearTrackingErrorRatio), 1.1036, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.FundSize), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.GlobalCategory), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.CurrentRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.PriceEarningRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.QuickRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.ReturnOnAsset), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Ratios>.Property(r => r.ReturnOnEquity), 1, "Test Ticker 01", "Test Issuer").Wait();

            //record Australian Equity f1 research values
            repo.FeedResearchValueForEquity(Nameof<Recommendation>.Property(r => r.FinancialLeverage), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Recommendation>.Property(r => r.Frank), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Recommendation>.Property(r => r.InterestCover), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Recommendation>.Property(r => r.IntrinsicValue), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Recommendation>.Property(r => r.OneYearReturn), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Recommendation>.Property(r => r.OneYearRevenueGrowth), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Recommendation>.Property(r => r.PriceEarningRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Recommendation>.Property(r => r.ReturnOnAsset), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Recommendation>.Property(r => r.ReturnOnEquity), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Recommendation>.Property(r => r.CreditRating), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Recommendation>.Property(r => r.DebtEquityRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Recommendation>.Property(r => r.DividendYield), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Recommendation>.Property(r => r.EpsGrowth), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Recommendation>.Property(r => r.FairValueVariation), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Recommendation>.Property(r => r.FiveYearTotalReturn), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Recommendation>.Property(r => r.MaxManagementExpenseRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Recommendation>.Property(r => r.MorningStarAnalyst), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Recommendation>.Property(r => r.MorningstarRecommendation), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Recommendation>.Property(r => r.OneYearAlpha), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Recommendation>.Property(r => r.OneYearInformationRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Recommendation>.Property(r => r.OneYearBeta), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Recommendation>.Property(r => r.OneYearSharpRatio), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Recommendation>.Property(r => r.OneYearTrackingError), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Recommendation>.Property(r => r.PerformanceFee), 1, "Test Ticker 01", "Test Issuer").Wait();
            repo.FeedResearchValueForEquity(Nameof<Recommendation>.Property(r => r.YearsSinceInception), 1, "Test Ticker 01", "Test Issuer").Wait();
            #endregion
            var assets = account.GetAssets();
            var equityWithResearchValues = assets.OfType<Equity>().First(a => a.Ticker == "Test Ticker 01");
            var equityWithNoResearchValues = assets.OfType<Equity>().First(a => a.Ticker == "Test Ticker 02");
            var rating_withResearchValues = equityWithResearchValues.GetRating();
            var rating_withNoResearchValues = equityWithNoResearchValues.GetRating();
            Assert.IsTrue(rating_withNoResearchValues.SuitabilityRating == SuitabilityRating.Danger);
            Assert.IsTrue(rating_withResearchValues != null);
        }