MCPcopy
hub / github.com/ranaroussi/quantstats / to_prices

Function to_prices

quantstats/utils.py:73–77  ·  view source on GitHub ↗

Converts returns series to price data

(returns, base=1e5)

Source from the content-addressed store, hash-verified

71
72
73def to_prices(returns, base=1e5):
74 """Converts returns series to price data"""
75 returns = returns.copy().fillna(0).replace([_np.inf, -_np.inf], float("NaN"))
76
77 return base + base * _stats.compsum(returns)
78
79
80def log_returns(returns, rf=0.0, nperiods=None):

Callers 3

_prepare_pricesFunction · 0.85
_prepare_benchmarkFunction · 0.85
make_portfolioFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected