--
老师,是否是这样调整策略代码:
原来的代码:
if kd then begin
sellshort(1,0,market),orderqueue;
buy(holding=0,1,market),orderqueue;
end
if kk then begin
sell(1,0,market),orderqueue;
buyshort(holding=0,1,market),orderqueue;
end
if pd or (enterprice-c)>=10 then sell(holding>0,0,market);
if pk or (c-enterprice)>=10 then sellshort(holding<0,0,market);
改后的代码:
if ref(kd,1) then begin
sellshort(1,0,limitr,o),orderqueue;
buy(holding=0,1,limitr,o),orderqueue;
end
if ref(kk,1) then begin
sell(1,0,limitr,o),orderqueue;
buyshort(holding=0,1,limitr,o),orderqueue;
end
if ref(pd,1) or (enterprice-c)>=10 then sell(holding>0,0,market),orderqueue;
if ref(pk,1) or (c-enterprice)>=10 then sellshort(holding<0,0,market),orderqueue;