天软金融分析.NET函数大全 > 数据仓库函数 > 时间序列统计

sp_rank    

简述
移动排名。表达式当前数据在最近N个交易日的排名(从大到小)
定义
SP_Rank(Exp;Exp;N)
参数
名称类型说明
ExpTExpression表达式
Ninteger交易日天数
返回Array,TableArray表达式当前数据在最近N个交易日的排名(从大到小),整数
  • 范例
    万科A在2018/10/30最近10个交易日的收盘价在每日分时价格序列中的排名
    Setsysparam(pn_Stock(),"SZ000002");
    Setsysparam(pn_date(),20181030T);
    Return Nday(10,"日期",SP_time(),"排名",SpecAll(SP_Rank(close(),close(),240),Array(pn_Cycle():Cy_1m(),pn_date():SP_time()+0.99)));
相关