内盘外盘都测试了一下,还是啥都木有
以下是引用jinzhe在2016-12-1 13:55:04的发言:
variable:dt=0,kt=0;
ss:=stkindi('','时间.tt',0,5);
a1:=ref(HIGH,22);
a2:=ref(HIGH,10);
a6:=ref(l,22);
a7:=ref(l,10);
a3:=c>a1 and c>a2;
a8:=c<a6 and c<a7;
mm:=ref(h,1)=hhv(h,3) or ref(h,2)=hhv(h,3) or ref(h,3)=hhv(h,3);
nn:=ref(l,1)=llv(l,3) or ref(l,2)=hhv(l,3) or ref(l,3)=hhv(l,3);
if mm then bj:=1;
if nn then bj:=-1;
nn1:=barslast(mm);
nn2:=barslast(nn);
if c<ref(l,nn1+1) and bj=1 then i:=1;
if c>ref(h,nn2+1) and bj=-1 then i:=-1;
uu3:=cross(i=1,0.5);
uu4:=cross(i=-1,0.5);
tt:=(time>=090512 and time<=112500) or (time>=133500 and time<=145500) or (time>=210500 and time<=225500);
if uu3 and a8 and holding=0 and tt then begin
buyshort(holding=0,1,market);
end
if uu4 and a3 and holding=0 and tt then begin
buy(holding=0,1,market);
end
b1:=c<ref(l,barslast(c>o));
if a8 and b1 and holding=0 and tt then begin
buyshort(holding=0,1,market);
end
b2:=c>ref(h,barslast(c<o));
if a3 and b2 and holding=0 and tt then begin
buy(holding=0,1,market);
end
n1:=hhvbars(vol,10);
h10:=ref(h,n1);
if holding<0 and c>h10 then sellshort(1,0,thisclose);
l10:=ref(l,n1);
if holding>0 and c<l10 then sell(1,0,thisclose);
//if holding<0 and c>a2 then sellshort(1,0,thisclose);
//if holding<0 and uu4 then sellshort(1,0,thisclose);
//if holding<0 and c>ref(h,22) then sellshort(1,0,thisclose);
//if holding>0 and c<ref(l,22) then sell(1,0,thisclose);
//if holding>0 and c<a7 then sell(1,0,thisclose);
// if holding>0 and uu3 then sell(1,0,thisclose);
if (time>=112500 and time<=113000) or (time>=145500 and time<=150000) or (time>=225500 and time<=230000) then begin
收盘平多:sell(1,0,thisclose);
收盘平空:sellshort(1,0,thisclose);
end
用这段代码试试