趋势:((eMA(C,4)+eMA(C,18))/2-(eMA(C,14)+eMA(C,42))/2),COLORWHITE,LINETHICK2;
中:eMA(趋势,8),COLOR00bb00,LINETHICK2;
PARTLINE(趋势>=REF(趋势,1),趋势),COLORRED,LINETHICK2;
MACD2:2*(趋势-中),LINETHICK;
MACD1:=MACD2;
MACD3:=REF(MACD2,1);
STICKLINE(MACD1>MACD3 AND MACD1>0,0,MACD1,6,0),COLOR000055;
STICKLINE(MACD1>MACD3 AND MACD1>0,0,MACD1,4,0),COLOR000077;
STICKLINE(MACD1>MACD3 AND MACD1>0,0,MACD1,3,0),COLOR000099;
STICKLINE(MACD1>MACD3 AND MACD1>0,0,MACD1,1.5,0),COLOR0000BB;
STICKLINE(MACD1>MACD3 AND MACD1>0,0,MACD1,0.9,0),COLOR0000DD;
STICKLINE(MACD1>MACD3 AND MACD1>0,0,MACD1,0.3,0),COLOR0000FF;
STICKLINE(MACD1>MACD3 AND MACD1<0,0,MACD1,5,0),COLOR555555;
STICKLINE(MACD1>MACD3 AND MACD1<0,0,MACD1,4,0),COLOR777777;
STICKLINE(MACD1>MACD3 AND MACD1<0,0,MACD1,3,0),COLOR999999;
STICKLINE(MACD1>MACD3 AND MACD1<0,0,MACD1,1.5,0),COLORBBBBBB;
STICKLINE(MACD1>MACD3 AND MACD1<0,0,MACD1,0.9,0),COLORDDDDDD;
STICKLINE(MACD1>MACD3 AND MACD1<0,0,MACD1,0.3,0),COLORFFFFFF;
STICKLINE(MACD1<MACD3,0,MACD1,5,0),COLORB20000;
STICKLINE(MACD1<MACD3,0,MACD1,4,0),COLOREC0000;
STICKLINE(MACD1<MACD3,0,MACD1,3,0),COLORFF4600;
STICKLINE(MACD1<MACD3,0,MACD1,1.5,0),COLORFF6300;
STICKLINE(MACD1<MACD3,0,MACD1,0.9,0),COLORFF8B00;
STICKLINE(MACD1<MACD3,0,MACD1,0.3,0),COLORFFAB00;
STICKLINE(MACD1>=0 OR MACD1<=0,0,0,50,1),COLORWHITE;
∑MACD:SUM(MACD2,0)/10,Linethick;
PARTLINE(∑MACD>REF(∑MACD,1),∑MACD),COLORYELLOW,Linethick2;
PARTLINE(∑MACD<REF(∑MACD,1),∑MACD),color18A4FF,Linethick2;
Am:=(eMA(C,4)+eMA(C,18))/2;Bm:=(eMA(C,14)+eMA(C,42))/2;
DIF:(2*Am-EMA(Am,12))-(2*Bm-EMA(Bm,26)),COLOR9900FF;
DEA:2*EMA(DIF,5) - EMA(EMA(DIF,5),5),ColorFFAA00;
MACD:3*(DIF-DEA)COLORSTICK,LINETHICK2;
有同学要说明用法,这里简单说一下,两个MACD,要关注方向性一致,以趋势与中为主,其它用法与一般MACD没有什么区别,需要说明的是∑MACD,是表示上市以来MACD的趋势.如果同学会编写公式的话,可以以趋势为标的自己编写一个以13天或21天的压力支撑线,就可以便于看顶底或强弱了.如果有的同学不嫌线太多的话,可以把这个加上去.A:REF(HHV(趋势,25),1);{N日内dif的最高值}
B:REF(LLV(趋势,25),1);{N日内dif的最低值}
A1:=BARSLAST(REF(CROSS(趋势,中),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND 趋势>REF(趋势,A1+1) AND CROSS(趋势,中);
底背离1:IF(底背离,0.23,0),LINETHICK2,COLORFF00FF;
DRAWTEXT(底背离,0.23,'←底背离'),COLORWHITE;
把这个加上去以后判断强弱顶底就比较清楚了.
|