以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  新手报道,老师帮忙编写个模型  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=141776)

--  作者:jizita5912
--  发布时间:2016/10/25 15:22:27
--  新手报道,老师帮忙编写个模型
看1分钟K线,商品早上9点开盘到到9点10分之间有个高H.低点L,9:10以后价格突破前10分钟高点即H+1时就买入, 止损价格是L-1.如无触发止损就一直留到下午最后一分钟平仓,但中途触发到涨停板就平仓. 作空相反,
--  作者:jinzhe
--  发布时间:2016/10/25 15:31:02
--  
那么有夜盘的操作吗
--  作者:jizita5912
--  发布时间:2016/10/25 15:37:49
--  
没有夜盘操作,谢谢,
--  作者:jinzhe
--  发布时间:2016/10/25 15:54:37
--  

看1分钟K线,商品早上9点开盘到到9点10分之间有个高H.低点L,9:10以后价格突破前10分钟高点即H+1时就买入, 止损价格是L-1.如无触发止损就一直留到下午最后一分钟平仓,但中途触发到涨停板就平仓. 作空相反,

 

 

t1:=time>131000 and time<185900;

t2:=time>=185900;

 

hh:=valuewhen(time=131000,hhv(h,10));

ll:=valuewhen(time=131000,llv(l,10));

 

if t1 and h>hh then sellshort(1,0,market);

if t1 and h>hh then buy(holding=0,1,market);

if t1 and l<ll then sell(1,0,market);

if t1 and l<ll then buyshort(holding=0,1,market);

 

if  t2 then begin

   sell(1,0,market);

   sellshort(1,0,market);

end


--  作者:jizita5912
--  发布时间:2016/10/25 16:27:55
--  
能过滤下吗,刚刚有个条件没说,就是每个品种一天最多一次交易.
--  作者:jinzhe
--  发布时间:2016/10/25 16:33:43
--  

t1:=time>131000 and time<185900;

t2:=time>=185900;

 

variable:n=0;

hh:=valuewhen(time=131000,hhv(h,10));

ll:=valuewhen(time=131000,llv(l,10));

 

if t1 and h>hh then sellshort(1,0,market);

if t1 and h>hh and holding=0 and n=0 then begin

    n:=1;

    buy(holding=0,1,market);

end

if t1 and l<ll then sell(1,0,market);

if t1 and l<ll and holding=0 and n=0  then begin

    n:=1;

    buyshort(holding=0,1,market);

end

 

if  t2 then begin

   sell(1,0,market);

   sellshort(1,0,market);

   n:=0;

end