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

Re: Odd problem in trying to write an indicator



PureBytes Links

Trading Reference Links

Adam Hefner pointed out:


> Owen,
>   It might help if I could see your exact code.


>> Today I tried to average three of these things, and it
>> just doesn't work.  The indicators (based on the RSI)
>> give the expected wiggly lines.  Add them up, and divide
>> by three, and what I get is a constant, a nice, straight
>> line!  In fact, simply adding them up produces a constant
>> -85.  Using the Add() function unstead of a simple plus
>> produces the same thing -- not that I doubted it would.


I didn't bother including them, because I suspect this is a
general problem.  However, the indicators I was playing with
this time were simple %B of the RSI.  To use pseudo-code:

100 * (RSI - BollingerBandBottom) / (BBTop - BBBottom).

All I wanted to do was:

(%B1 + %B2 + %B3) / 3, where the period of the RSI and
the Bollinger band length varied from one %B to the next.
It seemed little enough to ask.

What came out was a straight line, which was outside the
range of %B values I was trying to average.  I tried varying
PerN and BBLenN, without effect.  Even the value of the
constant output remained the same.

The same thing happened the other day when I was playing 
with combining several different oscillators in the same way.
Eventually, I stopped editing that indicator and set up another
in which to play with the various factors that entered into the
equation.  That time it worked, with no obvious explanation,
as I hadn't done anything different.  Unfortunately, I don't even
remember which oscillators were involved.  It wasn't anything
serious, just a way of clearing my mind when overburdened
with other work.

I appreciate whatever help anyone can offer.

Thanks again.

Owen Davies