Count
简述
统计N天中表达式Exp值为真的天数。
Count(exp:TExpression;N:Integer[;CacheString:String]):Integer
名称 | 类型 | 说明 |
---|
Exp | TExpression | 表达式类型 |
N | integer | 整数,交易日天数,如果为-1表示从上市第一天起统计 |
CacheString | String | 可选参数,字符串类型,缓存标志串。参见:时间序列统计缓存标志与性能加速 |
返回 | integer | 整型,为真的天数。 |
//上证指数在最近100天内的上涨天数;
setsysparam(pn_stock(),'SH000001');
setsysparam(pn_date(),inttodate(20140122));
return count(isup(),100);
//返回47。