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

Re: Simple Easy Language Code



PureBytes Links

Trading Reference Links

At 9:20 PM +0200 5/13/01, Charles Strong wrote:

>I am going to study it and try to figure out what is going on with
>each line.  I have a pretty good idea, but I would never have come up
>with that by myself.


Sorry for the lack of comments but it is pretty simple:

This statement is required because we need to refer to a past value
of the MarketPosition  function so we need to save it in a variable:

MP = MarketPosition;



This statement finds the highest high of each bar and resets it when
we make a trade. Stated in words:

    If High > HHigh or our market position has changed then
    set HHigh = High otherwise, leave it as it was.

The "iff" function is a handy shortcut for this.

HHigh = iff(High > HHigh or MP <> MP[1], High, HHigh);



This statement only allows a sell when we are long so will prevent
two trades on the same bar.

if MP >= 0 then Sell next bar at HHigh * (1 - 0.01 * SZ) stop;

Bob Fulks