StockTrailingSharpeRatioByEndt
简述
获取基于指定日推移阶段的夏普比率
注意:年化无风险收益率(%) 默认为3%,如需更改,需通过设置系统参数方式,如:setsysparam("Rf",2.5);
StockTrailingSharpeRatioByEndt(Endt:Date;RefType:UserDefine):Real
| 名称 | 类型 | 说明 |
|---|
| Endt | Date | 日期,截止日 |
| RefType | UserDefine | 用户自定义,选择所推移类型,取值如下:
|
显示名 |
取值 | |
最近1周 |
0 | |
最近1月 |
1 | |
最近3月 |
2 | |
最近6月 |
3 | |
最近1年 |
4 | |
最近2年 |
5 | |
最近3年 |
6 | |
最近5年 |
7 | |
本周以来 |
8 | |
本月以来 |
9 | |
本季以来 |
10 | |
本年以来 |
11 | |
成立以来 |
12 |
|
| 返回 | Real | Real, 获取基于指定日推移阶段的夏普比率 |
获取沪深300过去1年的夏普比率
setsysparam(pn_stock(),"SH000300");
setsysparam("Rf",2.5);//设置年化无风险收益率(%),可选设置
endt := 20210714t;
RefType := 4;//过去1年
return StockTrailingSharpeRatioByEndt(Endt,RefType); // 0.02