+1 888 340 6572

Thrust Retracement

Article/Author: "A Rule-Based Approach To Trading"
                              Jeffrey Owen Katz, Stocks&Commodities magazine, 12/1996

Download: thrustr.ela

File Includes: Signal - Thrust Retracement

Category: Strategy > Thrust Retracement

Description: As described in Stock&Commodities magazine.

EasyLanguage Code:
INPUTS: RETPCNT(70), THRUST(1);

VARS: LB(0), HB(0), LP(0), HP(0), FB(0);
VARS: NORM(0), RETLEVEL(0);

IF DATE <> DATE[1] THEN BEGIN
LB = -1;
HB = -1;
LP = 1000000;
HP = -1000000;
FB = CURRENTBAR;
END;
IF H > HP THEN BEGIN
HP = H;
HB = CURRENTBAR;
END;
IF L < LP THEN BEGIN
LP = L;
LB = CURRENTBAR;
END;
NORM = AVERAGE(RANGE, 20);

IF MARKETPOSITION <= 0 AND DATE TOMORROW = DATE THEN BEGIN
IF LB >= FB AND HB > LB AND HB < CURRENTBAR THEN BEGIN
IF HP - LP > THRUST * NORM * SQUAREROOT(HB - LB) THEN BEGIN
RETLEVEL = LP + (HP - LP) * RETPCNT / 100;
IF L > RETLEVEL AND L[1] > RETLEVEL THEN BEGIN
BUY NEXT BAR AT RETLEVEL LIMIT;
END;
END;
END;
END;

IF MARKETPOSITION > 0 THEN BEGIN
EXITLONG NEXT BAR AT ENTRYPRICE(0) + (HP - LP) * .50 LIMIT;
IF BARSSINCEENTRY > 16 THEN
EXITLONG NEXT BAR AT MARKET;
END;

IF MARKETPOSITION >= 0 AND DATE TOMORROW = DATE THEN BEGIN
IF HB >= FB AND LB > HB AND LB < CURRENTBAR THEN BEGIN
IF HP - LP > THRUST * NORM * SQUAREROOT(LB - HB) THEN BEGIN
RETLEVEL = HP - (HP - LP) * RETPCNT / 100;
IF H < RETLEVEL AND H[1] < RETLEVEL THEN BEGIN
{IF VALUE1 > VALUE1[1] THEN}
SELL NEXT BAR AT RETLEVEL LIMIT;
END;
END;
END;
END;

IF MARKETPOSITION < 0 THEN BEGIN
EXITSHORT NEXT BAR AT ENTRYPRICE(0) - (HP - LP) * .50 LIMIT;
IF BARSSINCEENTRY > 16 THEN
EXITSHORT NEXT BAR AT MARKET;
END;