实在找不到 ,请大神帮忙
if holding=0 then begin
if A1 then
BUY(A1 ,1,limitr,A3+2*mindiff);
end
if holding=0 then begin
if A2 then
buyshort(A2,1,limitr,A4-2*mindiff);
end
if holding>0 then begin
if low>=enterprice-2*atr then
sell(1,holding,limitr,atr));
if A2 then
sell(A2,holding,limitr,A4-2*mindiff);
buyshort(A2,1,limitr,A4-3*mindiff);
end
if holding<0 then begin
if high>=enterprice+2*atr then begin
sellshort(1,holding,limitr,atr);
if A1 then
sellshort(A1,holding,limitr,A3+2*mindiff);
buy(A1,1,limitr,A3+3*mindiff);
end//
//盈亏:asset-500000,noaxis,coloryellow,linethick2;
if holding=0 then begin
if A1 then BUY(A1 ,1,limitr,A3+2*mindiff); end
if holding=0 then begin
if A2 then buyshort(A2,1,limitr,A4-2*mindiff); end
if holding>0 then begin
if low>=enterprice-2*atr then sell(1,holding,limitr,atr);
if A2 then sell(A2,holding,limitr,A4-2*mindiff);
buyshort(A2,1,limitr,A4-3*mindiff); end
if holding<0 then begin
if high >=enterprice+2*atr then begin
sellshort(1,holding,limitr,atr); end
if A1 then sellshort(A1,holding,limitr,A3+2*mindiff);
buy(A1,1,limitr,A3+3*mindiff); end//
这里有两个BEGIN
已修改,但仍然还是同样问题
if holding=0 then begin
if A1 then
BUY(A1 ,1,limitr,A3+2*mindiff);
end
if holding=0 then begin
if A2 then
buyshort(A2,1,limitr,A4-2*mindiff);
end
if holding>0 then begin
if low>=enterprice-2*atr then
sell(1,holding,limitr,atr));
if A2 then
sell(A2,holding,limitr,A4-2*mindiff);
buyshort(A2,1,limitr,A4-3*mindiff);
end
if holding<0 then begin
if high>=enterprice+2*atr then
sellshort(1,holding,limitr,atr);
if A1 then
sellshort(A1,holding,limitr,A3+2*mindiff);
buy(A1,1,limitr,A3+3*mindiff);
end//
很多条件是无用而且重复的,给你修改了下。
if a1 then BUY(holding=0 ,1,limitr,A3+2*mindiff);
if a2 then buyshort(holding=0,1,limitr,A4-2*mindiff);
if low>=enterprice-2*atr then sell(holding>0,holding,limitr,atr);
if A2 then begin
sell(holding>0,holding,limitr,A4-2*mindiff);
buyshort(holding=0,1,limitr,A4-3*mindiff);
end
if high>=enterprice+2*atr then sellshort(holding<0,holding,limitr,atr);
if A1 then begin
sellshort(holding<0,holding,limitr,A3+2*mindiff);
buy(holding=0,1,limitr,A3+3*mindiff);
end
已修改,但仍然还是同样问题
if holding=0 then begin
if A1 then
BUY(A1 ,1,limitr,A3+2*mindiff);
end
if holding=0 then begin
if A2 then
buyshort(A2,1,limitr,A4-2*mindiff);
end
if holding>0 then begin
if low>=enterprice-2*atr then
sell(1,holding,limitr,atr));
if A2 then
sell(A2,holding,limitr,A4-2*mindiff);
buyshort(A2,1,limitr,A4-3*mindiff);
end
if holding<0 then begin
if high>=enterprice+2*atr then
sellshort(1,holding,limitr,atr);
if A1 then
sellshort(A1,holding,limitr,A3+2*mindiff);
buy(A1,1,limitr,A3+3*mindiff);
end//
多一个括号 , 去掉这个括号我这里编译通过。