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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件策略编写求助区 → 求助:怎么实现这个交易思路呢?

   

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


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

主题:求助:怎么实现这个交易思路呢?

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


加好友 发短信 czt
等级:蜘蛛侠 帖子:1445 积分:6114 威望:0 精华:3 注册:2012/1/16 10:31:19
  发帖心情 Post By:2012/5/29 8:45:47 [显示全部帖子]

这个用二叉树来表达交易思想,请稍等,策略正在编写中


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


加好友 发短信 czt
等级:蜘蛛侠 帖子:1445 积分:6114 威望:0 精华:3 注册:2012/1/16 10:31:19
  发帖心情 Post By:2012/5/29 10:26:13 [显示全部帖子]

//仅供参考

 

 

//定义开仓次数
variable:kc:=0;
variable:kcb:=0;
//满足节点1->3->7/8,开3次仓
if date<>ref(date,1) then
begin
if condA and c>ref(c,5) and kc=0 then
begin
   buy(1,1,market);
   kc:=1;
   kcb:=barpos;
   if condA and c>ref(c,5) and kc=1 and kcb<>barpos then
      begin
         buy(1,1,market);
         kc:=2;
         kcb:=barpos;
         if condA and c>ref(c,5) and kc=2 and kcb<>barpos then
            begin
                buy(1,1,market);
                kc:=3;
                kcb:=barpos;
            end
          else if condA and c<ref(c,5) then  sellshort(1,0,market);
     end
end
end
//满足节点1->4->9/10,开3次仓
if date<>ref(date,1) then
begin
if condA and c>ref(c,5) and kc=0 then
begin
   buy(1,1,market);
   kc:=1;
   kcb:=barpos;
   if condA and c<ref(c,5) and kc=1 and kcb<>barpos then
      begin
         sellshort(1,0,market);
         kcb:=barpos;
         if condA and c>ref(c,5) and kc=1 and kcb<>barpos then
            begin
                buy(1,1,market);
                kc:=2;
                kcb:=barpos;
            end
          else if condA and c<ref(c,5) then  buyshort(1,1,market);
     end
end
end

//满足节点2->5->11/12,开3次仓
if date<>ref(date,1) then
begin
if condA and c<ref(c,5) and kc=0 then
begin
   buyshort(1,1,market);
   kc:=1;
   kcb:=barpos;
   if condA and c>ref(c,5) and kc=1 and kcb<>barpos then
      begin
         sell(1,0,market);
         kcb:=barpos;
         if condA and c>ref(c,5) and kc=1 and kcb<>barpos then
            begin
                buy(1,1,market);
                kc:=2;
                kcb:=barpos;
            end
          else if condA and c<ref(c,5) then  buyshort(1,1,market);
     end
end
end

//满足节点2->5->13/14,开3次仓
if date<>ref(date,1) then
begin
if condA and c<ref(c,5) and kc=0 then
begin
   buyshort(1,1,market);
   kc:=1;
   kcb:=barpos;
   if condA and c<ref(c,5) and kc=1 and kcb<>barpos then
      begin
         buyshort(1,0,market);
         kc:=2;
         kcb:=barpos;
         if condA and c>ref(c,5) and kc=2 and kcb<>barpos then
            begin
                sell(1,1,market);
                kcb:=barpos;
            end
          else if condA and c<ref(c,5) then  buyshort(1,1,market);
     end
end
end

//如果15点收盘,14点55分全部平仓
if time>=145500 then
begin
   sell(1,0,market);
   sellshort(1,0,market);
end


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


加好友 发短信 czt
等级:蜘蛛侠 帖子:1445 积分:6114 威望:0 精华:3 注册:2012/1/16 10:31:19
  发帖心情 Post By:2012/6/4 8:37:00 [显示全部帖子]

conda是发帖人自己定义的一个条件。


 回到顶部