PureBytes Links
Trading Reference Links
|
See AmiBroker Help for the nz() function
NZ
- Null (Null/Nan/Infinity) to zero Miscellaneous functions
(AFL 2.3)
SYNTAX Nz( x, valueifnull = 0 )
RETURNS NUMBER, ARRAY
FUNCTION Converts Null/Nan/Infinity values to zero (or user defined value)
x can be number or array.
You can use the Nz function to return zero, or another specified value when
argument x is Null or Nan or Infinite.
For example, you can use this function to convert a Null (empty) value to
another value and prevent it from propagating through an expression. If the
optional valueifnull argument is included, then the Nz function will return
the value specified by that argument if the x argument is Null (or Nan or
Infinity).
EXAMPLE You can use the Nz function as an alternative to the IIf function.
Instead of:
varTemp = IIf( IsFinite( (H-L)/(C-L) ), (H-L)/(C-L), 0 );
You can write:
varTemp = Nz( (H-L)/(C-L) );
SEE ALSO
See updated/extended version on-line.
-----Original Message-----
From: nb9trade [mailto:clyde@xxxxxxxxxxx]
Sent: Wednesday, January 28, 2004 11:33 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Division By Zero Problem
When I have a formula that uses A = (high - low) as a divisor it
only works as long as A =(high - Low) does not = 0.
I need a simple command to set the variable to .000001 in such cases.
The last language I programed in was Q basic.
In qbasic all it would take is an if then statement like
if a=0 then a = .0000001
how would this be written in AFL?
Thanks
Clyde
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|