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

Re: Indicator builder help request



PureBytes Links

Trading Reference Links

Steve Park wrote:

> Could someone confirm for me that Metastock evaluates both
> conditions of an IF statement regardless of the outcome of the
> IF test? For example, if I use a statement such as:
>
> IF(A=B, 0, (A+B)/(A-B));
>
> I get a divide by zero error message when I use the indicator.
> It seems to me that if the condition that would cause such
> an error (A=B) occurs then the indicator should be zero and
> the other condition should not be evaluated.
>
> Any suggestions on how to avoid this if true?

>Could someone confirm for me that Metastock evaluates both
>conditions of an IF statement regardless of the outcome of the
>IF test?

Yes, it's correct.

Instead of IF(A=B, 0, (A+B)/(A-B)), use

(A+B)/IF(A=B,1000000000....000,A-B)

Vitaly