P:=10;
A:=5;
Svol:=INTPART(SUM(V,0)/CAPITAL);
TJ0:=SVOL>REF(SVOL,1) OR BARSSINCE(CLOSE)=0;
S1:=BArslAST(TJ0)+1;
TJ2:=S1<REF(S1,1);
S2:=IF(TJ2,REF(S1,1)+1,S1);
S3:=SUM(TJ2,0);
ZK1:="kd.K#WEEK"(9,3,3);
ZD2:="KD.D#WEEK"(9,3,3);
ZF1:="macd.DIF#WEEK"(12,26,9);
ZA2:="MacD.DEA#WEEK"(12,26,9);
换手:=V/CAPITAL*100;
JCD:=FILTER(crOSS(ZK1,ZD2) AND REF(ZD2,1)<30,13);
取点:=BARSLAST(JCD);
吸筹区:=IF(取点>0 AND 取点<61,取点,0);
ZS1:=吸筹区;
ZS2:=吸筹区+1;
ZS3:=换手/5;
ZSA:=IF(ZS1>0,SUM((ZS3),吸筹区+1),0);
主力筹码%:=ZSA;
建仓天数:=ZS1;
阶段总额(万):=SUM(AMOUNT/10000,S2)*100;
阶段总量(手):=SUM(V,S2)*100;
阶段成本(元):=(阶段总额(万)/(阶段总量(手)/100));
TJ1:=JCD;
N:=2.5;
VAR2:=LLV(LOW,10);
VAR3:=HHV(HIGH,25);
卖出:=14.5*N;
清仓:=17.5*N;
动力线:= (EMA((CLOSE-VAR2)/(VAR3-VAR2)*4,4)*10-17.5)*N;
底部:=-15.5*N;
关注:=-12.5*N;
T1:=FILTER(CROSS(动力线,关注),20);
T2:=FILTER(CROSS(动力线,底部),20);
T3:=FILTER(CROSS(清仓,动力线),20);
T4:=FILTER(CROSS(卖出,动力线),20);
RSV:=((((HHV(HIGH,P) - CLOSE) / (HHV(HIGH,P) - LLV(LOW,P))) * 200) - 125);
散户:=SMA(RSV,A,1)+15;
RSV1:=((((CLOSE - LLV(LOW,P)) / (HHV(HIGH,P) - LLV(LOW,P))) * 200) - 105);
主力:=SMA(RSV1,A,1)+15;
准备起爆:=CROSS(主力,散户);
TJ8:=准备起爆;
阴跌:=CROSS(散户,主力);
TTJ8:=EXIST(阴跌,8);
XG:TJ1 OR TJ8 AND TTJ8;