開高後大幅拉回後橫盤第三次跌破今日低點區(第三次到底而破)
if barfreq <> "Tick" then
RaiseRuntimeError("請設定頻率為TICK");
variable:BarNumberOfToday(0); if Date
<> Date[1] then BarNumberOfToday=1
else BarNumberOfToday+=1;{記錄今天的Bar數}
variable:idx(0),adx(0),temp(0),H1(0),H2(0),M1(0),Mp(0);
array:arr[500](0);
if Time <93000 and Close[1] >=
q_RefPrice and Close < q_RefPrice and{9:30前跌破平盤}
q_DailyOpen > q_RefPrice *1.01 then {開高}
begin {兩次急殺搜尋}
{先去雜訊}
arr[adx] =
Close[BarNumberOfToday-1];
for
idx = BarNumberOfToday-2 to 0
begin
if Close[idx] <> arr[adx] then adx+=1;
arr[adx]=Close[idx];
end;
{先找到兩次急殺中Peak 低點}
for idx = 0 to adx
begin
if
arr[idx] < arr[idx-1] and arr[idx] < arr[idx-2] and
arr[idx] < arr[idx+1] and arr[idx] < arr[idx+2] then
begin
M1 = arr[idx] ; Mp = idx; end;
end;
if M1 < q_RefPrice then return ; {如果已殺破平盤則不予考慮}
{找到第一次起跌的最高點}
for idx = 0 to Mp
begin
if arr[idx] > arr[idx-1] and
arr[idx] > arr[idx-2] and
arr[idx]
>arr[idx+1] and arr[idx] > arr[idx+2] then
H1 = arr[idx] ;
end;
if H1 < M1*1.01 then return; {第一次起跌跌不到 1% 則不考慮}
{找到第2次起跌的最高點}
for idx = Mp to adx
begin
if arr[idx] > arr[idx-1] and
arr[idx] > arr[idx-2] and
arr[idx]
>arr[idx+1] and arr[idx] > arr[idx+2] then
H2 = arr[idx] ;
end;
if H2 > Close *1.01 then ret=1; {第二次高點跌下1%以上破平盤則觸發}
end;