|
Params
//参数定义
Integer LongPrd(26);
Integer ShortPrd(12);
Integer M(9);
GlobalVars
//全局变量定义
Vars
//局部变量定义
Begin
//策略执行区
Numeric DIFF = EMA(Close,ShortPrd) - EMA(Close,LongPrd);
Numeric DEA = EMA(DIFF,M);
Numeric ret = (DIFF+DEA)/2;
PlotNumeric("DIFF",DIFF);
PlotNumeric("DEA",DEA);
if(ret>0)
{
PlotStickLine("MACD",ret,0,ColorUp());
}
Else
{
PlotStickLine("MACD",ret,0,ColorDown());
}
End
|
|