参数N自己设置
精确MACD源码:
DIF:=EMA(C,N)-EMA(C,26),COLORRED,LINETHICK1;
DEA:=EMA(DIF,M),COLORYELLOW,LINETHICK1;
MACD:(DIF-DEA)*50,COLORSTICK,LINETHICK1;
DIF1:(DIF-REF(DIF,1))*100,COLORWHITE,LINETHICK2;
DEA1:(DEA-REF(DEA,1))*100,COLORBROWN,LINETHICK2;
A0:0;
{以下是一些买卖信号的确定方法}
CC:=DEA1-REF(DEA1,1)<0;{今日DEA1小于昨日}
D:BARSLAST(CROSS(DIF1,A0)),NODRAW;{DIF1上穿0 轴线的天数}
{DEA1上穿0轴线的买卖确定}
DRAWTEXT(CROSS(DEA1,A0) AND DEA1>0.005 ,A0-0.6,'关注或买入');{若前次DEA1接触0轴线后撤回,那就是买入点}
{DIF1与DEA的交叉或接触买卖确定:在0轴线下的买卖确定}
AA:=DIF1<0 AND DEA1<0;
A:=CROSS(DEA1,DIF1);
B:=CO,1);
DRAWTEXT(AA AND A AND B,MACD,'卖出1');
上一篇:通达信红线在上持股源码 下一篇:通达信趋势买卖指标公式