MACD_DEA_v
简述
平滑移动平均DEA线,即DIF线的M日指数平滑移动平均线。与系统证券pn_stock()、系统时间pn_date()、系统周期pn_cycle()、复权方式pn_rate()和复权基准日pn_rateday()相关。调用时需注意设置系统参数。
MACD_DEA_v(Short:Integer;Long:Integer;M:Integer):Real
名称 | 类型 | 说明 |
---|
Short | integer | 快速平滑移动平均线 |
Long | integer | 慢速平滑移动平均线 |
M | integer | 计算DEA的平滑移动平均的样本长度 |
返回 | real | 实数 |
(1)DIF =收盘价的Short日移动平均 - 收盘价的Long日移动平均;
(2)DEA =DIF的M日移动平均。
//计算白云机场截止2011年9月8日的平滑移动平均DEA线。
oV:=BackUpSystemParameters();
setsysparam(pn_stock(),'SH600004');
setsysparam(pn_date(),inttodate(20110908));
setsysparam(pn_cycle(),cy_day());
setsysparam(pn_rate(),0);
Short:=12;
Long:=26;
M:=9;
v:=MACD_DEA_v(Short,Long,M);
RestoreSystemParameters(oV);
return v;
//结果:-0.15