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

Re: EL Question



PureBytes Links

Trading Reference Links

At 1:56 PM -0700 12/21/01, Lee Goldberg wrote:

>EventA (StudyA MA crossover) occurs.
>The value of StudyB at the same time as the MA crossover is 12 bars.
>Begin counting and alert me when 6 bars (12 * Input(.5) ) have passed since
>the MA crossover occurred.


Something like this should work (untested).

Bob Fulks


Input: Ratio(0.5);

Vars: MA1(Close), MA2(Close), StudyB(0), MaxCnt(0);

MA1 = Average(...);
MA2 = Average(...);
StudyB = .....

MaxCnt = iff(MA1 crosses over MA2, Ratio * StudyB, MaxCnt - 1);
if MaxCnt <= 0 and CheckAlert then Alert = TRUE;