小編你好
今天遇到新纖被打到停損,因為新纖今天除息,所以我有一些疑惑,我的腳本出場部分如下,
這個條件在還原後是成立的:(closeD(1)=lowest(closeD(1),4) and low<=lowest(lowD(1),4) and date<>filledEntryDate)
我的問題是,盤後回測,如果勾選"還原值"則出場會落在8/25 9:01而非今天,如果不勾選"還原值",就不會觸發停損(停損點若還原應該在15.65),我該如何做才能讓回測在預期的點位出場?
var:intraBarPersist dayentry(0);
if date<>date[1] and (currenttime=090000 or currenttime=133000) then dayentry=0; //控制當天出場後,不會當天又再進場
condition1= close <> getField("漲停價") ;//排除漲停價做多,因為不一定買的到
condition2= open <= GetField("Close", "D")[1]*(1+10/100) and open >= GetField("Close", "D")[1]*(1-10/100);//開盤介於
if date<>date[1] and position=0 and dayentry=0 and condition1 and condition2
then begin
setposition(1,AddSpread(Close,+2));
end;
if filled>0 and close <> getField("跌停價", "D") and
( close>=filledAvgPrice*(1+100*0.01)
or close<=filledAvgPrice*(1-15*0.01)
or (closeD(1)=lowest(closeD(1),4) and low<=lowest(lowD(1),4) and date<>filledEntryDate)
)
then begin
dayentry=1;
setposition(0,AddSpread(Close,-10));
end;
6 評論