MID:MA(CLOSE,21),COLORWHITE;
UPPER:MID + 1.96*STD(CLOSE,21),COLORYELLOW;
LOWER:MID - 1.96*STD(CLOSE,21),COLORYELLOW;
UP:MID + 2.58*STD(CLOSE,21),COLORFF00FF;
LOOW:MID - 2.58*STD(CLOSE,21),COLORFF00FF;
{1.96统计学中为95%可信区间,2.58为99%可信区间,故采用1.96和2.58作为参数}
单边上升:=(C>MID);
单边下降:=(C
多头行情:=C>MA(C,5) AND MA(C,5)>MA(C,10);
股价在高位:=((C-LLV(C,30))/(HHV(C,30)-LLV(C,30))>0.6);
股价在低位:=((C-LLV(C,30))/(HHV(C,30)-LLV(C,30))<0.4);
布林线缩口:=((UPPER-MID)/MID<0.05);
STICKLINE(单边上升,MID,UP,6,0),COLOR330066;
STICKLINE(单边下降,LOOW,MID,6,0),COLOR545454;
DRAWTEXT(布林线缩口,MID,'▲'),COLORWHITE;
STICKLINE((OPEN >= CLOSE),OPEN,CLOSE,3,0),COLORCYAN;
STICKLINE((OPEN >= CLOSE),HIGH,LOW,0,0),COLORCYAN;
STICKLINE((OPEN < CLOSE),OPEN,CLOSE,3,0),COLORRED;
STICKLINE((OPEN < CLOSE),HIGH,LOW,0,0),COLORRED;
MID,COLORWHITE;
UPPER,COLORYELLOW;
LOWER,COLORYELLOW;
UP,COLORFF00FF;
LOOW,COLORFF00FF;
DRAWTEXT(单边上升 AND REF(C,1)>REF(UP,1) AND C < UP ,UP*1.08,'减仓'),COLOR00FF00;
DRAWTEXT(REF(布林线开口,1)=HHV(布林线开口,20) AND 单边上升,UP*1.08,'卖出'),COLORWHITE;
空仓:=(crOSS(MID,AMOUNT/V/100));
DRAWTEXT(空仓,UP*1.05,'空仓'),COLORYELLOW;
DRAWTEXT(BArslAST(布林线缩口)=1 AND C
DRAWTEXT(适当建仓,LOOW,'适当建仓'),COLORRED;
加仓:=(单边上升 AND REF(C-MID,1)=LLV(C-MID,5));
DRAWTEXT(加仓 AND BARSLAST(适当建仓)
DRAWTEXT(FILTER(一波行情起,5),LOWER,'一波行情起'),COLORRED;
一波跌势完:=(单边下降 AND BARSLAST(REF(布林线开口,1)=HHV(布林线开口,50))<=5 AND LOOW>REF(LOOW,1) AND C