阅读版:
以下内容为程序代码:
1 myaccount:='666666';
2 sleeptime:=1000*3;
3
4 if tbuyholdingex(myaccount,stklabel,0)=0 then begin
5 if true then begin
6 tbuy(1,1,lmt,close,0,myaccount,stklabel),allowrepeat;
7 sleep(sleeptime);
8 if tisremainex(1,myaccount,stklabel) then begin
9 tcancelex(1,1,myaccount,stklabel);
10 exit;
11 end
12 end
13 end
14
15 if tsellholdingex(myaccount,stklabel,0)=0 then begin
16 if true then begin
17 tbuyshort(1,1,lmt,close,0,myaccount,stklabel),allowrepeat;
18 sleep(sleeptime);
19 if tisremainex(3,myaccount,stklabel) then begin
20 tcancelex(1,3,myaccount,stklabel);
21 exit;
22 end
23 end
24 end
25
26 if tbuyholdingex(myaccount,stklabel,0)>0 then begin
27 if true then begin
28 tsell(1,tbuyholdingex(myaccount,stklabel,0),close,0,myaccount,stklabel),allowrepeat;
29 sleep(sleeptime);
30 if tisremainex(2,myaccount,stklabel) then begin
31 tcancelex(1,2,myaccount,stklabel);
32 exit;
33 end
34 end
35 end
36
37 if tsellholdingex(myaccount,stklabel,0)>0 then begin
38 if true then begin
39 tsellshort(1,tsellholdingex(myaccount,stklabel,0),close,0,myaccount,stklabel),allowrepeat;
40 sleep(sleeptime);
41 if tisremainex(4,myaccount,stklabel) then begin
42 tcancelex(1,4,myaccount,stklabel);
43 exit;
44 end
45 end
46 end
47
拷贝版:
myaccount:='666666';
sleeptime:=1000*3;
if tbuyholdingex(myaccount,stklabel,0)=0 then begin
if true then begin
tbuy(1,1,lmt,close,0,myaccount,stklabel),allowrepeat;
sleep(sleeptime);
if tisremainex(1,myaccount,stklabel) then begin
tcancelex(1,1,myaccount,stklabel);
exit;
end
end
end
if tsellholdingex(myaccount,stklabel,0)=0 then begin
if true then begin
tbuyshort(1,1,lmt,close,0,myaccount,stklabel),allowrepeat;
sleep(sleeptime);
if tisremainex(3,myaccount,stklabel) then begin
tcancelex(1,3,myaccount,stklabel);
exit;
end
end
end
if tbuyholdingex(myaccount,stklabel,0)>0 then begin
if true then begin
tsell(1,tbuyholdingex(myaccount,stklabel,0),close,0,myaccount,stklabel),allowrepeat;
sleep(sleeptime);
if tisremainex(2,myaccount,stklabel) then begin
tcancelex(1,2,myaccount,stklabel);
exit;
end
end
end
if tsellholdingex(myaccount,stklabel,0)>0 then begin
if true then begin
tsellshort(1,tsellholdingex(myaccount,stklabel,0),close,0,myaccount,stklabel),allowrepeat;
sleep(sleeptime);
if tisremainex(4,myaccount,stklabel) then begin
tcancelex(1,4,myaccount,stklabel);
exit;
end
end
end
[此贴子已经被作者于2011-1-9 12:00:55编辑过]
以下是引用admin在2011-1-9 11:46:19的发言:
楼主可否将使用方法和原理介绍一下
下单后,睡眠3秒钟,然后判断是否存在未成交委托单,如果存在,撤销未成交委托单并退出。如果不存在,继续向下执行。退出后再次进入时,如果下单条件成立,重新下单。
这种追单是条件追单,也就是说只要下单条件成立,就会不断的追单。
[此贴子已经被作者于2011-1-9 11:59:38编辑过]