/// <summary>
        /// Just want to calculate what this montly payment should be based on the current amount and interest rate
        /// Must apply extra amount each investor may or may not contribute
        /// Must adjust years to pay off
        /// Must take into account equity applied up until this point.  Can't save inside selected property object because of other graphs
        ///
        /// </summary>
        /// <param name="selectedProperty"></param>
        /// <returns></returns>
        public static Double GetMonthlyPayment(InvestmentProperty selectedProperty, Int32 monthNum, Double remainingPrinciple)
        {
            Double yearsToPayOff = selectedProperty.PayOffPeriod;
            Double interest      = selectedProperty.Mortgage.InterestRate / 100 / 12;
            Double n             = (yearsToPayOff * 12) - monthNum;

            Double monthlyPayment = (remainingPrinciple * (interest * Math.Pow((1 + interest), (n)))) / (Math.Pow((1 + interest), (n)) - 1);

            return(monthlyPayment);
        }
        public static Investor GetSelectedInvestor(MainWindow mainWindow, InvestmentProperty property)
        {
            String   selectedOwnerName = mainWindow.CurrentOwnerSelected.Text.Replace("Current Owner: ", "");
            Investor investor          = property.Investors.First();

            if (selectedOwnerName != "" && !selectedOwnerName.Contains("Current Owner:"))
            {
                investor = property.Investors.First(i => i.Name.Equals(selectedOwnerName));
            }

            return(investor);
        }
        public static InvestmentProperty GetSelectedInvestment(MainWindow mainWindow, IList <InvestmentProperty> properties)
        {
            String             selectedPropertyName = mainWindow.CurrentPropertySelected.Text.Replace("Current Property: ", "");
            InvestmentProperty selectedProperty     = properties.First();

            if (selectedPropertyName != "" && !selectedPropertyName.Contains("Current Property:"))
            {
                selectedProperty = properties.First(i => i.Name.Equals(selectedPropertyName));
            }

            return(selectedProperty);
        }
Beispiel #4
0
        public Mortgage(InvestmentProperty investmentProperty)
        {
            OrginalLoanAmount   = investmentProperty.Price - (investmentProperty.Price * investmentProperty.TotalEquity);
            RemainingLoanAmount = OrginalLoanAmount;
            MonthlyPaymentsMade = new List <double>();
            StartDate           = investmentProperty.PurchaseDate;
            PMI          = 0;
            PropertyTax  = (7.9 / 1000) * investmentProperty.Price;
            InterestRate = Convert.ToDouble(ConfigurationManager.AppSettings["InterestRate"]);

            if (investmentProperty.TotalEquity < 20)
            {
                PMI = OrginalLoanAmount * .01;
            }
        }
        /// <summary>
        /// Updates the projected payoff period from within mortgage object, based on user selected pay off years
        /// Formula = M = P [ interest(1 + i)^n ] / [ (1 + i)^n – 1]
        ///

        /* M = monthly mortgage payment
         *   P = the principal, or the initial amount you borrowed.
         *   interest = your monthly interest rate. Your lender likely lists interest rates as an annual figure, so you’ll need to divide by 12, for each month of the year. So, if your rate is 5%, then the monthly rate will look like this: 0.05/12 = 0.004167.
         *   n = the number of payments, or the payment period in months. If you take out a 30-year fixed rate mortgage, this means: n = 30 years x 12 months per year, or 360 payments.*/
        /// </summary>
        /// <param name="property"></param>
        public static void UpdatePayments(InvestmentProperty property)
        {
            property.Mortgage.MonthlyPaymentsMade      = new List <double>();
            property.Mortgage.MonthlyPaymentsProjected = new List <double>();

            Double yearsToPayOff = property.PayOffPeriod;

            Double p              = property.Price - property.TotalCashInvested;
            Double interest       = property.Mortgage.InterestRate / 100;
            Double n              = yearsToPayOff * 12;
            Double monthlyPayment = p * (interest * Math.Pow(1 + interest, (n))) / (Math.Pow((1 + interest), (n - 1)));

            for (var i = 0; i < yearsToPayOff; i++)
            {
                for (var m = 0; m < 12; m++)
                {
                    property.Mortgage.MonthlyPaymentsProjected.Add(monthlyPayment);
                }
            }
        }
 public static void UpdateEquity(InvestmentProperty newProperty)
 {
     newProperty.TotalEquity = newProperty.TotalCashInvested / newProperty.Price;
 }
        public static double GetInvestorCashOutEquity(InvestmentProperty selectedProperty, Investor investor, Double monthNum)
        {
            Double investorEquity = investor.TotalCashInvested + (monthNum * investor.AdditionalAmount / 12);

            return(investorEquity);
        }
 public static Double GetInvestorExtraMonthly(InvestmentProperty selectedProperty)
 {
     return(selectedProperty.Investors.Sum(investor => investor.AdditionalAmount / 12));
 }