帝王剑1:=EMA(EMA(H,60),60);
帝王剑2:=EMA(EMA(L,60),60);
QS:=(帝王剑1+帝王剑2)/2;
帝王剑3:=EMA(SLOPE((CLOSE+HIGH+LOW)/3,22)*10+(CLOSE+HIGH+LOW)/3,44),COLORWHITE,LINETHICK2;
DQS:=帝王剑3>=QS;
KQS:=帝王剑3<=QS;
帝王剑8:=4*SMA((C-LLV(L,5))/(HHV(H,5)-LLV(L,5))*100,5,1)-3*SMA(SMA((C-LLV(L,5))/(HHV(H,5)-LLV(L,5))*100,5,1),3.2,1);
帝王剑9:=(C-LLV(L,6))/(HHV(H,6)-LLV(L,6))*100;
K6:=SMA(帝王剑9,3,1);
D6:=SMA(K6,3,1);
J6:=3*K6-2*D6;
帝王剑A1:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;
K9:=SMA(帝王剑A1,3,1);
D9:=SMA(K9,3,1);
J9:=3*K9-2*D9;
AA:=(H+L+C+O)/4;
O1:=HHV(AA,5);
O2:=LLV(AA,5);
O3:=O1-O2;
JX5:=EMA((AA-O2)/O3,2)*100;
C1:=HHV(AA,10);
C2:=LLV(AA,10);
C3:=C1-C2;
JX10:=EMA((AA-C2)/C3,2)*100;
MX:=(帝王剑8+J6+J9+JX10*1)/4;
JXJ1:=REF(JX10,1)< 15 AND JX10>15 AND MX< 20;
JXJ:=JXJ1=1 OR JX10< 15 AND MX< 20;
MQ1:=MX>REF(MX,1) AND REF(MX,2)>REF(MX,1) AND JXJ=1 AND DQS=1;
MQ2:=MX>REF(MX,1) AND REF(MX,2)>REF(MX,1) AND JXJ=1 AND DQS=1;
GD:=IF(JX10=HHV(JX10,12),1,0);
DD:=IF(JX10=LLV(JX10,12),1,0);
DRAWLINE(DD,JX10,GD, JX10,0),COLORRED,DOTLINE;
DRAWLINE(GD,JX10,DD, JX10,0),COLORYELLOW,DOTLINE;
DRAWTEXT(ISLASTBAR,90,'双龙'),COLORBLUE;
DRAWTEXT(ISLASTBAR,10,'帝王'),COLORRED;
帝王剑4:=REF(JX10,1)< 15 AND JX10>15 AND MX< 20;
帝王剑5:=帝王剑4=1 OR JX10< 15 AND MX< 20;
帝王剑6:=MX>REF(MX,1) AND REF(MX,2)>REF(MX,1) AND 帝王剑5=1 AND DQS=1;
帝王剑7:=MX>REF(MX,1) AND REF(MX,2)>REF(MX,1) AND 帝王剑5=1 AND DQS=1;
帝王剑:=帝王剑6=1 OR 帝王剑7=1;
DRAWICON(帝王剑=1,80,38);
DRAWICON(帝王剑=1,75,38);
DRAWICON(帝王剑=1,70,29);
DRAWICON(帝王剑=1,65,29);
DRAWICON(帝王剑=1,60,29);
DRAWICON(帝王剑=1,55,29);
DRAWICON(帝王剑=1,50,29);
DRAWICON(帝王剑=1,45,29);
DRAWICON(帝王剑=1,40,29);
DRAWICON(帝王剑=1,35,29);
DRAWICON(帝王剑=1,30,29);
DRAWICON(帝王剑=1,25,29);
STICKLINE(帝王剑=1,21,24,10,0),COLORYELLOW;
STICKLINE(帝王剑=1,17,20,5,0),COLORRED;
STICKLINE(帝王剑=1,16,6,2,0),COLORRED;
DRAWICON(帝王剑=1,6,13);