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統(tǒng)計(jì)學(xué)中為95%可信區(qū)間,2.58為99%可信區(qū)間,故采用1.96和2.58作為參數(shù)}
單邊上升:=(C>MID);
單邊下降:=(C<MID);
布林線開口:=UP-LOOW;
多頭行情:=C>MA(C,5) AND MA(C,5)>MA(C,10);
股價(jià)在高位:=((C-LLV(C,30))/(HHV(C,30)-LLV(C,30))>0.6);
股價(jià)在低位:=((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,5,0),COLORCYAN;
STICKLINE((OPEN >= CLOSE),HIGH,LOW,0,0),COLORCYAN;
STICKLINE((OPEN < CLOSE),OPEN,CLOSE,5,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,'減倉(cāng)'),color00FF00;
drawtext(ref(布林線開口,1)=hhv(布林線開口,20) and 單邊上升,up*1.08,'賣出'),colorwhite;
空倉(cāng):=(cross(mid,amount/v/100));
drawtext(空倉(cāng),up*1.05,'空倉(cāng)'),coloryellow;
drawtext(BARSLAST(布林線縮口)=1 and c<ma(c,10),up*1.08,'一輪跌勢(shì)起'),color00FF00;
適當(dāng)建倉(cāng):=(單邊上升 and FILTER(多頭行情,20) and v>ma(v,3));
drawtext(適當(dāng)建倉(cāng),loow,'適當(dāng)建倉(cāng)'),colorred;
加倉(cāng):=(單邊上升 and ref(c-mid,1)=llv(c-mid,5));
drawtext(加倉(cāng) and BARSLAST(適當(dāng)建倉(cāng))<BARSLAST(空倉(cāng)),loow,'加倉(cāng)'),colorff00ff;
一波行情起:=(BARSLAST(布林線縮口)<=3 and v>ma(v,3) and 股價(jià)在低位 and c>ref(c,1) and c>ma(c,10));
drawtext(FILTER(一波行情起,5),lower,'一波行情起'),colorred;
一波跌勢(shì)完:=(單邊下降 and BARSLAST(ref(布林線開口,1)=hhv(布林線開口,50))<=5 and loow>ref(loow,1) and c <mid) and 股價(jià)在低位;
drawtext(FILTER(一波跌勢(shì)完,5),lower,'搶反彈');
|