以上是否可以这样写:
1 runmode:0;
2 hhh:=high>=enterprice+10*mindiff
lll:=low<=enterprice-5*mindiff
3 if holding=0 then begin
4 buy(1,1,limitr,close);
5 end
6
7 if holding>0 then begin
8 sell(hhh,holding,limitr,enterprice+10);//如1元一档的品种,是否直接省略mindiff函数效果一样?
9 sell(lll,holding,limitr,enterprice-5);
10 end
以上是否可以这样写:
1 runmode:0;
2 hhh:=high>=enterprice+10*mindiff
lll:=low<=enterprice-5*mindiff
3 if holding=0 then begin
4 buy(1,1,limitr,close);
5 end
6
7 if holding>0 then begin
8 sell(hhh,holding,limitr,enterprice+10);//如1元一档的品种,是否直接省略mindiff函数效果一样?
9 sell(lll,holding,limitr,enterprice-5);
10 end
这种写法不对,enterprice返回的上次开仓价,要写在开仓之后。如果mindiff等于1,当然可以省略。