hh:=hhv(h,enterbars+1);
if openprofit/ref(asset,enterbars)>=0.009 or (hh-c)/hh>=0.3 then sell(1,0,thisclose);
推荐使用走完k线模式下单,如果希望使用固定时间间隔模式,则把(hh-c)/hh>=0.3修改为(hh-l)/hh>=0.3
1. 多头时:holding>0 and openprofit<0 and abs(openprofit)/ref(asset,enterbars+1)>0.005
空头时:holding<0 and openprofit<0 and abs(openprofit)/ref(asset,enterbars+1)>0.005
2.
多头时:
hh:=hhv(h,enterbars+1);
openprofit/ref(asset,enterbars)>=0.009 and holding>0 and l<=hh-(hh-enterprice)*0.3
空头时:
ll:=llv(l,enterbars+1);
openprofit/ref(asset,enterbars)>=0.009 and holding<0 and h>=ll+(enterprice-ll)*0.3
这个就是走完k线