if holding>0 and close<ref(L,enterbars) then 止损多:sell(1,0,thisclose);
holding<0 and close>ref(H,enterbars) then 止损空:sellshort(1,0,thisclose);
类似这样的写法,止损多和止损空在一个策略里面只能存在一个,所以你的要求我写了两个止损来实现
公式1:
bb:sum(buyvol,barslast(minute<>ref(minute,1))+1);
ss:sum(sellvol,barslast(minute<>ref(minute,1))+1);
公式2
bb:=stkindi('','公式1.bb',0,0);
ss:=stkindi('','公式1.ss',0,0);
stickline(1,0,bb,8,0),colorred;
stickline(1,-1*ss,0,8,0),colorcyan;