請問我想寫符合進場條件後的第20日進場,用以下語法在交易腳本回測無結果,目前回測知道是有關『20日後』的語法應該有問題,請問是那邊有誤呢?
variable: BH(0),BL(0),DS(0),n(0);
condition1 =進場條件
if condition1 then begin
BH=h;
BL=L;
DS= 1 ;
if DS >=1 and date <> date[1] then DS += 1;
end;
if position=0 and filled=0 and condition1[n] and DS>=20 and close>BL then begin
setposition(1,market);
DS=0;
end;
end;
5 評論