收盘价大于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);
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);