主力:=EMA((EMA(CLOSE,500)-REF(EMA(CLOSE,500),1))/REF(EMA(CLOSE,500),1)*100,120)-0.0004;
散户:=EMA((EMA(CLOSE,500)-REF(EMA(CLOSE,500),1))/REF(EMA(CLOSE,500),1)*100,200);
首次攻击:=CROSS(主力,散户),LINETHICK2,COLORff7f50;
Q:=BETWEEN(C/(SUM(AMOUNT,BARSCOUNT(C))/SUM(VOL*100,BARSCOUNT(C))),1.05,0.95);
Q2:=IF(Q=0,MA(C,BARSCOUNT(C)),(SUM(AMOUNT,BARSCOUNT(C))/SUM(VOL*100,BARSCOUNT(C))));
再次攻击:=CROSS((C/Q2),1.03);
首次预警:=BARSLAST(首次攻击);
drawtext(再次攻击,l,'再次攻击');
drawtext(首次攻击,l,'首次攻击');