以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  求程序纠错  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=62425)

--  作者:dongdong123
--  发布时间:2014/3/7 11:34:13
--  求程序纠错
收盘价大于50根K线的最高价开多单,小于 50根K线的最小价开空单
回抽17个点平仓,不会开单求程序纠错

input:cc(50,10,150,5);

h_1:=hhv(h,enterbars+1);
l_1:=llv(l,enterbars+1);
hh:=hhv(h,cc);
ll:=llv(l,cc);

kd:=c>hh;
kk:=c<ll;

buy(kd and holding=0,1,market);
buyshort(kk and holding=0,1,market);

if l<h_1-17 then sell(1,0,market);
if h>l_1+17 then sellshort(1,0,market);

--  作者:jinzhe
--  发布时间:2014/3/7 13:13:24
--  

input:cc(50,10,150,5);


h_1:=hhv(h,enterbars+1);
l_1:=llv(l,enterbars+1);
hh:=hhv(h,cc);
ll:=llv(l,cc);


kd:=h>ref(hh,1);
kk:=l<ref(ll,1);

if h>l_1+17 then sellshort(1,0,market);

buy(kd and holding=0,1,market);

if l<h_1-17 then sell(1,0,market);

buyshort(kk and holding=0,1,market);

 


--  作者:dongdong123
--  发布时间:2014/3/7 15:42:38
--  
感谢无所不能的版主