VARIABLE:n=0;if date<>ref(date,1) then n:=0;if 條件A then n:=1;ss:barslast(n=1 and ref(n,1)=0);
ss就是當天條件a成立到當前的周期數