Black Friday great discounts start today Learn more
+1 888 340 6572

TrendLine BreakOut

Article/Author: Omega Research, 1997

Download: TLBOsys.ela

File Includes: Signal - TrendLine BreakOut

Category: Strategy > TrendLine BreakOut

Description: This is an example of trendline breakout system .

Signal 1-2-3 Reversal ELA Code:
INPUT:  TRENDLEN(20);


VALUE1=@MOMENTUM(C,3);
VALUE2=@MOMENTUM(C,3)[1];
VALUE3=0.3*(VALUE1-VALUE2)+(1-0.3)*VALUE3;
VALUE4=WAVERAGE((VALUE3),6);
VALUE5=@RSI(C,9)+VALUE4;

{ DETERMINE THEN BEGINNING AND ENDING POINTS OF AN UPWARD TREND LINE. }

VALUE6 = SWINGLOWBAR(1,LOW,3,TRENDLEN);
PRINT("DATE: ",DATE:0:0," TIME: ",TIME:4:0," SWINGLOWBAR 1ST# = ",VALUE6:2);
IF VALUE6 > -1 THEN BEGIN
VALUE7 = SWINGLOWBAR(1,LOW,3,TRENDLEN)[VALUE6];
PRINT("DATE: ",DATE:0:0," TIME: ",TIME:4:0," SWINGLOWBAR 2ND# = ",VALUE7:2);
IF VALUE7 > -1 THEN BEGIN
VALUE8 = TLVALUE(LOW,VALUE6,LOW,VALUE7,-1);
PRINT("DATE: ",DATE:0:0," TIME: ",TIME:4:0," TREND LINE UP = ",VALUE8);
END;
END;

{ DETERMINE THEN BEGINNING AND ENDING POINTS OF A DOWNWARD TREND LINE. }

VALUE9 = SWINGHIGHBAR(1,HIGH,3,TRENDLEN);
PRINT("DATE: ",DATE:0:0," TIME: ",TIME:4:0," SWINGLOWBAR 1ST# = ",VALUE9:2);
IF VALUE9 > -1 THEN BEGIN
VALUE10 = SWINGHIGHBAR(1,HIGH,3,TRENDLEN)[VALUE9];
PRINT("DATE: ",DATE:0:0," TIME: ",TIME:4:0," SWINGLOWBAR 2ND# = ",VALUE10:2);
IF VALUE10 > -1 THEN BEGIN
VALUE11 = TLVALUE(HIGH,VALUE9,HIGH,VALUE10,-1);
PRINT("DATE: ",DATE:0:0," TIME: ",TIME:4:0," TREND LINE DN = ",VALUE11);
END;
END;

{ BREAKOUT OF A DOWNWARD TREND LINE. }
CONDITION1=SLOWD(9)[1]LOWD(9);
CONDITION2=VALUE4[1]CONDITION3=VALUE5[1]CONDITION4=VALUE5>50;
CONDITION5=CLOSE>VALUE11;

{ BREAKOUT OF AN UPWARD TREND LINE. }
CONDITION6=SLOWD(90)[1]>SLOWD(9);
CONDITION7=VALUE4[1]>VALUE4;
CONDITION8=VALUE5[1]>VALUE5;
CONDITION9=VALUE5<50;
CONDITION10=CLOSE
IF VALUE9 < VALUE6 AND VALUE10 < VALUE7 THEN BEGIN
IF {CONDITION1 AND CONDITION2 AND CONDITION3 AND CONDITION4 AND} CONDITION5 THEN BUY ON CLOSE;
END;

IF VALUE9 > VALUE6 AND VALUE10 > VALUE7 THEN BEGIN
IF {CONDITION6 AND CONDITION7 AND CONDITION8 AND CONDITION9 AND} CONDITION10 THEN SELL ON CLOSE;
END;