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;
F:=EMA(CLOSE,10)-EMA(CLOSE,22);
A:=EMA(F,8);
MD:=(F-A)*2;
HS:=IF(CURRBARSCOUNT=1 AND PERIOD=5,vol*240/FROMOPEN,VOL)/CAPITAL*100;
周期:=BArslAST(crOSS(F,A) AND A<=0.05)+1;
绿柱:=BARSLASTCOUNT(MD1;
红柱:=BARSLASTCOUNT(MD>REF(MD,1))>1;
绿柱群:=BARSLASTCOUNT(绿柱);
红柱群:=BARSLASTCOUNT(红柱);
绿柱群统计:=COUNT(绿柱群,周期);
红柱群统计:=COUNT(红柱群,周期);
DIF:=EMA(HS,13)-EMA(HS,26);
DEA:=EMA(DIF,10);
macd:=DIF-DEA;
量缩:=REF(BARSLASTCOUNT(HS<=REF(HS,1)),1)>1;
量缩1:=REF(BARSLASTCOUNT(HS<=MA(HS,10)),1)>1;
量缩2:=REF(BARSLASTCOUNT(MacD<=REF(MACD,1)),1)>1;
量缩3:=量缩 OR 量缩1 OR 量缩2;
倍量:=HS>=REF(HS,1)*2.98;
梯量:=量缩3 AND 倍量;
前量成立:=REF(COUNT(C>O AND C>H*0.8 AND (C-REF(C,1))/REF(C,1)*100>=5,周期)>0,1);
前量1:=HHV(HS,BARSLAST(C>O AND C>H*0.8 AND (C-REF(C,1))/REF(C,1)*100>=5));
前量2:=HHV(HS,BARSLAST(CROSS(J,100))+1);
反转量:=IF(前量成立,HS>REF(前量1,1) ,HS>REF(前量1,1) AND HS>REF(前量2,1));
换手翻红:=HS>=3;
回调1:=BARSLASTCOUNT(MD<=REF(MD,1));
回调2:=BARSLASTCOUNT(MAX(C,O)<=REF(MAX(C,O),1));
回调3:=BARSLASTCOUNT(C<=MA(C,10));
回调:=REF(回调1,1)>1 OR REF(回调2,1)>1 OR REF(回调3,1)>1;
启动1:=C>MA(C,10) AND C>REF(MAX(C,O),1) AND (O-REF(C,1))/REF(C,1)*100<=3;
启动2:=C>MA(C,10) AND MD>REF(MD,1) AND (O-REF(C,1))/REF(C,1)*100<=3;
TJ:=REF(绿柱群统计<2 OR 红柱群统计<1,1);
TJ1:=梯量;
TJ2:=反转量;
TJ3:=换手翻红;
TJ4:=回调 AND 启动1;
TJ5:=回调 AND 启动2;
N:=BARSLAST(REF(BARSLASTCOUNT(MD1,1) AND MD>REF(MD,1) AND MD<0)+1;
CL:=SUM((C-MIN(L,REF(C,1)))*VOL/10000/(MAX(REF(C,1),H)-MIN(REF(C,1),L)),N);
CH:=SUM((MAX(H,REF(C,1))-C)*VOL/10000/(MAX(REF(C,1),H)-MIN(REF(C,1),L)),N);
XGK:=TJ AND TJ1 AND TJ2 AND TJ3 AND TJ4 AND REF(周期,1)>2 AND INDEXC>MA(INDEXC,10) AND INDEXADV>INDEXDEC;
XGM:=TJ AND TJ1 AND TJ2 AND TJ3 AND TJ5 AND REF(周期,1)>2 AND INDEXC>MA(INDEXC,10) AND INDEXADV>INDEXDEC;
XG:=XGK OR XGM;
启爆翻红:XG;