if holding>0 and enterbars>1 and all(ref(hhv(h,enterbars+1),1)>=enterprice*1.02 and L<=ref(hhv(h,enterbars+1),1)-(ref(hhv(h,enterbars+1),1)-enterprice)*0.4,3)=1 then begin
sell(1,oq,market);
end //持仓大于0,且连续3根K线符合以下条件:(开仓后的最高价》开仓价*1.02 且 低价小于开仓后的最高价回吐40%)
if holding>0 and enterbars>1 and all(ref(llv(l,enterbars+1),1)<=enterprice*0.98 and h>=ref(llv(l,enterbars+1),1)+(enterprice-ref(llv(l,enterbars+1),1))*0.4,3)=1 then begin
sellshort(1,oq,market);
end //持仓大于0,且连续3根k线符合以下条件:(开仓后的最低价《开仓价*0.98 且 高价大于开仓后的最低价回吐40%)