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

Indicator for Lower Lows, etc.



PureBytes Links

Trading Reference Links

Hi Everyone -

I am trying to get a simple indicator working. It is supposed tell when a
moving average is making higher highs, and/or lower lows.  IE, I would like
a   -1 flag when the bottom swings keep getting lower and a +1 for top
swings getting higher.

IE, if the average is making higher swinghighs (+1) then suddenly breaks
down and makes a new low which breaks the previous swing low, I need a -1
flag and vice versa.

For some reason, the code below will not do the job. I'm trying to take the
second last occurrence of a swing low and compare it against the most recent
occurrence.

I've tried different approaches with poor results....

Any ideas on this OR an easier way to do it?

Thanks in advance.

Tom Cathey


{  SwingLow(OCCUR,PRICE,STRENGTH,LENGTH)  - for reference}

{This is just for the Lows - Highs not included}

Var:
MA(0),Trend(0);

MA=Average(Close,20);

If   SwingLow(2,MA,10,30) < SwingLow(1,MA,10,30) then Trend= 1;

If   SwingLow(2,MA,10,30) > SwingLow(1,MA,10,30) then Trend= -1;

Plot1(Trend,"");     {+1 or  -1}