{"id":19242901,"url":"https://github.com/ricequant/rqrisk","last_synced_at":"2026-02-10T05:12:17.123Z","repository":{"id":40687692,"uuid":"164775693","full_name":"ricequant/rqrisk","owner":"ricequant","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-08T06:48:47.000Z","size":136,"stargazers_count":21,"open_issues_count":1,"forks_count":13,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-01T12:04:00.251Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ricequant.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-09T02:57:28.000Z","updated_at":"2024-05-08T06:45:37.000Z","dependencies_parsed_at":"2024-01-30T07:46:58.066Z","dependency_job_id":null,"html_url":"https://github.com/ricequant/rqrisk","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricequant%2Frqrisk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricequant%2Frqrisk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricequant%2Frqrisk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ricequant%2Frqrisk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ricequant","download_url":"https://codeload.github.com/ricequant/rqrisk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250032222,"owners_count":21363795,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T17:15:57.915Z","updated_at":"2026-02-10T05:12:17.097Z","avatar_url":"https://github.com/ricequant.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RQRISK\nsimple and fast indicator calculator\n\n\n## Install\n\npip install rqrisk [--upgrade]\n\n\n## Usage\n\nimport packages\n\n`\nimport rqrisk\n`\n* create Risk object\n\n`\nrisk = rqrisk.Risk(portfolio_returns, benchmark_returns, risk_free_rate, period)\n`\n\n* get result\n\n`\nresult = risk.all() # dict\n`\n\n## Example\n\n```jupyter\nIn [1]: import rqrisk\n\nIn [2]: import numpy\n\nIn [3]: risk = rqrisk.Risk(\n   ...:     # 组合日收益率\n   ...:     daily_returns=numpy.array([0.0006, 0.0213, -0.0155, -0.017, -0.0025, -0.0173, -0.0006, -0.0094, 0.0108, -0.0151]),\n   ...:     # 基准日收益率\n   ...:     benchmark_daily_returns=numpy.array([0.0024, 0.0048, -0.0036, -0.013, 0.0107, -0.0203, 0.0097, 0.0018, 0.0083, -0.0089]),\n   ...:     # 无风险利率\n   ...:     risk_free_rate=0.02\n   ...: )\n   \nIn [4]: risk.all()\nOut[4]: \n{'return_rate': -0.04454119145160703,\n 'annual_return': -0.6827938423763955,\n 'benchmark_return': -0.008557443372075783,\n 'benchmark_annual_return': -0.19472831925009826,\n 'alpha': -0.9467029842994686,\n 'beta': 0.8912056741947679,\n 'volatility': 0.013005985801417234,\n 'annual_volatility': 0.2064636239147226,\n 'benchmark_volatility': 0.010414781162687322,\n 'benchmark_annual_volatility': 0.1653295254937847,\n 'max_drawdown': 0.06502900516774743,\n 'tracking_error': 0.009180922248518028,\n 'annual_tracking_error': 0.14574262245479186,\n 'information_ratio': -0.4113963917368945,\n 'sharpe': -5.55274570048971,\n 'excess_sharpe': -6.328416385440682,\n 'downside_risk': 0.011371747671783752,\n 'annual_downside_risk': 0.1805208978703054,\n 'sortino': -6.350732870959105,\n 'calmar': -10.499835275275627,\n 'excess_return_rate': -0.036369224165807304,\n 'excess_annual_return': -0.6068586934419611,\n 'excess_volatility': 0.009180922248518028,\n 'excess_annual_volatility': 0.14574262245479186,\n 'excess_max_drawdown': 0.050301584825935344,\n 'var': 0.025161857442751474,\n 'win_rate': 0.3,\n 'correlation': 0.7136492542281812}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricequant%2Frqrisk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fricequant%2Frqrisk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fricequant%2Frqrisk/lists"}