PureBytes Links
Trading Reference Links
|
Hello,
1. Yes. Use Name() function http://www.amibroker.com/f?name
if( Name() == "BHP" )
{
.. conditional code here
}
_TRACE("Current symbol = " + Name() );
2. Yes. Use Foreign http://www.amibroker.com/f?foreign
3. Yes, it is called Static variable
http://www.amibroker.com/f?staticvarset
You can also set max open pos via code SetOption("MaxOpenPositions", numberhere )
http://www.amibroker.com/f?setoption
or control it from custom backtester.
Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: "indo26_slate" <indo26_slate@xxxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Thursday, April 19, 2007 10:36 AM
Subject: [amibroker] AFL capabilities and limitations?
>I have some questions about AFL's capabilities. I will ask more
> general questions, and then ask more specific questions which use
> examples.
>
> q1) I understand that the AFL program is executed once for each
> company code that is being backtested. Can the program be written to
> consider which company is in context when being executed? so for
> example, could I use _TRACE to print debug info, where I am printing
> the ASX code in context. example: BHP
>
> q2) More in depth to question 1 - can I write the program to
> consider the state of an index (such as the all ords index), in
> order to define buy/sell logic? Perhaps the logic may read (in
> english) - I will only buy if yesterday's all ords close is higher
> than the day before.
>
> q3) Considering that a single AFL program is executed many times
> during a backtest (once for each stock in the watchlist), is there a
> concept of global variables, where
> the AFL program can reference a variable/value written in a previous
> execution? for example, is it possible to know how many buys have
> been assigned (how many positions are open). For example,
> I may want to program my backtest to only allow 10 positions to be
> open at any one time. (or a more complex way of limiting the number
> of open positions, rather than hard-coded 10) Is it possible to
> write AFL code to do this?
>
>
>
>
> 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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
>
> For other support material please check also:
> http://www.amibroker.com/support.html
>
> Yahoo! Groups Links
>
>
>
>
>
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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
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/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:amibroker-digest@xxxxxxxxxxxxxxx
mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx
<*> 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/
|