[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

>       100 * (RSI - BollingerBandBottom) / (BBTop - BBBottom)
>
>Just applying this custom formula, will give 'errors'.
>
>The Function RSI can be called automatically, but the other three(3) BB's
>for Functions will have to be defined first.


No doubt I should have just fired up Metastock and pulled the formula
out of the Indicator Builder instead of just sketching it in with an ad hoc
pseudocode and assuming everyone would understand.  However,
the Bollinger band functions are the BBandTop and BBandBot functions
that you paste in off the list.  Here's how the formula really reads:

RSILen:=Input("RSILen",2,50,5);
BBLen:=Input("BBLen",3,50,3);
100 * (RSI(RSILen) -  BBandBot(RSI(RSILen),BBLen,E,2)) / 
(BBandTop(RSI(RSILen),BBLen,E,2) - BBandBot(RSI(RSILen),BBLen,E,2));80;20

Works just fine.  However, when I tried to average three different ones,
I dumped the input statements and hard-coded the RSI and Bollinger
band lengths.  Somehow, I can't convince myself that this was where I
went wrong.

I appreciate whatever help anyone can provide.

Owen Davies