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

Re: Intraday Intensity



PureBytes Links

Trading Reference Links

I think Dennis has well tackled the divide by 0 problem.

I programmed it simply checking to see if the dividing bits were zero 
and then not calculating the indicator if they were.

But can I ask what benefit adding the Average function has? I've simply 
been using it in its native format according to the formula he gives on 
p 148.

Cheers,
Ian

> I'm attempting to create the Intraday Intensity normalized oscillator 
> that
> appears in John Bollinger's latest book.
> 
> This is what I have written based on the formula he provided:
> 
> {Intraday Intensity, 21-Day Normalized II Oscillator}
> 
> Input: Length(21);
> 
> Value1 = Average( 2*Close - High - Low / (High - Low)*Volume, Length) 
> /
> Average(Volume, Length)*100;
> 
> Plot1(Value1, "II%");
> 
> 
> However, when the indicator is applied to data I receive the following
> message:
> 
> ****************************************************
>  Runtime Error
> 
>  Attempted to divide by zero (0). You
>  should always check before dividing
>  to be sure divisor is not zero.
> 
>  Incorrect example:
> 
>  Value1 = (C - O) / (H - L)
> 
>  Correct example:
> 
>  Value1 = IFF(H - L <> 0, (C - O) / (H - L), 1)
> 
> *****************************************************
> 
> I understand the issue but, I've been unsuccessful at applying the 
> fix.
> 
> There are two divisors in the formula.  Which one do I apply the IFF
> statement to?
> 
> No matter which combination I choose, I continue to receive the same 
> error.
> 
> Any help will be most appreciated.
> 
>