示例#1
0
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)
示例#2
0
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
示例#3
0
def ts():
    return read("ts.csv", squeeze=True, header=None, parse_dates=True, index_col=0).pct_change().fillna(0.0)
示例#4
0
def test_table(ts):
    pdt.assert_almost_equal(monthlytable(ts), read("monthtable.csv", index_col=0))
示例#5
0
def ts():
    return read("ts.csv",
                squeeze=True,
                header=None,
                parse_dates=True,
                index_col=0)
示例#6
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))
示例#7
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())
示例#8
0
def prices():
    return read("price.csv", parse_dates=True, index_col=0)