以文本方式查看主题

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

--  作者:人生如棋
--  发布时间:2011/12/19 21:31:13
--  [求助]策略编写日内5分钟周期

1,如果开盘第一根K线,是阳线,下一个周期的开盘价就做多,如果是阴线,下个周期开盘价就阴线,下一个周期的开盘价就做空;

2,如果,第2根K线是做多的话,把上个周期的最高价储存,和这个周期最高价比较储存更高的这个,当这个周期收盘价小于最高价20个点时就平多头开空头,不到的话就继续顺推下个周期,知道满足这个条件,一路储存最高价,只要差20个点就下个周期就平多头开空头

3,开空头后,当前这个周期的最低点也储存,当新的周期最低点和他比,储存最低的那个,当收盘价大于最低价20个点时就平空头开多头

4,第2个K线做空的话,反之

5,交易时间是9:05-14:55

 

请大侠们,帮我编编看,不胜感激


--  作者:26327756l
--  发布时间:2011/12/20 9:00:19
--  

问题正在解决中


--  作者:人生如棋
--  发布时间:2011/12/20 9:33:22
--  

谢谢,大侠


--  作者:26327756l
--  发布时间:2011/12/20 9:43:06
--  

仅供参考


variable:zuig=h,zuid=l;
zuig:=if(zuig>h,zuig,h);
zuid:=if(zuid<l,zuid,l);
hh:zuig;
ll:zuid;
m:mindiff,linethick0;
oo:=ref(o,1);
ll:=ref(l,1);
if ref(date,2)<>ref(date,1) then
begin
   zuig:=h;
   zuid:=l;
   if oo<ll then buy(holding=0,1,limit,o);
   if oo>ll then buyshort(holding=0,1,limit,o);
end
if time>090500 and time<145500 then
begin
  if holding>0 and zuig-c>20*mindiff then
      begin
        sell(holding>0,0,market);
        buyshort(holding=0,1,market);
      end
  
   if holding<0 and c-zuid>20*mindiff then
      begin
        sellshort(holding<0,0,market);
        buy(holding=0,1.market);
      end
end

if time>145500 then
 begin
   sell(holding>0,0,market);
   sellshort(holding,0,0,market);
 end


--  作者:人生如棋
--  发布时间:2011/12/20 11:11:25
--  

代码上,好像几个问题,第8行的代码  ll:=ref(l,1);
这个如果是用来判断第一根线是阳线还是阴线的话,ll也冲突了,我用cc:=ref(c,1);


那   if oo<ll then buy(holding=0,1,limit,o);
   if oo>ll then buyshort(holding=0,1,limit,o);
就变成

   if oo<cc then buy(holding=0,1,limit,o);
   if oo>cc then buyshort(holding=0,1,limit,o);

主要是后面

 

if holding>0 and zuig-c>20*mindiff then
      begin
        sell(holding>0,0,market);
        buyshort(holding=0,1,market);
      end
  
   if holding<0 and c-zuid>20*mindiff then
      begin
        sellshort(holding<0,0,market);
        buy(holding=0,1.market);
      end
之后,一天还没走完,需要新的最高点,和最低点跟收盘价来比较。收盘价和最近的最高和最低比较,满足20跳就交易

 

请大侠,在帮我考虑考虑

[此贴子已经被作者于2011-12-20 11:13:24编辑过]

--  作者:千一编写程序
--  发布时间:2012/2/19 21:02:49
--  
许多人的好思路