Ejemplo n.º 1
0
    def test_performance(self):
        p = performance(ts, 262)
        g = read_series("performance_a.csv", parse_dates=False)

        for i in p.index[:-2]:
            self.assertAlmostEqual(float(p.ix[i]), float(g.ix[i]), places=10)

        for i in p.index[-2:]:
            self.assertEqual(p.ix[i], pd.Timestamp(g.ix[i]))
Ejemplo n.º 2
0
Archivo: nav.py Proyecto: lobnek/pyutil
 def performance(self, days=262):
     return performance(self.__nav, days).ix[
         ["Annua. Return", "Annua. Volatility", "Annua. Sharpe Ratio", "Calmar Ratio (3Y)", "Max Nav",
          "Max Drawdown", "YTD", "MTD", "Current Nav", "Current Drawdown", "Positive Days", "Negative Days"]]