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

Re: Need EL Help



PureBytes Links

Trading Reference Links

Bob Fulks wrote:

> In the code below:
>
>    Condition1 = Average(Close, 9) < Average(Close, 18);
>    Condition2 = ....other.....;
>
> Condition1 and Condition2 are evaluated on every bar. The statement:
>
>    if Condition1 and Condition2 then Buy ....;
>
> will buy when both conditions are true on the same bar. If Condition1
> becomes true on bar 300 and stays true, and then Condition2 becomes true on
> bar 304, then the Buy command will be executed on bar 304.

Thanks for the help, Bob.  Here's the problem I'm having.  If Condition2 while
Condition1, then no problem.  However, I'm not getting signals if Condition2
precedes Condition1 with the particular system I'm trying to write. The problem
seems to arise from the fact that one of the conditions is based upon a reversal
- in this case, MACD.  If I knew how to rewrite this indicator so that, for
instance, the condition would always be true if the fast MACD was above the slow
MACD, then I think this would solve the problem in this particular case.  I'm
sure there is a simple way to do this, but I'm just learning EL, and I'd
appreciate it if you could give me a hand.

Thanks,
A.J.