仅供参考
variable:ll=0,hh=0;
t1:=LLV(l,2);
t2:=HHV(h,2);
if date<>ref(date,3) then
begin
ll:=t1;
hh:=t2;
end
if c>hh then buy(holding=0,1,market);
if c<ll then sell(holding>0,0,market);
if c<ll then buyshort(holding=0,1,market);
if c>hh then sellshort(holding<0,0,market);