以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  策略编写求助区  (http://weistock.com/bbs/list.asp?boardid=11)
----  求助策略编写  (http://weistock.com/bbs/dispbbs.asp?boardid=11&id=9494)

--  作者:青蚨之美
--  发布时间:2011/12/26 12:32:54
--  求助策略编写
请老师帮忙编写 日内策略: 1、 交易时间至收盘前5分钟 2、 分笔成交连续5笔主动买,按最后一笔成交价平空,反手开多。 3、 分笔成交连续5笔主动卖,按最后一笔成交价平多,反手开空。
--  作者:26327756l
--  发布时间:2011/12/26 13:20:57
--  

时间是 九点到十四点五十五的 ,如果用在股指上请自行改一下。

 

variable:kd=0,kk=0;
if time>090000 and time<145500 then
begin
   for n=1 to 5 do
   begin
     if TYPE(n)=1 then kd:=1;
     else
       begin
       kd:=0;
       exit for;
       end
   end
  
   for n=1 to 5 do
   begin
     if TYPE(n)=3 then kk:=1;
     else
       begin
       kk:=0;
       exit for;
       end
   end

  if kd=1 then
    begin
      sell(holding>0,0,market);
      buyshort(holding=0,1,limit,ENTERPRICE);
      kd:=0;
    end
  if kk=1 then
    begin
      sellshort(holding<0,0,market);
      buy(holding=0,1,limit,ENTERPRICE);
      kk:=0; 
    end
end

[此贴子已经被作者于2011-12-26 13:45:41编辑过]

--  作者:青蚨之美
--  发布时间:2011/12/26 13:26:24
--  
谢谢,先
--  作者:fly
--  发布时间:2011/12/26 13:44:28
--  

//周期:分笔成交

//版本:标准版

//合约:股指期货

 

long:=COUNT(BUYVOL,5)=5;
short:=COUNT(SELLVOL,5)=5;

 

//平空开多
if long and time>091500 and time<151000 then
begin
sellshort(holding<0,1,thisclose);
buy(holding=0,1,thisclose);
end

 

//平多开空
if short and time>091500 and time<151000 then
begin
sell(holding>0,1,thisclose);
buyshort(holding=0,1,thisclose);
end

 

//收盘前5分钟平仓
if time > 151000 then
 begin
 sell(holding > 0, 0, thisclose);
 sellshort(holding < 0, 0, thisclose);
 end

[此贴子已经被作者于2011-12-26 13:46:36编辑过]

--  作者:青蚨之美
--  发布时间:2011/12/26 14:48:52
--  
sellshort(holding<0,1,thisclose)中thisclose指的是本周期如分钟等的最后一笔,还是连续5笔多单的最后一笔。
--  作者:fly
--  发布时间:2011/12/26 15:00:56
--  
分笔成交,就是满足条件的最后一笔,既5笔多单的最后一笔
--  作者:青蚨之美
--  发布时间:2011/12/26 15:09:15
--  
感谢!
--  作者:青蚨之美
--  发布时间:2011/12/26 15:40:06
--  
fly大虾,刚 试了一下,信号有时早出现有时没出现,不知什么原因
--  作者:fly
--  发布时间:2011/12/27 9:04:11
--  

将"工具-选项"--常规里,盘中延迟刷新,调整小(最小可到100).


--  作者:solarhe2006
--  发布时间:2012/8/27 18:31:12
--  

//周期:分笔成交

//版本:标准版

//合约:股指期货

 

long:=COUNT(BUYVOL,5)=5;
short:=COUNT(SELLVOL,5)=5;

 

//平空开多
if long and time>091500 and time<151000 then
begin
sellshort(holding<0,1,thisclose);
buy(holding=0,1,thisclose);
end

 

//平多开空
if short and time>091500 and time<151000 then
begin
sell(holding>0,1,thisclose);
buyshort(holding=0,1,thisclose);
end

 

//收盘前5分钟平仓
if time > 151000 then
 begin
 sell(holding > 0, 0, thisclose);
 sellshort(holding < 0, 0, thisclose);
 end