Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共2 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[原创]移动止损图表交易模板

1楼
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编辑过]
2楼
sdcgj209 发表于:2010/11/1 21:01:39

有两处无法通过。。。

共2 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.03125 s, 3 queries.