def test_drawdown(ts): pdt.assert_series_equal(Drawdown(ts).drawdown, read("drawdown.csv", squeeze=True, parse_dates=True, header=None, index_col=0), check_names=False) pdt.assert_series_equal(drawdown(ts), read("drawdown.csv", squeeze=True, parse_dates=True, header=None, index_col=0), check_names=False)
def ts(): ts = read("ts.csv", parse_dates=True, squeeze=True, header=None, index_col=0) ts.name = None ts.index.name = None return ts
def ts(): return read("ts.csv", squeeze=True, header=None, parse_dates=True, index_col=0).pct_change().fillna(0.0)
def test_table(ts): pdt.assert_almost_equal(monthlytable(ts), read("monthtable.csv", index_col=0))
def ts(): return read("ts.csv", squeeze=True, header=None, parse_dates=True, index_col=0)
def _portfolio(): return Portfolio(prices=read("price.csv", parse_dates=True, index_col=0), weights=read("weight.csv", parse_dates=True, index_col=0))
def test_performance(): ts = read("ts.csv", parse_dates=True, squeeze=True, header=None, index_col=0) pdt.assert_series_equal(performance(ts), from_nav(ts).summary())
def prices(): return read("price.csv", parse_dates=True, index_col=0)