goldmansachs / gs-quant

Python toolkit for quantitative finance
https://developer.gs.com/discover/products/gs-quant/
Apache License 2.0
7.55k stars 924 forks source link

Sharpe ratio and information ratio #35

Open andrewphillipsn opened 5 years ago

andrewphillipsn commented 5 years ago

Describe the problem. Provide an implementation for sharpe ratio and information ratio calculations in gs_quant.

Describe the solution you'd like Information ratio should calculate the rolling return per unit volatility of a series versus a benchmark series. Sharpe ratio calculation should compute rolling return per unit volatility of a series versus risk free rate for currency of the target series (i.e excess return). Both of these measures should calculate excess return daily with correct holiday / interpolation handling

Are you willing to contribute Yes

Additional context Needs full regtesting. Identify correct data sources for risk free rates

stephen-183 commented 4 years ago

Proposed signatures sharpe_ratio(prices: Series, rate: Union[Asset, Number], , day_count_convention) -> Series information_ratio(prices: Series, benchmark[Index], , day_count_convention) -> Series excess_return(prices: Series, benchmark_or_rate: Union[Asset, Number], *, day_count_convention) -> Series

andrewphillipsn commented 4 years ago

@stephen-183 benchmark can be non-index, so I would use Asset

andrewphillipsn commented 4 years ago

@stephen-183 or a list of valid types (e.g. Index, Stock, etc)

stephen-183 commented 4 years ago

Makes sense; I'll use Asset to be concise. information_ratio(prices: Series, benchmark[Asset], *, day_count_convention) -> Series