PureBytes Links
Trading Reference Links
|
Hello,
I'm just getting started with AFL and I'm running into a little
problem with an exploration. The trouble I'm having can be
demonstrated with a simple exploration.
/******************************************************/
RevEpsObject = CreateStaticObject("QuotesPlus.RevEps");
RevEpsObject.Symbol = Name();
QEPS1 = RevEpsObject.Earnings(-1);
Filter = 1;
AddColumn(QEPS1, "QEPS1", 10.4);
/******************************************************/
This exploration runs fine for tickers that have a valid value for
last quarter's EPS, but fails for tickers that do not have a valid
value. I found a reference for doing something similiar via scripting
on PureBytes at:
http://www.purebytes.com/archives/amibroker/2001/msg02648.html
In reading this entire thread, a solution for AFL isn't given, though
it is from 2001, and Amibroker enhancements seem to come along quite
frequently. I also haven't found anything in the help. Given the
casts that are being done in the script, and the error I'm
getting(type mismatch. Assignment failed), I'm guessing that this QP
object is returning a variant that cannot be properly assigned to the
AFL variable. I tried using IsNull to get around this, but it is not
sufficient. Is there a function or flow control statement in AFL that
will allow me to properly handle these type mismatches, either by
doing a cast, catching the type mismatch exception, or testing the
variant type prior to assignment?
I'm pretty sure I could get a script version of this running, but I
read in the help that native AFL can be significantly faster for
nontrivial code.
Thanks,
Kevin
------------------------ 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/GHeqlB/TM
--------------------------------------------------------------------~->
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.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/
|