以文本方式查看主题

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

--  作者:sapphire
--  发布时间:2011/12/7 15:26:26
--  求助

以前一日的最高价(high)和最低价(low)及两者的50%均价为参照,

一、当low<P<low+100时,做多;当high-100<p<high时,做空;

 

二、在做空的情况下,如果3个连续5分钟K线的收盘价高于high,则以第4根K线的开盘价进行止损;

                            如果low<P<low+100,买入止赢。

                           

      在做多的情况下,如果3个连续5分钟K线的收盘价低于low,则以第4根K线的开盘价进行止损;

                            如果high<p<high+200.卖出止赢

 

O(∩_∩)O谢谢


--  作者:26327756l
--  发布时间:2011/12/7 15:34:30
--  


zh:=REFDATE(h,ref(date,1));//high
zl:=REFDATE(l,ref(date,1));//low
zz:=(zh+zl)/2;//p

//一、当low<P<low+100时,做多;当high-100<p<high时,做空;
if zl<zz and zz<zl+100 then buy(holding=0,1,market);
if zh-100<zz and zz<zh then buyshort(holding=0,1,market);
//二、在做空的情况下,如果3个连续5分钟K线的收盘价高于high,则以第4根K线的开盘价进行止损;
//  如果low<P<low+100,买入止赢。


if holding<0 and ref(c,3)>zh and ref(c,2)>zh and ref(c,1)>zh then
begin
sellshort(holding<0,0,limit,o);
if zl<zz and zz<zl+100 then sellshort(holding<0,1,market);
end

//在做多的情况下,如果3个连续5分钟K线的收盘价低于low,则以第4根K线的开盘价进行止损;
//    如果high<p<high+200.卖出止赢

if holding>0 and ref(c,3)<zl and ref(c,2)<zl and ref(c,1)<zl then
begin
sell(holding>0,0,limit,o);
if zh<zz and zz<zh+200 then sell(holding>0,0,market);
end

[此贴子已经被作者于2011-12-7 15:58:27编辑过]

--  作者:sapphire
--  发布时间:2011/12/7 15:58:20
--  
P是当前的价格  市价
--  作者:sapphire
--  发布时间:2011/12/7 15:59:28
--  
非常感谢!