if ss=1 then begin //如果滿足SS條件可以開始交易
tsell(TBUYHOLDING(1)>0 and (平多 or 開空) ,tholding,mkt);//多平
tsellshort(TSELLHOLDING(1)>0 and (平空 or 開多) ,tholding,mkt);//空平
Tbuy(TBUYHOLDING(1)=0 and 開多,ss,lmt,c),orderqueue,IGNORECHECKPRICE;//持倉(cāng)為0并且開多信號(hào)出現(xiàn),開1手限價(jià)交易,后面的交易信號(hào)檢測(cè)是否需要呢?
Tbuyshort(TSELLHOLDING(1)=0 and 開空,ss,lmt,c),orderqueue,IGNORECHECKPRICE;//后面交易檢測(cè)信號(hào)是否需要?
Tbuyshort(TSELLHOLDING(1)<2 and TENTERBARS(1)>25 and 開空 ,ss,lmt,c),orderqueue,IGNORECHECKPRICE;//加倉(cāng)條件,如果當(dāng)前持倉(cāng)在25周期后發(fā)現(xiàn)有開倉(cāng)信號(hào)則再加一手持倉(cāng).(這里對(duì)嗎?)
Tbuy(TBUYHOLDING(1)<2 and TENTERBARS(0)>25 and 開多 ,ss,lmt,c),orderqueue,IGNORECHECKPRICE;//加倉(cāng)條件同上
end