警示語法
variable : Direction(0),KH(0),KL(0),GapBar(0),Gapdirection(0);
Direction = 0; KH = 0; KL = 0; GapBar = 0; Gapdirection = 0;
condition1 = false; condition2 = false;
{-----------------------------------------------------------------}
if ( HighD(1) < LowD(2) ) //向下跳空
then begin
KH = HighD(1);
KL = LowD(1);
GapBar = BarNumber;
Gapdirection = -1;
end;
{-----------------------}
condition1 = HighD(0) > KH and gapdirection = -1; //向下跳假的
condition2 = trueany(condition1,10);
//--------------------
input:act(1,"1=B,2=S,3=c");
variable:bsf(0);
if condition1 and bsf = 0
then begin
if act = 1 then ret = 1;
bsf = 1;
end;
if condition2 and bsf = 1
then begin
if act = 2 then ret = 1;
bsf = 0;
end;
但回測起來
出場應該是進場後第10根K線出場的condition2
實驗結果卻不是這樣
請問小幫手我這樣寫哪邊錯誤?
3 評論