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

Re: [amibroker] AFL comments



PureBytes Links

Trading Reference Links


Dima and all,
 
I'd agree that an 'If then else' and 'For/while 
next loops' would be very useful - that seems to be turning AFL into a macro 
language and would be useful.
 
Cheers,
 
Geoff 
<BLOCKQUOTE 
>
----- Original Message ----- 
<DIV 
>From: 
Dima 
Rasnitsyn 
To: <A 
href="" 
title=amibroker@xxxxxxxxxxx>amibroker@xxxxxxxxxxx 
Sent: Sunday, January 21, 2001 2:56 
PM
Subject: RE: [amibroker] AFL 
comments


<FONT color=navy face=Arial 
size=2><SPAN 
>Hello 
Tomasz!
<FONT color=navy face=Arial 
size=2><SPAN 
> 
<FONT color=navy face=Arial 
size=2><SPAN 
>Thank 
you very much for your response.
<FONT color=navy face=Arial 
size=2><SPAN 
> 
<FONT color=navy face=Arial 
size=2><SPAN 
>As a 
software engineer (yes, you are right), I would like to ask for three more 
enhancements. I&#8217;m not sure whether they are valuable for the majority of 
AmiBroker customers &#8211; long-term stock investors, but they would be definitely 
beneficial for short-term and commodity traders, especially for those using 
complicated custom indicators and/or trading 
systems.
<FONT color=navy face=Arial 
size=2><SPAN 
> 
<P class=MsoNormal 
><SPAN 
class=EmailStyle18><SPAN 
>1)<FONT 
face="Times New Roman" size=1><SPAN 
>     
<FONT 
color=navy face=Arial size=2><SPAN 
>It 
would be nice if the functions like ref(), valuewhen(), etc. with an argument 
of type CONST will accept a NUMBER, so it will be possible to 
do:
<FONT 
color=navy face=Arial size=2><SPAN 
>N = 
MIN (a, b);
<FONT 
color=navy face=Arial size=2><SPAN 
>prevOpen 
= ref (open, N);
<FONT 
color=navy face=Arial size=2><SPAN 
> 
<P class=MsoNormal 
><SPAN 
class=EmailStyle18><SPAN 
>2)<FONT 
face="Times New Roman" size=1><SPAN 
>     
<FONT 
color=navy face=Arial size=2><SPAN 
><SPAN 
> For/while loops and IF-THEN-ELSE 
constructs would be useful as well. The last would save complicated 
multi-level IIF constructs.
<FONT 
color=navy face=Arial size=2><SPAN 
> 
<P class=MsoNormal 
><SPAN 
class=EmailStyle18><SPAN 
>3)<FONT 
face="Times New Roman" size=1><SPAN 
>     
<FONT 
color=navy face=Arial size=2><SPAN 
>Functions 
(AFL file name where the function is defined), or simple &#8216;include&#8217; 
construction can help to reduce code size and complexity for sophisticated 
custom indicators and/or trading systems.
<FONT color=navy face=Arial 
size=2><SPAN 
> 
<FONT color=navy face=Arial 
size=2><SPAN 
> 
<FONT color=navy face=Arial 
size=2><SPAN 
>As for 
my 47Kb formula, I think about 80% of this code is targeted to workaroundthe 
current limitations of AFL listed in the message #859 (<A 
href="">http://www.egroups.com/message/amibroker/859). 
It&#8217;s my system for trading NYBOT Sugar (I&#8217;ve not tested it onother 
commodities yet), and the indicators showing graphically the account balance 
and results of each trade. BTW, it would be very useful if the automatic 
analysis tool will graph the account value and trade results. 

<FONT color=navy face=Arial 
size=2><SPAN 
>I can 
send this code directly to you if you are curious to see how a mad software 
engineer can write 47K code in 4-th generation scripting language to implement 
a trading system based on 2 simple price formations <SPAN 
class=EmailStyle18><SPAN 
><SPAN 
>J<SPAN 
class=EmailStyle18><SPAN 
>
<FONT color=navy face=Arial 
size=2><SPAN 
> 
<FONT color=navy face=Arial 
size=2><SPAN 
>Thank 
you,
<FONT color=navy face=Arial 
size=2><SPAN 
>Dima
<FONT color=navy face=Arial 
size=2><SPAN 
> 
<FONT color=black face=Tahoma 
size=2><SPAN 
>-----Original 
Message-----From: AmiBroker 
Support [mailto:support@xxxx]<SPAN 
>Sent: Saturday, January 20, 2001 6:05 
AMTo: 
amibroker@xxxxxxxxxxx<SPAN 
>Subject: Re: [amibroker] AFL 
comments
<FONT face="Times NewRoman" 
size=3> 
<FONT color=black 
face="Courier New" size=2><SPAN 
>Hello 
Dima,<SPAN 
>You 
must be a software developer, Dima! Your requests are so 
detailed!I am glad and thankful that you point out all these 
things.> I'd like to request a few minor enhancements 
to AFL interpreter.>> 1) The AFL buffers (in 
Guru Comments, indicator builder, etc.) are> limited to about 
32Kb [AFL code for my trading system is currently 47K].> Once 
AFL code is larger, it becomes impossible to edit it in the window 
(but> still possible to load file). It'd be great if you can 
make this buffer> *unlimited*Wow! 47K formula 
- that sounds truly interesting. Maybe you will uncover some 
secretsabout this one?As for the limit I can 
enlarge it easily to 64K but then limitation of Windows 
95/98comes up:"Windows 95 implements some window 
management features in 16 bits. The use of 16 bits imposes some restrictions 
on parameters infunctions and messages and places limits on 
internal storage. In some cases, Windows 95 provides features that can beused 
to avoidthese restrictions and limitations. For example, the 
standard edit control is limited to somewhat less than 64 kilobytes (K) 
oftext" - taken from Microsoft Developer 
NetworkThere are of course no such limitations on Windows 
NT/2000 so this is not an issue for these platforms.Or... I 
can switch to so-called "Rich-edit" controls that do not have such limitation 
(but are slower...)>> 2) Subsequent 
comments are not recognized, i.e. if I have> /*   
comment one */> /* comment two */> 
or> a = b; // comment one> /* comment two 
*/> I get an error message pointing to the leading slash of 
the> second commentThis one should be fixed 
long time ago :-(> 3) result of Boolean (or any other) 
operation including an array which> value is {EMPTY} for 
particular date is {EMPTY}.  I think {EMPTY} should be> 
considered as 0. Example:> sell = exitLongPosition OR 
enterShortPosition;> If my first trade for the time period is 
Long, sell will have> {EMPTY} value until my first short 
trade. 1 in exitLongPosition will be> ignored because of 
{EMPTY} value of enterShortPosition.I guess you are right 
(but for boolean operations only). Why not for all 
operations?Simply because {EMPTY} is used to mark that thereare 
no valid datafor given bar. For example moving average valueis 
NOT available for the first<range> number of bars. So if 
you base your other calculations on the resultsof MA you should 
not include these invalid data. AFL engine detects {EMPTY}values 
and skips them so nested functions/operators work only on valid 
data.Best regards,Tomasz 
Janeczko===============AmiBroker - the comprehensive 
share manager.<A 
href="">http://www.amibroker.com<FONT 
color=black><BR 
><BR 
><FONT 
color=black><SPAN 
>