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

[EquisMetaStock Group] Re: Division by zero



PureBytes Links

Trading Reference Links

Oops, this will only work if a pipsize is 1.  Change it to

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

to make it a bit more general. Note the problem with the earlier
version, if h-l=0.5, it would still substitute the 0.5 with 1 (the max
of 1 and 0.5 = 1) in the divisor.

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


--- In equismetastock@xxxxxxxxxxxxxxx, mgf_za_1999 <no_reply@xxxx> wrote:
> 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/