網友回復:NH:=REF(HHV(HIGH,N),1);ML:=REF(LLV(LOW,M),1); 當前持倉:HOLDING,COLORGRAY,LINETHICK0;當前資產:ASSET,NOAXIS,COLORGRAY; SCKD:=REF(CLOSE,TYPEBAR(1,1));SCKK:=REF(CLOSE,TYPEBAR(1,3));//==============================if high>NH thenbegin//平空開多sellshort(holding<0 and high>NH,0);buy(holding<=0 and high>SCKD,1);endif low<ML thenbegin//平多開空sell(holding>0 and low<ML,0);buyshort(holding>=0 and LOW<SCKK,1);end