原理解析:
输出DIFF:不定周期收盘价的12日指数移动平均-不定周期收盘价的26日指数移动平均
输出DEA:DIFF的9日指数移动平均,COLORFFFF00
输出平滑异同平均:(DIFF-DEA)*2
当满足条件MACD>=0ANDMACD>=1日前的MACD时,在0和MACD位置之间画柱状线,宽度为1,0不为0则画空心柱.,画红色
当满足条件MACD>=0ANDMACD=1日前的MACD时,在0和MACD位置之间画柱状线,宽度为1,0不为0则画空心柱.,COLORFF00FF
当满足条件MACD0) AND (MACD2日前的MACD)) AND (2日前的MACD>3日前的MACD))
空转多赋值:((((4日内MACD的最高值1日前的MACD)) AND (1日前的MACD=0距今天数日中满足DIFF上穿DEA的天数
二次金叉赋值:DIFF上穿DEA AND DEA收盘价 AND DIFF>A1+1日前的DIFF AND DIFF上穿DEA
当满足条件A1=0时,在DEA位置画直线起点,当满足条件底背离时,在DEA位置画直线终点,0表示是否延长.,画红色,线宽为3
A2赋值:上次1日前的DEA上穿DIFF距今天数
顶背离赋值:A2+1日前的收盘价DIFF AND DEA上穿DIFF
当满足条件A2=0时,在DEA位置画直线起点,当满足条件顶背离时,在DEA位置画直线终点,0表示是否延长.,画蓝色,线宽为3
当满足条件收阳线时,在横轴0.01纵轴0.9位置书写文字,画红色
当满足条件收阳线时,在横轴1纵轴1位置书写文字,画红色
源码:
DIFF:EMA(DCLOSE,12)-EMA(DCLOSE,26);
DEA:EMA(DIFF,9),COLORFFFF00;
MACD:(DIFF-DEA)*2;
STICKLINE(MACD>=0 AND MACD>=REF(MACD,1),0,MACD,1,0),COLORRED;
STICKLINE(MACD>=0 AND MACD=REF(MACD,1),0,MACD,1,0),COLORFF00FF;
STICKLINE(MACD0) AND (MACDREF(MACD,2))) AND (REF(MACD,2)>REF(MACD,3)));
空转多:=((((HHV(MACD,4)REF(MACD,1))) AND (REF(MACD,1)=0));
二次金叉:=CROSS(DIFF,DEA) AND DEACLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);
{STICKLINE(底背离,0.5,0.8,2,0),COLORRED};
DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK3;
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
顶背离:=REF(CLOSE,A2+1)DIFF AND CROSS(DEA,DIFF);
DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORBLUE,LINETHICK3;
DRAWTEXT_FIX(C>O,0.01,0.9,0,' WWW. '),COLORRED;
DRAWTEXT_FIX(C>O,1,1,0,'交易策略'),COLORRED;