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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 加仓模型

   

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


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

主题:加仓模型

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


加好友 发短信
等级:论坛游民 帖子:317 积分:1565 威望:0 精华:0 注册:2012/10/9 11:12:26
  发帖心情 Post By:2013/3/14 10:58:45    Post IP:118.181.108.24[显示全部帖子]

x:=5;
a:=4;
r1:=c>ma(c,30)+x;
if r1 then buy(holding=0,1,thisclose);
if ref(r1,1) and enterbars=2 then buy(holding=1,1,limitr,o);
if ref(r1,1) and enterbars=1 then buy(holding=2,1,limitr,o);
if ref(r1,1) and enterbars=1 then buy(holding=3,1,limitr,o);
if enterprice-c>a then sell(holding>0,0,limitr,enterprice-a);

自己调试测试一下,随手写的供参考。




 回到顶部
帅哥哟,离线,有人找我吗?
qwe123
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游民 帖子:317 积分:1565 威望:0 精华:0 注册:2012/10/9 11:12:26
  发帖心情 Post By:2013/3/14 11:05:31    Post IP:118.181.108.24[显示全部帖子]

x:=5;
a:=4;
cx:=4;//最大持仓
r1:=c>ma(c,30)+x;
if r1 then buy(holding=0,1,thisclose);
if ref(r1,1) and enterbars=2 then buy(holding=1,1,limitr,o);
if ref(r1,1) and enterbars=1 then buy(holding<cx,1,limitr,o);
if enterprice-c>a then sell(holding>0,0,limitr,enterprice-a);

同样的方法写加空仓位。

 回到顶部