testing1/drumb.scala
changeset 160 863feeb5c760
parent 144 716042628398
child 161 6ea450e999e2
--- a/testing1/drumb.scala	Tue Nov 28 20:37:57 2017 +0000
+++ b/testing1/drumb.scala	Wed Nov 29 21:22:29 2017 +0000
@@ -6,7 +6,7 @@
 
 //two test portfolios
 
-val blchip_portfolio = List("GOOG", "AAPL", "MSFT", "IBM", "FB", "AMZN", "BIDU", "FOOBAR")
+val blchip_portfolio = List("GOOG", "AAPL", "MSFT", "IBM", "FB", "AMZN", "BIDU")
 val rstate_portfolio = List("PLD", "PSA", "AMT", "AIV", "AVB", "BXP", "CCI", 
                             "DLR", "EQIX", "EQR", "ESS", "EXR", "FRT", "GGP", "HCP") 
 
@@ -95,18 +95,18 @@
   }
 }
 
-yearly_yield(d, 100, 0)
-compound_yield(d.take(6), 100, 0)
+//yearly_yield(d, 100, 0)
+//compound_yield(d.take(6), 100, 0)
 
 //test case
-yearly_yield(d, 100, 0)
-yearly_yield(d, 225, 1)
-yearly_yield(d, 246, 2)
-yearly_yield(d, 466, 3)
-yearly_yield(d, 218, 4)
+//yearly_yield(d, 100, 0)
+//yearly_yield(d, 225, 1)
+//yearly_yield(d, 246, 2)
+//yearly_yield(d, 466, 3)
+//yearly_yield(d, 218, 4)
 
-yearly_yield(d, 100, 0)
-yearly_yield(d, 125, 1)
+//yearly_yield(d, 100, 0)
+//yearly_yield(d, 125, 1)
 
 def investment(portfolio: List[String], years: Range, start_balance: Long): Long = {
   compound_yield(get_deltas(get_prices(portfolio, years)), start_balance, 0)
@@ -123,14 +123,15 @@
 
 //test cases for the two portfolios given above
 
-println("Real data: " + investment(rstate_portfolio, 1978 to 1981, 100))
-println("Blue data: " + investment(blchip_portfolio, 1978 to 1981, 100))
+//println("Real data: " + investment(rstate_portfolio, 1978 to 1981, 100))
+//println("Blue data: " + investment(blchip_portfolio, 1978 to 1981, 100))
 
-for (i <- 1978 to 2017) {
-  println("Year " + i)
-  println("Real data: " + investment(rstate_portfolio, 1978 to i, 100))
-  println("Blue data: " + investment(blchip_portfolio, 1978 to i, 100))
-}
+//for (i <- 1978 to 2017) {
+//  println("Year " + i)
+//  println("Real data: " + investment(rstate_portfolio, 1978 to i, 100))
+//  println("Blue data: " + investment(blchip_portfolio, 1978 to i, 100))
+//}
+
 //1984
 //1992
 }