看了下移到外面的,不太会,这个cross怎么移到外面,帮改一下
if cross(h,r6) then
begin
buy(holding=0,tn,limitr,r6);
end
if cross(r7,l) then
begin
buyshort(holding=0,tn,limitr,r7);
end
if holding>0 and cross(r5,l) then
begin
sell(1,0,limitr,r5);
end
if holding<0 and cross(h,r5) then
begin
sellshort(1,0,limitr,r5);
end
end
if aaa then begin
if cross(x,y) then ......
end
改成
xx:=cross(x,y)
if aaa then begin
if xx then .........
end
这一句改了,还是译不过
if cross(h,r6) then
begin
//-----------------------这出错
出错条件:=cross(h,r6);
if 出错条件 then
begin
cc:=cross(h,r6);
if cc then
begin
//-----------------------这出错
出错条件:=cc;
if 出错条件 then
begin
单独能过,全部是这样的,帮看一下
input:n(13,1,20,1);
//中轴偏移值
input:m(70,-200,200,1);
//回撤止赢点数
input:m1(24,5,30,1);
//交易手数:
tn:=1;
r1:=barslast(day-ref(day,1)<>0);
r5:ref(o,r1)+0.1*m;
r6:r5+n;
r7:r5-n;
if time>091500 and time<150000 then
begin
if r1=0 and holding=0 then
begin
buy(h>r6,tn,limitr,r6);
buyshort(l<r7,tn,limitr,r7);
end
//-----------------------这出错
出错条件:=cross(h,r6);
if 出错条件 then
begin
buy(holding=0,tn,limitr,r6);
end
if cross(r7,l) then
begin
buyshort(holding=0,tn,limitr,r7);
end
if holding>0 and cross(r5,l) then
begin
sell(1,0,limitr,r5);
end
if holding<0 and cross(h,r5) then
begin
sellshort(1,0,limitr,r5);
end
end
//回撤止赢
r10:=enterbars;
r11:=llv(l,r10+1);
r12:=hhv(h,r10+1);
if time>091500 and time<150000 then
begin
if holding>0 and r12-c>m1 and r10>=1 then
begin
sell(1,0,thisclose);
end
if holding<0 and c-r11>m1 and r10>=1 then
begin
sellshort(1,0,thisclose);
end
end
//收盘前清仓
if time>=151000 then
begin
sellshort(holding<0,0,thisclose);
sell(holding>0,0,thisclose);
end
持仓:holding,colorwhite,linethick0;
交易总数:totaltrade,colorwhite,linethick0;
盈亏:asset-1000000,noaxis,colorred
input:n(13,1,20,1);
//中轴偏移值
input:m(70,-200,200,1);
//回撤止赢点数
input:m1(24,5,30,1);
//交易手数:
tn:=1;
r1:=barslast(day-ref(day,1)<>0);
r5:ref(o,r1)+0.1*m;
r6:r5+n;
r7:r5-n;
cc:=cross(h,r6);
cc1:=cross(r7,l);
cc2:=cross(r5,l);
cc3:=cross(h,r5);
if time>091500 and time<150000 then
begin
if r1=0 and holding=0 then
begin
buy(h>r6,tn,limitr,r6);
buyshort(l<r7,tn,limitr,r7);
end
//-----------------------这出错
出错条件:=cc;
if 出错条件 then
begin
buy(holding=0,tn,limitr,r6);
end
if cc1 then
begin
buyshort(holding=0,tn,limitr,r7);
end
if holding>0 and cc2 then
begin
sell(1,0,limitr,r5);
end
if holding<0 and cc3 then
begin
sellshort(1,0,limitr,r5);
end
end
//回撤止赢
r10:=enterbars;
r11:=llv(l,r10+1);
r12:=hhv(h,r10+1);
if time>091500 and time<150000 then
begin
if holding>0 and r12-c>m1 and r10>=1 then
begin
sell(1,0,thisclose);
end
if holding<0 and c-r11>m1 and r10>=1 then
begin
sellshort(1,0,thisclose);
end
end
//收盘前清仓
if time>=151000 then
begin
sellshort(holding<0,0,thisclose);
sell(holding>0,0,thisclose);
end
持仓:holding,colorwhite,linethick0;
交易总数:totaltrade,colorwhite,linethick0;
盈亏:asset-1000000,noaxis,colorred