MACD形态推演
指标种类: 副图指标效果图:
//------------------------------------------------------------------------
// 简称:MACDA
// 名称:MACD形态推演A
// 类别: 交易指令
// 类型: 用户应用
//------------------------------------------------------------------------
Params
//参数定义
Integer short1(12);
Integer long1(26);
Integer m(9);
GlobalVars
//全局变量定义
Vars
//局部变量定义
Begin
//策略执行区
Numeric diff = EMA(Close, short1) - EMA(Close, long1);
Numeric dea = EMA(diff, m);
Numeric macd1 = 2*(diff - dea);
PlotNumeric("diff", diff, White);
PlotNumeric("dea", dea, Yellow);
If(macd1>0)
{
if(ABS(macd1)>= REF(ABS(macd1),1))
{
PlotBar("macd1", macd1, 0, False, ColorUp);
}
Else
{
PlotStickLine("macd1",macd1, 0, ColorUp);
}
}
Else
{
if(ABS(macd1)>= REF(ABS(macd1),1))
{
PlotBar("macd1", macd1, 0, false,ColorDown);
}
Else
{
PlotStickLine("macd1",macd1, 0, ColorDown);
}
}
End
页:
[1]