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

RE: [amibroker] Newbie AFL question



PureBytes Links

Trading Reference Links

Here is what I write in situations like this.
IIF (H>L,X=(C-O)/(H-L+0.0001),X=0)

Notice the 0.00001.  Prevents the dreaded divide by zero.

Ken

-----Original Message-----
From: zimm630 [mailto:zim630@xxxxxxxx] 
Sent: Wednesday, November 26, 2003 10:23 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Newbie AFL question

I have an indicator I use that is as follows and works fine, until
X=(C-O)/(H-L);
Graph0 = Cum(X);

When downloading some ETFs which I have been following on occasion 
you have a day with no movement hence c=o=h=l and you have a zero in 
either or both the numerator and denominator.
If I do

IIF (H>L,X=(C-O)/(H-L),X=0)
Graph0 = cum(x)
The indicator just becomes a flat line and stays flat.

Any Ideas?

Thanks in advance for any help, and I wish everyone a happy 
Thanksgiving.
Bill 



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 

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




------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

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 

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