以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  [原创]移动止损图表交易模板  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=3618)

--  作者:z7c9
--  发布时间:2010/11/1 17:10:52
--  [原创]移动止损图表交易模板

以下内容为程序代码:

1 input:stopnum(20,5,50,5);
2 runmode:0;
3 variable:stopprice=0;
4
5 if holding=0 then begin
6     stopprice:=low-stopnum*mindiff;
7     buy(1,1,limitr,close);
8 end;
9
10 if holding>0 then begin
11     if low-stopnum*mindiff>stopprice then
12         stopprice:=low-stopnum*mindiff;
13     
14     if low<=stopprice then begin
15         sell(1,holding,limitr,stopprice),orderqueue;
16         buyshort(1,1,limitr,stopprice),orderqueue;
17     end;
18 end;
19
20 if holding<0 then begin
21     if high+stopnum*mindiff<stopprice then
22         stopprice:=high+stopnum*mindiff;
23     
24     if high>=stopprice then begin
25         sellshort(1,holding,limitr,stopprice),orderqueue;
26         buy(1,1,limitr,stopprice),orderqueue;
27     end;    
28 end;
29

[此贴子已经被作者于2010-11-1 17:12:16编辑过]

--  作者:sdcgj209
--  发布时间:2010/11/1 21:01:39
--  

有两处无法通过。。。