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

Re: Last Cross Over



PureBytes Links

Trading Reference Links

At 10:20 AM -0500 4/27/02, Southwest Transaction Group, Inc. wrote:

>To keep this example simple, lets say I have a moving average
>crossover. When there is a crossover, I'd like to plot a line that
>extends to the right BUT ONLY on the last crossover.
>
>Vars: MA1(0), MA2(0);
>
>MA1 = AVERAGE(C,8);
>MA2 = AVERAGE(C,4);
>
>IF MA1 CROSSES OVER MA2 AND (its the last crossover only) THEN
>   Plot1(line, extend right, "");

Unfortunately, since bars are processed from first to last, there is
no way to know that a crossover is the last one until you get to the
end.

You can plot a horizontal line that extend to the right on each
crossover and get reset by the next crossover:

Vars: MA1(0), MA2(0), CrossVal(0);

MA1 = AVERAGE(C,8);
MA2 = AVERAGE(C,4);

IF MA1 CROSSES OVER MA2 THEN
   CrossVal = MA1;

Plot1(CrossVal, "1"):

Bob Fulks