PureBytes Links
Trading Reference Links
|
priapus
You've got the theory right. In this case substituting 1 is OK, but in some circumstances another
value such as 0.00001 might be more useful. MetaStock processes the innermost parentheses first so
the problem must be fixed BEFORE the division takes place. In the examples below the If() function
is processed before the division takes place, so the offending divide-by-zero error is eliminated
{test for (H-L)=0}
Cum((( (CLOSE-LOW) - (HIGH-CLOSE) ) /
If((HIGH - LOW)=0,1,(HIGH - LOW)) ) * VOLUME );
{test for H=L}
Cum((( (CLOSE-LOW) - (HIGH-CLOSE) ) /
If((HIGH = LOW),1,(HIGH - LOW)) ) * VOLUME );
{test for H=L, same as above but shortened}
Cum((((C-L)-(H-C))/If((H-L)=0,1,H-L))*V);
A similar question to this was addressed in this month's MetaStock Tips & Tricks newsletter.
Kind regards
Roy Larsen
www.metastocktips.co.nz
Free formulas and MS links
> I've recently joined the ranks of RT users and the following
> indicator is annoying the bloody hell out of me, despite telling
> MSWIN 9.0 to "Don't show futuure errors for this indicator in this
> chart".
>
> What I think I need to do is create 2 statements such that
>
> 1. If the the denominator (HIGH - LOW) = 0, substitute CLOSE
> 2. If VOL = 0, substitute 1
>
> [Improved OBV]
> Cum((( (CLOSE-LOW) - (HIGH-CLOSE) ) / (HIGH - LOW)) * VOLUME )
>
> I hate to impose on the goodwill of this group without first
> attempting a solution myself, but I'm rusty as hell. Are my steps
> toward a solution headed in the right direction?
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/zMEolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Metastockusers/
<*> To unsubscribe from this group, send an email to:
Metastockusers-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|