GLOBALVARIABLE:opjg=close ;
GLOBALVARIABLE:jzjg=close ;
if tbuyholding(1)<>0 and tsellholding(1)<>0 then begin
if time<closetime(0) then begin
if abs(close-jzjg)<5 then begin
if close-opjg>=1 then begin
opjg:=close;
tbuy(1,2,mkt);
tsellshort(1,2,mkt);
end
if opjg-close>=1 then begin
opjg:=close;
tsell(1,2,mkt);
tbuyshort(1,2,mkt);
end
end
if close-jzjg>=5 then begin
tsell(1,8,mkt);
tbuyshort(1,8,mkt);
jzjg:=close;
TCANCEL(1,0);
end
if jzjg-close>=5 then begin
tbuy(1,8,mkt);
tsellshort(1,8,mkt);
jzjg:=close;
TCANCEL(1,0);
end
end
if time>=closetime(0) then begin
dctz:=tbuyholding(1)-10;
if dctz>0 then begin
tsell(1,dctz,mkt);
tbuyshort(1,dctz,mkt);
end
if dctz<0 then begin
tbuy(1,abs(dctz),mkt);
tsellshort(1,abs(dctz),mkt);
end
TCANCEL(1,0);
end
end
楼主没有加载到图表吧,加载到图表一定会报错,因为数据量大,导致内存溢出。后台预警应该没问题。