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

Re: Why Won't This Work?



PureBytes Links

Trading Reference Links

Tom,

is it possible that the moving average values aren't making swing lows? A 20
period MA is pretty smooth to begin with and won't have a lot of sharp dips.
And, your code is trying to find dips that have 10 bars on each side of the dip,
and you're requiring all this to be found in only 30 bars. I think the reason
it's flatlining is that there are none of these animals to be found!

Regards,

Bill Vedder



Tom Cathey wrote:

> Can someone tell me why this indicator will not flag +1 or -1  when it makes
> higher low swings or lower low swings?  If not, anyone have another
> solution?
>
> Thanks.
>
> Tom Cathey
>
> {  SwingLow(OCCURANCE,PRICE,STRENGTH,LENGTH)  - for reference}
>
> 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}