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

[EquisMetaStock Group] Re: Division by zero



PureBytes Links

Trading Reference Links

Even though you do something like

    if(h<>l,1/(h-l),0)

MSFL will still evaluate the expression, regardless of the fact that
it will not be returned.  This has been discussed before, try
something like

1/max(h-l,1)*(h>l)

which will ensure that the divisor is always positive and also that
you get a zero when h=l from the ... *(h>l)  portion.

Regards
MG Ferreira
TsaTsa EOD Programmer and trading model builder
http://www.ferra4models.com
http://fun.ferra4models.com


--- In equismetastock@xxxxxxxxxxxxxxx, Tiunan <tiunan@xxxx> wrote:
> Hello,
> 
> I have this message :
> The following maths errors occured during the calculation of ...
> Division by zero 29.
> My program is the following (really simple):
> 1/(hight-low)
> My solution is:
> if ((H-L)=0,0,1/(H-L))
> or I have this solution:
> If(H<>L,1/(H-L),0)
> 
> In fact I have always this message.
> Any help will be appreciate (why 29 ?)
> 
> Thank you for all
> Regards Tiunan.
> 
> 
> 
> 	
> 
> 	
> 		
>
___________________________________________________________________________

> Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo!
Messenger 
> Téléchargez cette version sur http://fr.messenger.yahoo.com




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/BefplB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/