欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → [原创]移动止损图表交易模板

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有5402人关注过本帖树形打印复制链接

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

帅哥哟,离线,有人找我吗?
z7c9
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:小飞侠 帖子:1882 积分:3310 威望:0 精华:15 注册:2010/3/15 13:11:56
[原创]移动止损图表交易模板  发帖心情 Post By:2010/11/1 17:10:52    Post IP:123.118.85.229[只看该作者]

以下内容为程序代码:

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
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:新手上路 帖子:65 积分:542 威望:0 精华:0 注册:2010/6/13 15:20:29
  发帖心情 Post By:2010/11/1 21:01:39    Post IP:123.130.3.197[只看该作者]

有两处无法通过。。。


 回到顶部