有空頭沒?
沒有空頭
variable:n=0;
if date<>ref(date,1) then n:=0;
if 開多 and n<2 then buy;
if 平倉條件 and holding>0 then begin
sell;//假定這里平倉使用thisclose
if close-enterprice<0 then n:=n+1;
if close-enterprice>0 then n:=0;
end