M1:=6;
M2:=12;
M3:=23;
M4:=3;
BBI:=(MA(CLOSE,M1)+MA(CLOSE,M2)+MA(CLOSE,M3)+MA(CLOSE,M4))/4,LINETHICK5;
IF(CLOSE>BBI,BBI,NULL),COLORMAGENTA,LINETHICK5;
IF(CLOSE<BBI,BBI,NULL),COLORGREEN,LINETHICK5;
MID:MA(CLOSE,23),COLORYELLOW,LINETHICK1,LINETHICK5;
TMP2:=STD(CLOSE,23);
TOP:MID+2*TMP2,RGB(255,128,64),LINETHICK3;
BOTTOM:MID-2*TMP2,COLORCYAN,LINETHICK3;
DRAWCOLORLINE(BBI<MID,MID,COLORGREEN,COLORRED),LINETHICK5;
//A:EMA2(HIGH,30);
//B:EMA2(LOW,30);
S:=CROSS(CLOSE,EMA2(HIGH,23));
X:=CROSS(EMA2(LOW,23),CLOSE);
WS:=BARSLAST(S)+1;
WX:=BARSLAST(X)+1;
SS:=CROSS(SUM(S,WX),0.5);
XX:=CROSS(SUM(X,WS),0.5);
DRAWTEXT(SS,LOW,'B'),ALIGN2,FONTSIZE20,COLORYELLOW;
DRAWTEXT(XX,HIGH,'S'),ALIGN2,FONTSIZE20,COLORYELLOW;
DRAWCOLORKLINE(BARSLAST(SS)<BARSLAST(XX)&&(ISUP||ISEQUAL),COLORRED,1);
DRAWCOLORKLINE(BARSLAST(SS)<BARSLAST(XX)&&ISDOWN,COLORCYAN,0);
DRAWCOLORKLINE(BARSLAST(SS)>BARSLAST(XX)&&ISDOWN,COLORCYAN,0);
DRAWCOLORKLINE(BARSLAST(SS)>BARSLAST(XX)&&(ISUP||ISEQUAL),COLORCYAN,1);
加个ATR 参数23 止损开仓减 ATR 值 止盈2倍ATR
(来源:文华财经)