我想卖在买一 买在卖一,如何修改下面的下单组件
longcond:=a;
shortcond:=b;;
if holding=0 then begin
if longcond then
buy(1,N1,THISCLOSE);
end
if holding=0 then begin
if shortcond then
buyshort(1,N1,THISCLOSE);
end
if holding>0 then begin
if shortcond then begin
sell(1,holding,THISCLOSE);
buyshort(1,N1,THISCLOSE);
end
end
if holding<0 then begin
if longcond then begin
sellshort(1,holding,THISCLOSE);
buy(1,N1,THISCLOSE);
end
end
收益:asset,noaxis,colorred;
次数:totaltrade,linethick0;
胜率:percentwin,linethick0;
连亏:maxseqloss,linethick0;
连赢:maxseqwin,linethick0;
类似这样改写,就是当时的对手价下单
buyshort(1,N1,LIMIT,C-MINDIFF);
buy(1,N1,LIMIT,C+MINDIFF);