Beispiel #1
0
 def test_optimize_empty_signals(self):
     manager = linear.Constant({})
     alloc, e_ret, e_risk = manager.optimize({}, {})
     self._check_optimize_return(alloc, e_ret, e_risk)
     eq_(alloc, {})
     eq_(e_ret, 0)
     eq_(e_risk, 1)
Beispiel #2
0
 def test_optimize_buy_signals_init_custom_amount(self):
     manager = linear.Constant({'buy_amount': 200})
     alloc, e_ret, e_risk = manager.optimize(to_buy=self.buy_signal,
                                             to_sell={})
     self._check_optimize_return(alloc, e_ret, e_risk)
     eq_(alloc, {'goog': 200})
Beispiel #3
0
 def test_optimize_buy_signals(self):
     manager = linear.Constant({})
     alloc, e_ret, e_risk = manager.optimize(to_buy=self.buy_signal,
                                             to_sell={})
     self._check_optimize_return(alloc, e_ret, e_risk)
     eq_(alloc, {'goog': self.default_amount})
Beispiel #4
0
 def test_initialize(self):
     self._check_initialization(linear.Constant({}))