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

Re: EL help



PureBytes Links

Trading Reference Links

At 2:50 PM -0400 10/8/98, Ian Cunningham wrote:
>Would someone show me how to do the following in EL?
>
>I want to record the number of times an oscillator is true
>and plot  as an indicator.
>
>For example:
>
>Condition1 = PercentR(10) > 99;
>If Date <> Date[1] etc, etc.
>
>Plot1(The # of times Condition1 = true,"OB");
>
>It is my understanding I need to use a While loop as the
>number of loops are undetermined. Due to being EL impaired
>when I try this I get the exit-from-the-loop part wrong and
>lock up the computer!

You need to specify a little more information:

Are you using intraday or end-of-day data?

Do you want to count the number of bars for which PercentR > 99 or the
number of times it crosses over 99?

If using intraday data do you want to plot the running count on every bar
or just on each new day.

If true, do you want to reset the count at the start of each day?

You comment of the While loop is not very clear to me - please expand on the

It would seen that it should be simple to do something like the code shown
below.

Bob Fulks

--------

Var: Count(0);

Count = iff(Date <> Date[1], 0, Count);  {If you want to reset each day}

Count = iff(PercentR(10) > 99, Count + 1, Count;
Plot1(Count, "Count");

---------







  • References: