我用意是建仓之后的任意价位开始,反向波动mbs7则立刻反手,这样写了却执行不了,请赐教,谢谢!
input:mbs7(5),ss(1,1,1000,1);
llv7:=llv(l,enterbars+2);
l7:=min(enterprice,llv7);
V7:=
c>l7*(100+mbs7)/100 and c>ref(c,1);
hhv7:=hhv(h,enterbars+2);
h7:=max(enterprice,hhv7);
P7:=
c<h7*(100-mbs7)/100 and c<ref(c,1);
CONBPK:=
V7=1
;
///////////////////////////////////////////
CONSPK:=
P7=1;
//---------------------------
sellshort(conbpk,0,thisclose),orderqueue,ignorecheckprice;
buy(conbpk and holding=0,ss,thisclose),orderqueue,ignorecheckprice;
sell(conspk,0,thisclose),orderqueue,ignorecheckprice;
buyshort(conspk and holding=0,ss,thisclose),orderqueue,ignorecheckprice;