testing/drumb.scala
changeset 135 077e63e96287
parent 130 7f3f01dfe738
child 138 7415ff9c91f4
equal deleted inserted replaced
134:d58954a96ec1 135:077e63e96287
    93     val new_balance = yearly_yield(data, balance, year)
    93     val new_balance = yearly_yield(data, balance, year)
    94     compound_yield(data, new_balance, year + 1)
    94     compound_yield(data, new_balance, year + 1)
    95   }
    95   }
    96 }
    96 }
    97 
    97 
    98 yearly_yield(d, 100, 0)
    98 //yearly_yield(d, 100, 0)
    99 //compound_yield(d.take(6), 100, 0)
    99 //compound_yield(d.take(6), 100, 0)
   100 
   100 
   101 def investment(portfolio: List[String], years: Range, start_balance: Long): Long = {
   101 def investment(portfolio: List[String], years: Range, start_balance: Long): Long = {
   102   compound_yield(get_deltas(get_prices(portfolio, years)), start_balance, 0)
   102   compound_yield(get_deltas(get_prices(portfolio, years)), start_balance, 0)
   103 }
   103 }