咨詢內容:if ref((tmpd=1 or (count(bi=-1,2)=1 and aq1>=1)) and (gpd1 or gpd2),1) then begin? ?sellshort(1,ss,LIMITR,O);? ?buy(holding=0,ss,LIMITR,O);end多止:valuewhen(enterbars=1,llv(fl,2)),NODRAW;if enterbars>1 and min(o,c)<=多止-2*MINDIFF then sell(1,ss,marketr);if holding>0 and ((enterbars>1 and pdd=-1) or (enterbars>15 and aspect=1)) then sell(1,ss,marketr); if ref((tmpk=-1 or (count(bi=1,2)=1 and aq1>=1)) and (gpk1 or gpk2),1) then begin? ?sell(1,ss,LIMITR,O);? ?buyshort(holding=0,ss,LIMITR,O);end?空止:valuewhen(enterbars=1,hhv(fh,2)),NODRAW;if enterbars>1 and max(o,c)>=空止+2*MINDIFF then sellshort(1,ss,marketr);if holding<0 and ((enterbars>1 and pkk=1) or (enterbars>15 and aspect=0)) then sellshort(1,ss,marketr);? 請幫忙看看
網友回復:if ref((tmpd=1 or (count(bi=-1,2)=1 and aq1>=1)) and (gpd1 or gpd2),1) then begin? ?sellshort(1,ss,LIMITR,O);? ?buy(holding=0,ss,LIMITR,O);end平倉反手在圖表中,是同時進行的,也就是說在執行sellshort和buy是使用的同一個holding的狀態值,所以在平倉后就會造成buy(holding=0,...)條件不滿足,。也就是你看到的現象你可以改成?sellshort(1,holding,LIMITR,O);
? ?buy(1,ss,LIMITR,O);