当连续出现4次亏损后,增加平仓条件,多为1阴包3阳和当前k线的收般价小于前5k线的收般价。空为1阳包3阴和当前k线的收般价大于前5k线的收般价。
谢谢了!
if NUMLOSSTRADE>=4 and count(c>o,4)=3 and all(c>o,3) and holding>0 and c<ref(c,5) then sell(1,0,market);
if NUMLOSSTRADE>=4 and count(c<o,4)=3 and all(c<o,3) and holding<0 and c>ref(c,5) then sellshort(1,0,market);
仅供参考