一、公式源码
{龙头凤尾主图}
A0:=((L+H+C*2)/4);
上:EMA(A0,14)*1.1382,COLORYELLOW,LINETHICK2;
{涨停表示}
LA:=BARSLAST(C>REF(C,1)*1.098);
LC:=REF(CLOSE,LA);
LO:=REF(OPEN,LA);
LAL:=REF(L,LA);
LAH:=REF(H,LA);
一涨停:=EVERY(C/REF(C,1)>=1.097 AND C=H,1);
双涨停:=EVERY(C/REF(C,1)>=1.097 AND C=H,2);
三涨停:=EVERY(C/REF(C,1)>=1.097 AND C=H,3) AND H>L;
策略1A:=EXIST((C/REF(C,2)-1)*100>20,2) AND COUNT(LC>LO,3)>=1 AND O<REF(C,1) AND C<REF(C,1) AND C>O AND C>REF(O,1) AND REF(C,1)>REF(C,2) ;
策略1B:=EXIST(双涨停,3) AND COUNT(LC>LO,4)>=1 AND O<REF(C,1) AND C<REF(C,1) AND C>O AND C>REF(O,1) AND REF(C,1)>REF(C,2) ;
DRAWTEXT(策略1A,LOW,'↖①'),COLORYELLOW;
DRAWTEXT(策略1B,LOW,'↖①'),COLORYELLOW;
角度:=ATAN((MA(C,5)/REF(MA(C,5),1)-1)*100)*57.3;
持有:=EXIST(一涨停,5) AND 角度>75 AND C>上 AND C>REF(C,1) AND C>上 ;
突破:=角度>75 AND C>上 AND C>REF(C,1) AND C>上 {AND (H/C)<1.038};
DRAWTEXT(持有,LOW,'↖龙'),COLORYELLOW;
STICKLINE(突破,O,C,1,0),COLORMAGENTA;
涨停:=IF((C-REF(C,1))*100/REF(C,1)>=(10-0.01*100/REF(O,1)),1,0);
STICKLINE(涨停,O,C,1,0),COLORYELLOW;
ZDF:=(C-REF(C,1))/REF(C,1)*100;
STICKLINE(ZDF<-9.9,O,C,1,0),COLORBLUE;
{龙头凤尾副图}
X:=REF(((HHV(HIGH,55)-LLV(LOW,55))/LLV(LOW,55)),1)<=(25/100)
AND CLOSE>=REF(HHV(HIGH,55),1) AND BARSCOUNT(CLOSE)>55;
TOP1:=MA(CLOSE,10);
TOP2:=MA(CLOSE,55);
TOP3:=(REF(CLOSE,3)-CLOSE)/REF(CLOSE,3)*100>5;
TOP4:=FILTER(TOP3,10);
TOP5:=BARSLAST(TOP4);
TOP6:=REF(HIGH,TOP5+2);
TOP7:=REF(HIGH,TOP5+1);
TOP8:=REF(HIGH,TOP5);
TOP9:=MAX(TOP6,TOP7);
TOP10:=MAX(TOP9,TOP8);
TOP11:=(CLOSE-REF(CLOSE,1))/REF(CLOSE,1)*100>5;
TOP12:=TOP5<150;
TOP13:=(OPEN-TOP10)/TOP10*100<30;
TOP14:=(CLOSE-LLV(LOW,TOP5))/LLV(LOW,TOP5)*100<50;
TOP15:=(CLOSE-REF(OPEN,5))/REF(OPEN,5)*100<30;
TOP16:=VOL/MA(VOL,5)<3.5;
TOP17:=(CLOSE-REF(CLOSE,89))/REF(CLOSE,89)*100<80;
TOP18:=TOP11 AND TOP12 AND TOP13 AND TOP14 AND TOP15 AND TOP16 AND TOP17;
TOP19:=FILTER(TOP18,15);
TOP20:=(CLOSE-TOP2)/TOP2<0.1;
TOP21:=(CLOSE-TOP1)/TOP1<0.3;
TOP22:=(TOP20=1 AND TOP21=1)*0.2;
TOP23:=(TOP22=0 AND REF(TOP22,1)=0.2 AND REF(COUNT(TOP22=0.2,10)=10,1)=1)*(-0.1);
TOP24:=TOP23=(-0.1);
TOP25:=TOP19 OR TOP24;
TOP27:=VOL/REF(VOL,1)>1.2 AND CLOSE>OPEN OR (LOW>REF(HIGH,1) AND OPEN>CLOSE AND VOL/REF(VOL,1)>1.2);
TOP28:=IF(CODELIKE(3) OR (CODELIKE(4) AND DATE>=1200824),CLOSE>=ZTPRICE(REF(CLOSE,1),0.2) AND CLOSE=HIGH,CLOSE>=ZTPRICE(REF(CLOSE,1),0.1) AND CLOSE=HIGH);
TOP29:=TOP25 AND TOP27 AND TOP28 AND REF(NOT(TOP28),1);
DIF:=MA(CLOSE,10)-MA(CLOSE,50);
DIFMA:=MA(DIF,10);
TOP31:=(DIF>DIFMA) AND (REF(DIF,1)<REF(DIFMA,1));
TOP32:=TOP29 OR TOP31;
X1:=ABS(MA(C,10)/MA(C,20)-1)<0.01;
X2:=ABS(MA(C,5)/MA(C,10)-1)<0.01;
X3:=ABS(MA(C,5)/MA(C,20)-1)<0.01;
X4:=O/REF(C,1)<1.01 AND C>O AND MA(C,5)>REF(MA(C,5),1);
X5:=REF(X1 AND X2 AND X3,1) AND MA(C,5)>MA(C,10) AND MA(C,10)>MA(C,20);
A:=X AND X4 AND X5;RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);D:=SMA(K,3,1);
J:=3*K-2*D;A1:=(MA(C,3)+MA(C,6)+MA(C,12)+MA(C,24))/4;
A2:=REF(A1,1)<A1;A3:=A1+6*STD(A1,11);
A4:=REF(A3,1)<A3 AND REF(A3,1)<REF(A3,2);
A5:=MA(C,5)>REF(MA(C,5),1) AND MA(C,10)>REF(MA(C,10),1) AND MA(C,20)>REF(MA(C,20),1);
A6:=REF(MA(C,5),1)<REF(MA(C,5),2) AND REF(MA(C,10),1)<REF(MA(C,10),2) AND REF(MA(C,20),1)<REF(MA(C,20),2);
A7:=REF(C/REF(C,1)<1.01,1);
FF:=EMA(C,3);MA15:=EMA(C,21);
AA:=CROSS(FF,MA15) AND J>REF(J,1) AND C/REF(C,1)>1.03;
AA1:=REF(J<REF(J,1),1) AND H/C<1.015;
AA2:=CROSS(C,A1) AND A2 AND A4 AND A5 AND A7;
AA3:=C>O AND O/REF(C,1)<1.01 AND REF(C<O OR C>O,2);
AA4:=COUNT(C>O,4)>=2 AND COUNT(C<O,4)>=1;
AA5:=AA AND AA1 AND AA2 AND AA3 AND AA4;
XG:=FILTER(AA5 OR A,5);
XGG:=TOP32 AND XG;
龙头:IF( XG,45,0),STICK,LINETHICK8,COLORYELLOW;
凤尾:IF( XGG,55,0),STICK,LINETHICK5,COLORRED;
DRAWTEXT( XG,30,' .龙头'),COLORYELLOW;
DRAWTEXT( XGG,50,' 凤尾'),COLORRED;
{龙头选股}
X:=REF(((HHV(HIGH,55)-LLV(LOW,55))/LLV(LOW,55)),1)<=(25/100)
AND CLOSE>=REF(HHV(HIGH,55),1) AND BARSCOUNT(CLOSE)>55;
X1:=ABS(MA(C,10)/MA(C,20)-1)<0.01;
X2:=ABS(MA(C,5)/MA(C,10)-1)<0.01;
X3:=ABS(MA(C,5)/MA(C,20)-1)<0.01;
X4:=O/REF(C,1)<1.01 AND C>O AND MA(C,5)>REF(MA(C,5),1);
X5:=REF(X1 AND X2 AND X3,1) AND MA(C,5)>MA(C,10) AND MA(C,10)>MA(C,20);
A:=X AND X4 AND X5;RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);D:=SMA(K,3,1);
J:=3*K-2*D;A1:=(MA(C,3)+MA(C,6)+MA(C,12)+MA(C,24))/4;
A2:=REF(A1,1)<A1;A3:=A1+6*STD(A1,11);
A4:=REF(A3,1)<A3 AND REF(A3,1)<REF(A3,2);
A5:=MA(C,5)>REF(MA(C,5),1) AND MA(C,10)>REF(MA(C,10),1) AND MA(C,20)>REF(MA(C,20),1);
A6:=REF(MA(C,5),1)<REF(MA(C,5),2) AND REF(MA(C,10),1)<REF(MA(C,10),2) AND REF(MA(C,20),1)<REF(MA(C,20),2);
A7:=REF(C/REF(C,1)<1.01,1);
FF:=EMA(C,3);MA15:=EMA(C,21);
AA:=CROSS(FF,MA15) AND J>REF(J,1) AND C/REF(C,1)>1.03;
AA1:=REF(J<REF(J,1),1) AND H/C<1.015;
AA2:=CROSS(C,A1) AND A2 AND A4 AND A5 AND A7;
AA3:=C>O AND O/REF(C,1)<1.01 AND REF(C<O OR C>O,2);
AA4:=COUNT(C>O,4)>=2 AND COUNT(C<O,4)>=1;
AA5:=AA AND AA1 AND AA2 AND AA3 AND AA4;
XG:FILTER(AA5 OR A,5);
{凤尾选股}
X:=REF(((HHV(HIGH,55)-LLV(LOW,55))/LLV(LOW,55)),1)<=(25/100)
AND CLOSE>=REF(HHV(HIGH,55),1) AND BARSCOUNT(CLOSE)>55;
X1:=ABS(MA(C,10)/MA(C,20)-1)<0.01;
X2:=ABS(MA(C,5)/MA(C,10)-1)<0.01;
X3:=ABS(MA(C,5)/MA(C,20)-1)<0.01;
X4:=O/REF(C,1)<1.01 AND C>O AND MA(C,5)>REF(MA(C,5),1);
X5:=REF(X1 AND X2 AND X3,1) AND MA(C,5)>MA(C,10) AND MA(C,10)>MA(C,20);
A:=X AND X4 AND X5;RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);D:=SMA(K,3,1);
J:=3*K-2*D;A1:=(MA(C,3)+MA(C,6)+MA(C,12)+MA(C,24))/4;
A2:=REF(A1,1)<A1;A3:=A1+6*STD(A1,11);
A4:=REF(A3,1)<A3 AND REF(A3,1)<REF(A3,2);
A5:=MA(C,5)>REF(MA(C,5),1) AND MA(C,10)>REF(MA(C,10),1) AND MA(C,20)>REF(MA(C,20),1);
A6:=REF(MA(C,5),1)<REF(MA(C,5),2) AND REF(MA(C,10),1)<REF(MA(C,10),2) AND REF(MA(C,20),1)<REF(MA(C,20),2);
A7:=REF(C/REF(C,1)<1.01,1);
FF:=EMA(C,3);MA15:=EMA(C,21);
AA:=CROSS(FF,MA15) AND J>REF(J,1) AND C/REF(C,1)>1.03;
AA1:=REF(J<REF(J,1),1) AND H/C<1.015;
AA2:=CROSS(C,A1) AND A2 AND A4 AND A5 AND A7;
AA3:=C>O AND O/REF(C,1)<1.01 AND REF(C<O OR C>O,2);
AA4:=COUNT(C>O,4)>=2 AND COUNT(C<O,4)>=1;
AA5:=AA AND AA1 AND AA2 AND AA3 AND AA4;
XG:=FILTER(AA5 OR A,5);
TOP1:=MA(CLOSE,10);
TOP2:=MA(CLOSE,55);
TOP3:=(REF(CLOSE,3)-CLOSE)/REF(CLOSE,3)*100>5;
TOP4:=FILTER(TOP3,10);
TOP5:=BARSLAST(TOP4);
TOP6:=REF(HIGH,TOP5+2);
TOP7:=REF(HIGH,TOP5+1);
TOP8:=REF(HIGH,TOP5);
TOP9:=MAX(TOP6,TOP7);
TOP10:=MAX(TOP9,TOP8);
TOP11:=(CLOSE-REF(CLOSE,1))/REF(CLOSE,1)*100>5;
TOP12:=TOP5<150;
TOP13:=(OPEN-TOP10)/TOP10*100<30;
TOP14:=(CLOSE-LLV(LOW,TOP5))/LLV(LOW,TOP5)*100<50;
TOP15:=(CLOSE-REF(OPEN,5))/REF(OPEN,5)*100<30;
TOP16:=VOL/MA(VOL,5)<3.5;
TOP17:=(CLOSE-REF(CLOSE,89))/REF(CLOSE,89)*100<80;
TOP18:=TOP11 AND TOP12 AND TOP13 AND TOP14 AND TOP15 AND TOP16 AND TOP17;
TOP19:=FILTER(TOP18,15);
TOP20:=(CLOSE-TOP2)/TOP2<0.1;
TOP21:=(CLOSE-TOP1)/TOP1<0.3;
TOP22:=(TOP20=1 AND TOP21=1)*0.2;
TOP23:=(TOP22=0 AND REF(TOP22,1)=0.2 AND REF(COUNT(TOP22=0.2,10)=10,1)=1)*(-0.1);
TOP24:=TOP23=(-0.1);
TOP25:=TOP19 OR TOP24;
TOP27:=VOL/REF(VOL,1)>1.2 AND CLOSE>OPEN OR (LOW>REF(HIGH,1) AND OPEN>CLOSE AND VOL/REF(VOL,1)>1.2);
TOP28:=IF(CODELIKE(3) OR (CODELIKE(4) AND DATE>=1200824),CLOSE>=ZTPRICE(REF(CLOSE,1),0.2) AND CLOSE=HIGH,CLOSE>=ZTPRICE(REF(CLOSE,1),0.1) AND CLOSE=HIGH);
TOP29:=TOP25 AND TOP27 AND TOP28 AND REF(NOT(TOP28),1);
DIF:=MA(CLOSE,10)-MA(CLOSE,50);
DIFMA:=MA(DIF,10);
TOP31:=(DIF>DIFMA) AND (REF(DIF,1)<REF(DIFMA,1));
TOP32:=TOP29 OR TOP31;
XGG:TOP32 AND XG;
二、公式简介
指标包括一主图,一副图,两选股指标,手机电脑通达信通用,信号仅供参考
本指标是短线波段指标,包括龙头选股和凤尾选股两个选股信号,当龙头信号和凤尾信号同时出现的时候参考的概率大。
、
三、公式图示