Update sharp_ratio.py (#57)
Browse files- Update sharp_ratio.py (e0c9b1756021243c61d0295fa73d8e730dac1f62)
Co-authored-by: handepehlivan <handepeh@users.noreply.huggingface.co>
- sharp_ratio.py +2 -1
sharp_ratio.py
CHANGED
@@ -11,7 +11,8 @@ def cumulative_return(stocks,choices):
|
|
11 |
symbols, weights, investing_style, benchmark, rf, A_coef = choices.values()
|
12 |
tkers = sorted(set(stocks['Ticker'].unique()))
|
13 |
#preprocess
|
14 |
-
stocks = stocks.pivot(index="Date", columns="Ticker", values="Adj. Close")
|
|
|
15 |
logRet = np.log(stocks/stocks.shift())
|
16 |
log_returns = np.log(stocks/stocks.shift())
|
17 |
tickers_list = symbols.copy()
|
|
|
11 |
symbols, weights, investing_style, benchmark, rf, A_coef = choices.values()
|
12 |
tkers = sorted(set(stocks['Ticker'].unique()))
|
13 |
#preprocess
|
14 |
+
#stocks = stocks.pivot(index="Date", columns="Ticker", values="Adj. Close")
|
15 |
+
|
16 |
logRet = np.log(stocks/stocks.shift())
|
17 |
log_returns = np.log(stocks/stocks.shift())
|
18 |
tickers_list = symbols.copy()
|