Rss & SiteMap

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

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

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

1楼
neowang007 发表于:2012/5/28 17:10:32

当条件A(波动率大于0.6)一次满足时,满足C>REF(C,5), bk  ;节点1

                            满足C<REF(C,5), sk;节点2

当条件A(波动率大于0.6)二次满足时,满足C>REF(C,5),bk;节点3                           

                            满足C<REF(C,5), sp;节点4

                            满足C>REF(C,5), bp;节点5                         

                            满足C<REF(C,5), sk;节点6

当条件A(波动率大于0.6)三次满足时,C>REF(C,5), bk;节点7                          

                            满足C<REF(C,5), sp;节点8                          

                            满足C>REF(C,5), bk;节点9                        

                            满足C<REF(C,5), sk;节点10

                            满足C>REF(C,5), bk;节点11                       

                            满足C<REF(C,5), sk;节点12                        

                            满足C>REF(C,5), bp;节点13                     

                            满足C<REF(C,5), sk;节点14

 

日内交易,收盘前5分钟全部平仓,每天开仓总数不超过3次


图片点击可在新窗口打开查看此主题相关图片如下:tree2_1.jpg
图片点击可在新窗口打开查看
2楼
rushtaotao 发表于:2012/5/29 8:45:47

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

3楼
rushtaotao 发表于: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

4楼
neowang007 发表于:2012/5/29 14:18:18

非常感谢

5楼
lingdu777 发表于:2012/6/4 7:33:34
condA未定义变量,请高手再修改一下
[此贴子已经被作者于2012-6-4 7:34:04编辑过]
6楼
rushtaotao 发表于:2012/6/4 8:37:00

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

7楼
lingdu777 发表于:2012/6/4 10:55:10
哦,多谢指点
8楼
xian_0_9 发表于:2012/6/12 11:02:44
值得学习啊
共8 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in .07813 s, 2 queries.