variable:n=0;
c_1:=callstock(stklabel,vtclose,6,-1);
if h>c_1+5 and n=0 and holding=0 and time<151000 then begin
buy(holding=0,1,market);
n:=1;
end
if l<c_1-5 and n=0 and holding=0 and time<151000 then begin
buyshort(holding=0,1,market);
n:=1;
end
if l<c_1 and holding>0 then sell(1,0,market);
if h>c_1 and holding<0 then sellshort(1,0,market);
if time>=151000 then begin
sell(1,0,market);
sellshort(1,0,market);
n:=0;
end
[此貼子已經被作者于2014/2/17 17:20:58編輯過]