阴线:=C<O;MID:=IF(PERIOD<=5,IF(C>1999,INTPART(EMA(CLOSE,20)),EMA(CLOSE,20)),IF(PERIOD>=6,IF(C>1999,INTPART(EMA(CLOSE,20)),EMA(CLOSE,20)),0));UPPER:=MID+2*STD(CLOSE,20);LOWER:=MID-2*STD(CLOSE,20);扩口:=UPPER-LOWER>REF(UPPER,1)-REF(LOWER,1); DRAWTEXT(扩口,MID,'开');布林上升趋势:=((MID>=REF(MID,1) AND UPPER>REF(UPPER,1)) OR (EVERY(C>REF(C,1),3) AND C>O AND EVERY(LOWER>=REF(LOWER,1),2)) OR ( MID>=REF(MID,1) AND EVERY(LOWER>=REF(LOWER,1),3)) OR (EVERY(C>=MID,2) AND EVERY(MID>=REF(MID,1),3))),NODRAW;布林下降趋势:=((MID<REF(MID,1) AND LOWER<REF(LOWER,1))OR (EVERY(阴线,2) AND L/REF(H,4)<0.9) OR (EVERY(C<=REF(C,1),3) AND C<=O AND EVERY(UPPER<=REF(UPPER,1),2)) OR (C<REF(C,1) AND EVERY(UPPER<REF(UPPER,1),3)) OR (EVERY(C<=MID,3) AND EVERY(MID<=REF(MID,1),3))),NODRAW;布林横向趋势:=(布林上升趋势=0 AND 布林下降趋势=0) OR (UPPER/LOWER<=1.15 AND NOT(扩口)),NODRAW;UPPER,COLORFF0000;LOWER,COLORFF00FF;IF(布林上升趋势,MID,DRAWNULL),COLORRED,LINETHICK3;IF(布林横向趋势,MID,DRAWNULL),COLORYELLOW,LINETHICK3;IF(布林下降趋势,MID,DRAWNULL),COLORGREEN,LINETHICK3;