|
- 1 runmode:0;
- 2
- 3 variable:myholding=0;
- 4
- 5 buycond:=ref(all(isup,3),1);
- 6 buyshortcond:=ref(all(isdown,3),1);
- 7
- 8 if myholding=0 and buycond then begin
- 9 lots:=cash(0)/(open*multiplier*0.1);
- 10 buy(1,lots,limitr,open);
- 11 myholding:=lots;
- 12 end
- 13
- 14 if myholding=0 and buyshortcond then begin
- 15 lots:=cash(0)/(open*multiplier*0.1);
- 16 buyshort(1,lots,limitr,open);
- 17 myholding:=-lots;
- 18 end
- 19
- 20 if myholding>0 and time=closetime(0) then begin
- 21 sell(1,myholding,limitr,close);
- 22 myholding:=0;
- 23 end
- 24
- 25 if myholding<0 and time=closetime(0) then begin
- 26 sellshort(1,myholding,limitr,close);
- 27 myholding:=0;
- 28 end
复制代码
|
|