小幫手好
下面腳本之前回測都是正常的
今天回測,都沒有任何交易出現
商品來源為選股策略,頻率為日資料
請小幫手了解下
謝謝
input:profitex(10,"獲利多少出場%"),lostex(10,"虧損多少出場");
var:intraBarPersist dayentry(0);
//控制當天出場後,不會當天又再進場
if date<>date[1] {and currenttime=090000} then dayentry=0;
if position=0 and dayentry=0 then setposition(1);
//if date<>date[1] and position=0 and dayentry=0 and getfield("close","D")[1]<=maxprice then setposition(1);
if position>0 and filled>0
    and (close>=filledAvgPrice*(1+profitex*0.01)
    or close<=filledAvgPrice*(1-lostex*0.01))
    then begin
    dayentry=1; 
    setposition(0);
end;
            
 
            
        
        
        
            
1 評論