StockTrailingAvgByEndT
简述
获取基于指定日推移阶段的日均指标
StockTrailingAvgByEndT(Endt:Date;RefType:UserDefine;Exp:String;IsExcludeIPO:Boolean;N:Integer):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 |
|
Exp | String | 字符串, 指标表达式,如"close()","stockzdf3()" |
IsExcludeIPO | Boolean | 真假, 是否剔除上市日区间行情 |
N | Integer | 整数, 剔除天数 |
返回 | Real | Real, 获取基于指定日推移阶段的日均指标 |
范例01
获取万科A过去1年的日均成交金额
setsysparam(pn_stock(),"SZ000002");
endt := 20210714t;
RefType := 4;//过去1年
exp := "Amount()";
return StockTrailingAvgByEndT(Endt,RefType,Exp);
// 2172484158.52
范例02
获取厦门银行过去1年的日均成交金额(剔除上市日3天)
setsysparam(pn_stock(),"SH601187");
endt := 20210714t;
RefType := 4;//过去1年
exp := "Amount()";
IsExcludeIPO := 1;//考虑剔除上市日影响
N := 3;//上市行情3天
return StockTrailingAvgByEndT(Endt,RefType,Exp,IsExcludeIPO,N);
// 444243617.69