[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EL Code to find triangle formations.



PureBytes Links

Trading Reference Links

{ CREATED BY: Emmanuel Lavelanet 1995 }
 
INPUT:USS(4),DSS(4); { *  UP/DOWNSWING STRENGTH}
 
VALUE1 = SWINGHIGHBAR(1,H,USS,MAXBARSBACK - USS);
VALUE11 = SWINGHIGH(1,H,USS,MAXBARSBACK - USS);
VALUE2 = SWINGHIGHBAR(2,H,USS,MAXBARSBACK - USS);
VALUE12 = SWINGHIGH(2,H,USS,MAXBARSBACK - USS);
VALUE3 = SWINGLOWBAR(1,L,DSS,MAXBARSBACK - DSS);
VALUE13 = SWINGLOW(1,L,DSS,MAXBARSBACK - DSS);
VALUE9 = SWINGLOWBAR(2,L,DSS,MAXBARSBACK - DSS);
VALUE19 = SWINGLOW(2,L,DSS,MAXBARSBACK - DSS);
 
 
IF MAXLIST(VALUE1,VALUE2,VALUE3,VALUE9) < MAXBARSBACK AND
MINLIST(VALUE1,VALUE2,VALUE3,VALUE9) > 0 AND
VALUE19 < VALUE13 AND VALUE12 > VALUE11 THEN BEGIN
 
     VALUE50 = VALUE2 - VALUE1;
     VALUE51 = VALUE12 - VALUE11;
     VALUE53 = VALUE51 / VALUE50;
 
     VALUE60 = VALUE9 - VALUE3;
     VALUE61 = VALUE13 - VALUE19;
     VALUE63 = VALUE61 / VALUE60;
 
IF VALUE9 >  VALUE2 THEN BEGIN
    VALUE12 = VALUE12 + (VALUE53 * (VALUE9 - VALUE2));
    VALUE30 = VALUE9;
END;
 
IF VALUE2 > VALUE9 THEN BEGIN
    VALUE19 = VALUE19 - (VALUE63 * (VALUE2 - VALUE9));
    VALUE30 = VALUE2;
END;
 
                IF VALUE1 = USS THEN BEGIN
                     FOR VALUE20 = VALUE30 DOWNTO 0 BEGIN
                          VALUE31 = 1;
                          PLOT1[VALUE20]((VALUE12 - VALUE54),"RES");
                          PLOT2[VALUE20]((VALUE19 + VALUE55),"SUP");
                          IF VALUE12 - VALUE54 <= VALUE19 + VALUE55  AND VALUE12 - VALUE54 >
                          0 THEN BEGIN
                               VALUE20 = 0;
                          END;
                          VALUE70 = (VALUE12 - VALUE54)[VALUE20];
                          VALUE71 = (VALUE19 + VALUE55)[VALUE20];
                          VALUE54 = VALUE54 + VALUE53;
                          VALUE55 = VALUE55 + VALUE63;
                     END;
                 END;
 
IF VALUE31 = 1 AND VALUE70 >= VALUE71  THEN BEGIN
     PLOT1(VALUE70,"RES");
     PLOT2(VALUE71,"SUP");
     VALUE70 = VALUE70 - VALUE53;
     VALUE71 = VALUE71 + VALUE63;
END;
 
IF VALUE31 = 1 AND VALUE70 < VALUE71 THEN BEGIN
     VALUE54 = 0;
     VALUE55 = 0;
     VALUE31 = 0;
     VALUE70 = 0;
     VALUE71 = 0;
     VALUE53 = 0;
     VALUE55 = 0;
     VALUE30 = 0;
END;
    
END;