util_sharpe
Calculate Sharpe ratio to evaluate risk-adjusted returns of a trading strategy given a return series and optional risk-free rate.
Instructions
计算夏普比率 (Sharpe Ratio) = (年化收益 - 无风险利率) / 年化波动率
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| returns | Yes | 收益率数组(如日收益率序列) | |
| riskFreeRate | No | 无风险利率(如 0.02 表示 2%) |