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

sp_median    

简述
移动中位数,表达式前N个交易日的中位数
定义
SP_Median(Exp:TExpression;N:Integer):Real;
参数
名称类型说明
ExpTExpression表达式
NInteger天数
返回Real表达式数据前N个交易日的中位数,实数
  • 范例
    万科A在2018/10/30前30个交易日中每天交易价格的中位数序列
    Setsysparam(pn_Stock(),"SZ000002");
    Setsysparam(pn_date(),20181030T);
    return nday(30,"日期",SP_time(),"众数",Specall(Sp_Median(Close(),tradedays(SP_time(),SP_time()+14/24+57/24/60)),Array(pn_date():SP_Time()+14/24+57/24/60,pn_Cycle():Cy_3s())));
相关