esvhd / pypbo

Probability of Backtest Overfitting in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deflated Sharp Ration - Single return Series

andrewczgithub opened this issue · comments

Hi @esvhd !

Hope your well.

I am trying to calculate the deflated sharp ration on a single return series.
Please see below.

import pypbo as pbo
import pypbo.perf as perf
import yfinance as yf
import numpy as np
data = yf.download("SPY ", start="2017-01-01", end="2017-04-30")

data1=data["Close"].pct_change().dropna()

pbox = pbo.dsr(data1,test_sharpe=1.0, sharpe_std=0.5, N=100,T=100, skew=3, kurtosis=1.0)

I am getting the error

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-6-8dc1d936eccd> in <module>
----> 1 pbox = pbo.dsr(data1,test_sharpe=1.0, sharpe_std=0.5, N=100,T=100, skew=3, kurtosis=1.0)

TypeError: dsr() got multiple values for argument 'test_sharpe'
commented

your data1 input is considered positional and therefore duplicating with test_sharpe=1.0.