条件1:前面有K线的最高价突破布林上轨并且c>布林中轨,现K线死叉MA5,后面的K线为绿色,金叉MA5后K线为红色!
条件2:前面有K线的最低价跌破布林下轨并且c<布林中轨,现K线金叉MA5,后面的K线为红色,死叉MA5后K线为绿色!
文华财经boll交易辅助买卖预警指标公式源码:
TMP2:=STD(CLOSE,26);
TOP:MID+2*TMP2;
BOTTOM:MID-2*TMP2;
MA5:MA(C,5);
CROSSDOWN(C,MID)&&EXIST(H>TOP,BARSLAST(CROSS(C,MID))),SOUND(‘A’);
CROSSDOWN(C,MID)&&EXIST(H>TOP,BARSLAST(CROSS(C,MID))),NOTICE;
CROSSDOWN(C,MID)&&EXIST(H>TOP,BARSLAST(CROSS(C,MID))),ICON(0,’ICO4′),VALIGN0;
DRAWCOLORKLINE(ISDOWN=0,COLORWHITE,1);
DRAWCOLORKLINE(ISDOWN=1,COLORWHITE,0);
DRAWCOLORKLINE(CROSSDOWN(C,MID)&&EXIST(H>TOP,BARSLAST(CROSS(C,MID)))&&ISDOWN=0,COLORYELLOW,1);
DRAWCOLORKLINE(CROSSDOWN(C,MID)&&EXIST(H>TOP,BARSLAST(CROSS(C,MID)))&&ISDOWN=1,COLORYELLOW,0);
CROSS(C,MID)&&EXIST(L<BOTTOM,BARSLAST(CROSSDOWN(C,MID))),SOUND(‘B’);
CROSS(C,MID)&&EXIST(L<BOTTOM,BARSLAST(CROSSDOWN(C,MID))),NOTICE;
CROSS(C,MID)&&EXIST(L<BOTTOM,BARSLAST(CROSSDOWN(C,MID))),ICON(1,’ICO5′);
DRAWCOLORKLINE(CROSS(C,MID)&&EXIST(L<BOTTOM,BARSLAST(CROSSDOWN(C,MID)))&&ISDOWN=0,COLORMAGENTA,1);
DRAWCOLORKLINE(CROSS(C,MID)&&EXIST(L<BOTTOM,BARSLAST(CROSSDOWN(C,MID)))&&ISDOWN=1,COLORMAGENTA,0);
DRAWCOLORKLINE(C<MA5 && C>MID &&EXIST(H>TOP,BARSLAST(CROSS(C,MID)))&&ISDOWN=0,COLORGREEN,1);
DRAWCOLORKLINE(C<MA5 && C>MID &&EXIST(H>TOP,BARSLAST(CROSS(C,MID)))&&ISDOWN=1,COLORGREEN,0);
DRAWCOLORKLINE(C>MA5 && C>MID &&EXIST(H>TOP,BARSLAST(CROSS(C,MID)))&&ISDOWN=0,COLORRED,1);
DRAWCOLORKLINE(C>MA5 && C>MID &&EXIST(H>TOP,BARSLAST(CROSS(C,MID)))&&ISDOWN=1,COLORRED,0);
DRAWCOLORKLINE(C<MA5 && C<MID &&EXIST(L<BOTTOM,BARSLAST(CROSSDOWN(C,MID)))&&ISDOWN=0,COLORGREEN,1);
DRAWCOLORKLINE(C<MA5 && C<MID &&EXIST(L<BOTTOM,BARSLAST(CROSSDOWN(C,MID)))&&ISDOWN=1,COLORGREEN,0);
DRAWCOLORKLINE(C>MA5 && C<MID &&EXIST(L<BOTTOM,BARSLAST(CROSSDOWN(C,MID)))&&ISDOWN=0,COLORRED,1);
DRAWCOLORKLINE(C>MA5 && C<MID &&EXIST(L<BOTTOM,BARSLAST(CROSSDOWN(C,MID)))&&ISDOWN=1,COLORRED,0);