再次优化抓涨停抓妖股主图公式,去掉不常用信号,送给大家
继续那句话,指标是机械的,判断和选择还是需要我们自己来完成,指标只是起到辅助的作用,锻炼看盘能力,这次优化精简了大部分代码,可以复制到文本里,再复制到指标编辑器,还有这个是通达信的主图指标。
{代码开始}
DRAWTEXT_FIX(1,0.300,0.1,0,DYBLOCK),COLORRED;{所属地域};
DRAWTEXT_FIX(1,0.384,0.1,0,HYBLOCK),COLORYELLOW;{所属行业};
DRAWTEXT_FIX(1,0.460,0.1,0,'【概念】:'),COLOR00A5FF;
DRAWTEXT_FIX(1,0.520,0.1,0,GNBLOCK),COLOR00A5FF;{概念};
现价线:STICKLINE(ISLASTBAR,C,C,2900,1),COLORYELLOW,LINETHICK1;
VAR11:=EMA(EMA(CLOSE,13),13);
控盘:=(VAR11-REF(VAR11,1))/REF(VAR11,1)*1000;
JJ:=DYNAINFO(11);
P:=55;S:=8;M1:=3;
财:=(EMA(CLOSE,S)-EMA(CLOSE,P))*10;
神:=EMA(财,M1);
BTJ1:=(C-JJ)/JJ<-0.03;
STJ1:=(C-JJ)/JJ>0.005;
BTJ2:=控盘>REF(控盘,1) AND 控盘<-0.2;
BTJ3:=CROSS(财,神) AND 财<-0.3;
BTJ4:=FILTER(BTJ1 AND BTJ2 AND BTJ3,13);
DRAWTEXT(BTJ4,LOW*0.99,'↖买底'),COLORRED;
MA05:MA(C,5)LINETHICK3,COLOR00CCFF;
MA10:=MA(C,10);
MA20:=MA(C,20);
MA30:=MA(C,30);
五日乖离率:=(C-MA05)/MA05*100;
BB05:=ATAN((MA05/REF(MA05,1)-1)*100)*180/3.1416;
速度5:=SMA(EMA((MA05-REF(MA05,1))/REF(MA05,1),3)*100,3,1);
加速度5:=EMA((速度5-REF(速度5,1)),3),NODRAW;
IF(BB05>30 AND MA05>REF(MA05,1), MA05,DRAWNULL),LINETHICK3,COLORRED;
BB10:=ATAN((MA10/REF(MA10,1)-1)*100)*180/3.1416;
IF(BB05<0 AND MA05<REF(MA05,1), MA05,DRAWNULL),LINETHICK3,COLORGREEN;
三拾日乖离率:=(C-MA30)/MA30*100,NODRAW;
VAR1:=(MA20-MA30)>REF((MA20-MA30),1) AND MA20>REF(MA20,1) AND MA30>REF(MA30,1);
VAR2:=(MA30-MA20)<REF((MA30-MA20),1) AND MA20<REF(MA20,1) AND MA30<REF(MA30,1);
BB30:=ATAN((MA30/REF(MA30,1)-1)*100)*180/3.1416;
强势狙击:=FILTER(BB30>30 AND BB10>45 AND CROSS(BB05,60),10);
加仓:=FILTER(COUNT(CROSS(BB05,30),5)>=1 AND MA05>REF(MA05,1) AND 三拾日乖离率>REF(三拾日乖离率,1) AND MA10>REF(MA10,1)
AND 加速度5>REF(加速度5,1) AND 速度5>REF(速度5,1) ,10) ;
清仓:=FILTER(COUNT(CROSS(30,BB05),5)>=1 AND (C>MA30 OR O>MA30) AND MA05<REF(MA05,1) AND 三拾日乖离率<REF(三拾日乖离率,1) AND MA10<REF(MA10,1),10);
{DRAWTEXT(加仓 ,LOW*0.98,'↖_____拉升'),COLORRED;}
JC:=CROSS(0,五日乖离率) AND 三拾日乖离率<REF(三拾日乖离率,1) AND MA10>REF(MA10,1) ;
减仓:=FILTER(JC,10);
MR:=COUNT(CROSS(五日乖离率,0),3)>=1 AND 三拾日乖离率>REF(三拾日乖离率,1) AND MA05>REF(MA05,1) AND (C/REF(C,1)-1)*100>5 AND REF(C,1)<MA30;
买入:=FILTER(MR,10);
DRAWTEXT(减仓,HIGH*1.02,'↙风险'),COLORCYAN;
DRAWTEXT(买入,LOW*0.93,'↖抓涨停'),COLORYELLOW;
DRAWTEXT(清仓 ,HIGH*1.02,'↙清仓'),COLORGREEN;
{买卖操盘主图}
MA5:=EMA(C,5),COLORWHITE;
EMA47:=EMA(C,47),LINETHICK0,COLORRED;
红线上涨:IF(EMA47>REF(EMA47,1),EMA47,DRAWNULL),LINETHICK3,COLORRED;
绿线下跌:IF(EMA47<=REF(EMA47,1),EMA47,DRAWNULL),LINETHICK3,COLORGREEN;
MA7:=MA(C,7),COLOR0000FF;
MA13:=MA(C,13),COLOR0096FF;
MA21:=MA(C,21),COLOR00FF99;
MA49:=MA(C,49),COLORFF00FF;
A:=BARSCOUNT(CLOSE);
AH:=HHV(HIGH,200);
AL:=LLV(LOW,200);
B0:=(AH-AL)/40;
B1:=HIGH+B0;
B2:=LOW-B0;
DRAWTEXT(IF(CROSS(69,SMA(MAX(CLOSE-REF(CLOSE,1),0),13,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),13,1)*100),1,0),HIGH*1.04,'↙卖错也卖'),COLORWHITE;
DRAWICON(IF(CROSS(69,SMA(MAX(CLOSE-REF(CLOSE,1),0),13,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),13,1)*100),1,0),HIGH*1.01,6);
LC:=REF(CLOSE,1);
RSI:=SMA(MAX(CLOSE-LC,0),4.1,1)/SMA(ABS(CLOSE-LC),4.1,1)*100;
{DRAWICON(CROSS(RSI,11) ,L*0.99,3);}
VAR28:=SMA(MAX(CLOSE-LC,0),5.5,1)/SMA(ABS(CLOSE-LC),6,1)*100;
VARA:=((AMOUNT)/(VOL))/(100);
VARB:=((3)*(HIGH)+LOW+OPEN+(2)*(CLOSE))/(7);
VARC:=((SUM(AMOUNT,7))/(VARA))/(100);
VARD:=DMA(VARB,(VOL)/(VARC));
VARE:=((CLOSE-VARD)/(VARD))*(100);
VARF:=((CLOSE-LLV(LOW,34))/(HHV(HIGH,34)-LLV(LOW,34)))*(100);
VARJ:=MA(VARE,20)+STD(VARE,20);
BIAS18:=((CLOSE-MA(CLOSE,18))/(MA(CLOSE,18)))*(100);
AA:=SMA(VARF,3,1);
SS:=(REF(BIAS18,1)>=5) AND CROSS(VARJ,VARE) AND (AA>79);
DRAWTEXT((REF(BIAS18,1)>=5) AND CROSS(VARJ,VARE) AND (AA>SS) AND CROSS(84,RSI),H*1.02,'↙__逃顶'),LINETHICK2,COLORGREEN;
DRAWTEXT(CROSS(84,RSI) AND CROSS(76,VAR28),H*1.01,'↙___快跑'),LINETHICK2,COLORYELLOW;
买线:=EMA(C,2);
卖线:=EMA(SLOPE(C,13)*21+C,49);
STICKLINE(CROSS(买线,卖线),OPEN,CLOSE,1.2,0),COLORYELLOW;
STICKLINE(CROSS(卖线,买线),OPEN,CLOSE,1.2,0),COLORBLUE;
V1:=EMA(CLOSE,60)-EMA(CLOSE,300);
V2:=EMA(V1,300);
V3:=(CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8))*100;
操盘线:=SMA(V3,2,1),LINETHICK3;
V5:=SMA(操盘线,2,1);
STICKLINE((REF(BIAS18,1)>=5) AND CROSS(VARJ,VARE) AND (AA>SS) AND CROSS(84,RSI) AND CROSS(76,VAR28),C,O,3,0),COLORGREEN,LINETHICK2;{底位红色}
STICKLINE(操盘线>REF(操盘线,1) AND CROSS(操盘线,V5) AND V5<50 AND MA13<REF(MA13,1),C,O,3,0),COLORMAGENTA,LINETHICK2;{底位红色};
MA54:=MA(CLOSE,54);
MA60:=MA(CLOSE,60);
MA120:=MA(CLOSE,120);
HJ_8:=(REF(CLOSE,3)-CLOSE)/REF(CLOSE,3)*100>5;
HJ_9:=FILTER(HJ_8,10);
HJ_10:=BARSLAST(HJ_9);
HJ_11:=REF(HIGH,HJ_10+2);
HJ_12:=REF(HIGH,HJ_10+1);
HJ_13:=REF(HIGH,HJ_10);
HJ_14:=MAX(HJ_11,HJ_12);
HJ_15:=MAX(HJ_14,HJ_13);
HJ_16:=(CLOSE-REF(CLOSE,1))/REF(CLOSE,1)*100>5;
HJ_17:=HJ_10<150;
HJ_18:=(OPEN-HJ_15)/HJ_15*100<30;
HJ_19:=(CLOSE-LLV(LOW,HJ_10))/LLV(LOW,HJ_10)*100<50;
HJ_20:=(CLOSE-REF(OPEN,5))/REF(OPEN,5)*100<30;
HJ_21:=VOL/MA(VOL,5)<3.5;
HJ_22:=(CLOSE-REF(CLOSE,89))/REF(CLOSE,89)*100<80;
HJ_25:=HJ_16 AND HJ_17 AND HJ_18 AND HJ_19 AND HJ_20 AND HJ_21 AND HJ_22;
暴利:=FILTER(HJ_25,15);
PL1:=(((CLOSE-MA54)/MA54)<0.1);
PL2:=(((CLOSE-MA10)/MA10)<0.3);
偏离率:=(((PL1=1) AND (PL2=1))*0.2);
平台突破:=((((偏离率=0) AND (REF(偏离率,1)=0.2)) AND (REF((COUNT((偏离率=0.2),10)=10),1)=1))*-0.1);
妖股突破:=平台突破=-0.1;
XDF:=(暴利 OR 妖股突破);
VARAA:=DYNAINFO(7)/(REF(CLOSE,1))>1.05 AND (DYNAINFO(7)/O>1.05);
FLIGA:=(VOL/REF(VOL,1)>1.2 AND COUNT(CLOSE>OPEN,1)) OR (LOW>REF(HIGH,1) AND COUNT(OPEN>CLOSE,1) AND VOL/REF(VOL,1)>1.2);
妖股:=XDF AND C/REF(C,1)>1.08 AND FLIGA AND VARAA;
DRAWTEXT(妖股,LOW*0.98,' ↖妖股'),COLORYELLOW;
{代码结束}