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

Re: Dual MA Crossover Explained in English



PureBytes Links

Trading Reference Links

Some traders will know "generally" what a system or indicator does by the name
but it is best to translate from EL code to English so (1) you can practice
your EL (2) understand EL better and easier and (3) know what the
indicator/system is actually doing.  Randy T. has given a great example of
identifying the code and explaining what the code is doing.   I believe we
should apply his methods to the systems and indicators supplied by The CODE.
The description can then be added to the indicator so that we can refer to it
months from now when it is no longer fresh in our minds.

As an example I will do a "basic" analysis of the Dual Moving Average
Crossover system because it is probably familiar to most traders.  The code
and my comments are shown below.  Hope it helps.

{10/40 Dual Moving Average Crossover}
********First everything in brackets is ignored by TS so it is a perfect way
to display the title and any descriptions of the code.  Next Line (below) is
the word INPUT: followed by 3 types of inputs.  We can quickly guess what
MAShort and Long are but we don't yet know what "Multi" is until later.  For
now we simply know that inputs are items that can be changed without re-
writing the code.  Very important for novices.  Under the INPUT line is VAR:
meaning one variable called CONS will be used.***********
INPUT: Multi(0), MAShort(10), MALong(40);
VAR: Cons(0);
********************** Next is a description of the Multi input and the
variable which is a formula WHEN Multi=1 and the word ELSE tells us that if
Multi is not =1, then Cons=1 instead of the formula.  We still don't know
exactly what Multi and Cons are but it should become clear
soon.**************************
IF Multi = 1 THEN 
   Cons = 5000 / ( StdDev(Close - Close[1], 30) * BigPointValue)
   ELSE
      Cons = 1;

IF Cons < 1 THEN Cons = 1;

IF Average(Close, MAShort) > Average(Close, MALong) THEN
      Buy ("MA Buy") Cons Contracts Next Bar at Market;

IF Average(Close, MAShort) < Average(Close, MALong) THEN
      Sell ("MA Sell") Cons Contracts Next Bar at Market;
************************  We now see Multi & Cons applied in the code and they
appear to describe the number of contracts to be traded.  Most novices would
write this code without Multi and Cons so it is good to see how others
approach the subject.  However, the actual code describes in EL what we want
to do.  In this case, we want to buy 1 contract when the shorter MA (10 bars)
is above or greater than the longer MA (40bars).  This is an automatic signal
so the order is placed at the market and not at a specific price.  There also
has to be some time element so TS can activate the order and this is described
by "Next Bar".

The actual description of this would be that the system buys when a shorter MA
goes above a longer MA.  The lengths of the MA's can be changed by changing
the inputs from the default settings of 10 and 40.  The system appears to
allow for multiple contracts to be traded.  As a novice, this is my effort but
others could do better without being as "basic" as this analysis.  In any
event, it is best to include a description of the system or indicator with the
code for easy reference in the future.

Maybe others can post English descriptions of the systems posted by The Code.
Lynn