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


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

   

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


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

主题:[原创]移动止损后台交易模板

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


加好友 发短信
等级:小飞侠 帖子:1882 积分:3310 威望:0 精华:15 注册:2010/3/15 13:11:56
[原创]移动止损后台交易模板  发帖心情 Post By:2010/11/1 17:18:23    Post IP:123.118.85.229[显示全部帖子]

以下内容为程序代码:

1 input:stopnum(20,5,50,5);
2 runmode:1;
3
4 if tholding=0 then begin
5     extgbdataset('stopprice',low-stopnum*mindiff);
6     tbuy(1,1,lmt,close);
7 end;
8
9 if tholding>0 then begin
10     if low-stopnum*mindiff>extgbdata('stopprice') then
11         extgbdataset('stopprice',low-stopnum*mindiff);
12     
13     if low<=extgbdata('stopprice') then begin
14         tsell(1,tholding,lmt,extgbdata('stopprice')),orderqueue;
15         tbuyshort(1,1,lmt,extgbdata('stopprice')),orderqueue;
16     end;
17 end;
18
19 if tholding<0 then begin
20     if high+stopnum*mindiff<extgbdata('stopprice') then
21         extgbdataset('stopprice',high+stopnum*mindiff);
22     
23     if high>=extgbdata('stopprice') then begin
24         tsellshort(1,tholding,lmt,extgbdata('stopprice')),orderqueue;
25         tbuy(1,1,lmt,extgbdata('stopprice')),orderqueue;
26     end;    
27 end;
28

版主评定:好评,获得5个金币奖励好评,获得5个金币奖励
(理由:好文章)
 回到顶部