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

EL code



PureBytes Links

Trading Reference Links

In vol. 98, issue 740 (Dec.28, 1998) I  posted some EL code ("No GoTo
Function") that tests two different conditions to decide if a block of
code is exected. It chooses one condition while stepping over a second
condtion, as occurs with a GoTo function, and can go on to test a fourth
condition (see the diagram (A) below). The following code does the same
thing but is constructed differently. With a small change it can be made
to function as in diagram (B). If the lines / and \ seem displaced in
you browser just slid them together right or left (I do not know how to
create a stable diagram in email. Can someone tell me). As I stated in
previous postings, I consider this type of code to be sort of modular
and applicable in different calculations (indicators) . 

I have made several posting of EL code (vol 98, #717, 740, 741, 742; vol
99, #40, 41)  that can be considered as modular. In some of those
postings I made the suggestion that code of this sort be collected from
the list and made available from one place, instead of getting lost in
the bowels of the list. I have not heard one response to that
suggestion. Have you all forgotten how damn time consuming it is to
learn EL given its quirks, idiosyncrasies, and omissions in
documentation? Could someone with a web site list this type of code?
This will not make EL instantly usable for a newbe but these simpler
blocks of code can help with the understanding of writing EL code.


(A)       cond2---- -----skip block of code
          /         \         /
cond1              cond4---execute block of code
          \          / 
            cond3---skip block of code

{......................................................................}

(B)      cond2 ---------- skip block of code
         /          \          /
cond1 --------- cond3---- execute block of code
 
{.................................................................}

Code (A)

Var: x(0), y(0), z(0);

If cond1 then x=1
else x=2;

If x=1 and cond2 then y=0
else y=1;

If x=2 and cond3 then z=0
else z=1;

If (y=0 or z=0) and cond4 then begin
          -block of code-
End;

{........................}

Code(B)

Var: x(0), y(0);

If cond1 then x=1
else x=2;

If x=1 and cond2 then y=0
        else y=1;

If (x=2 or y=0) and cond3 then begin
         -block of code-
End;

Wayne Mathews