{周涨 N=1,3,1 P1=2,10,5, P2=1,20,5}
DAYS1990:=DATETODAY(DATE); {从1990.12.19开始计算到当前的总天数}
Z:=((DAYS1990-REF(DAYS1990,1)) (WEEKDAY-REF(WEEKDAY,1))) OR BARSCOUNT(C)=1; {看两个相邻周期是否跨周}
T:=BARSLAST(Z);
C1:=REF(C,T+1);
O1:=IF(T,REF(O,T),O);
周最高%:=(HHV(H,T+1)-C1)/C1*100;
周最低%:=(LLV(L,T+1)-C1)/C1*100;
T2:=IF(REF(Z,T+1)=1,T+2,IF(REF(Z,T+2)=1,T+3,IF(REF(Z,T+3)=1,T+4,
IF(REF(Z,T+4)=1,T+5,T+6))));
C2:=REF(C,T2);
CC:=IF(DYNAINFO(4) 0,C,DYNAINFO(3));
T3:=IF(REF(Z,T2+1)=1,T2+1,IF(REF(Z,T2+1)=1,T2+2,IF(REF(Z,T2+2)=1,T2+3,
IF(REF(Z,T2+3)=1,T2+4,T2+5))));
C3:=REF(C,T3);
CCC:=IF(DYNAINFO(4) 0,C,DYNAINFO(3));
三周涨%:=(CCC-C3)/C3*100;
二周涨%:=(CC-C2)/C2*100;
上周涨%:=二周涨%-(CC-C1)/C1*100;
周涨%:=(CC-C1)/C1*100;
下压%:=IF(周涨% =0,周最高%-周涨%,周最高%-(O1-C1)/C1*100);
上功%:=IF(周涨% =0,(O1-C1)/C1*100-周最低%,周涨%-周最低%);
下压% N AND 周涨% 1 AND 周涨% P1 AND 上周涨% P2 AND 三周涨%