|
这个用底背离,有比较,才能出背离,你这单一的,说明不了问题。
SHORT:2---200---12
LONG:2---200----26
MID: 2---200 ---9
DIF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:EMA(DIF,MID);
MACD:(DIF-DEA)*2,COLORSTICK;
A1:=CROSS(DIF,DEA);
B1:=BARSLAST(A1);
C1:=REF(B1,1)+1;
D1:=C<REF(C,C1) AND DIF>REF(DIF,C1) AND A1;
DRAWICON(D1,DIF,25);
STICKLINE(D1,DIF,DIF-0.5,0,0),COLORMAGENTA;
DRAWTEXT(D1,DIF-0.5,'底背离'),COLORMAGENTA;
A2:=CROSS(DEA,DIF);
B2:=BARSLAST(A2);
C2:=REF(B2,1)+1;
D2:=C>REF(C,C2) AND DIF<REF(DIF,C2) AND A2;
DRAWICON(D2,DIF,27);
STICKLINE(D2,DIF,DIF+0.5,0,0),COLORGREEN;
DRAWTEXT(D2,DIF+0.5,'顶背离'),COLORGREEN;
这个用底背离,有比较,才能出背离,你这单一的,说明不了问题。
SHORT:2---200---12
LONG:2---200----26
MID: 2---200 ---9
DIF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:EMA(DIF,MID);
MACD:(DIF-DEA)*2,COLORSTICK;
A1:=CROSS(DIF,DEA);
B1:=BARSLAST(A1);
C1:=REF(B1,1)+1;
D1:=C<REF(C,C1) AND DIF>REF(DIF,C1) AND A1;
DRAWICON(D1,DIF,25);
STICKLINE(D1,DIF,DIF-0.5,0,0),COLORMAGENTA;
DRAWTEXT(D1,DIF-0.5,'底背离'),COLORMAGENTA;
A2:=CROSS(DEA,DIF);
B2:=BARSLAST(A2);
C2:=REF(B2,1)+1;
D2:=C>REF(C,C2) AND DIF<REF(DIF,C2) AND A2;
DRAWICON(D2,DIF,27);
STICKLINE(D2,DIF,DIF+0.5,0,0),COLORGREEN;
DRAWTEXT(D2,DIF+0.5,'顶背离'),COLORGREEN;
|
|