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

Re: [amibroker] #Include



PureBytes Links

Trading Reference Links

Thanks Perry.  Got the file Friday morning but haven't fired it up yet. Will need a little set up.
I've got 2 gig on this desktop but will have to cast around and check out manually
multiple AFLs to run thru this and see if it stalls.
 
Joe
 
----- Original Message -----
Sent: Thursday, November 17, 2005 11:50 PM
Subject: RE: [amibroker] #Include

Joe,
 
Zip file is attached.  This is basically the BatchTest.js file TJ setup from AB help.  I only made slight modifications to the file path and added a few comments for myself.
 
It really works slick.  The only problem I have is that it will not run through all of the .afl files in the directory.  It stops after about 10-15 files/systems, in different spots, randomly.  I believe it may be a memory constraint I have on this older machine I have.  Otherwise, this is a great tool. 
 
Best of luck,
 
Perry Lentine


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Joe Landry
Sent: Thursday, November 17, 2005 3:54 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] #Include

Perry - Would you resend the complete script zipped or with an extension other than
JS?  My OE mail client strips anything that it thinks is executable..dot exe, js, vbs, etc.
Thanks
JOE
----- Original Message -----
Sent: Tuesday, November 15, 2005 7:53 AM
Subject: RE: [amibroker] #Include

d,
 
 
I have also attached my version of the complete script.  Thanks for commenting.
 
Perry Lentine
 
//Snip
 
if( AA.LoadFormula( filename ) )
        {
          AA.Backtest();
      AA.Export("D:\\temp\\testAFLScript.csv");
 
          reportname = filename.substr( 0, filename.length - 3 ) + "HTML" ;
           AA.Report( reportname ); // generate report file
      //AA.Report(""); // generate report
      
        }
//Snip
 


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of dingo
Sent: Tuesday, November 15, 2005 12:15 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: RE: [amibroker] #Include

post the part of the code that does the .backtest and if I remember correctly there is a .Report in there - yes? If so post it too.  We need to lose that one and check the .Backtest
 
d


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Perry Lentine
Sent: Tuesday, November 15, 2005 12:24 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] #Include

Is there any way to have the results (output) of BatchTest.js directed to AmiBroker's Report Explorer rather than an .HTML format? 
 
I am trying to compare the output of the various AFL systems that run through the batch.  It would be easier to do if the output of BatchTest.js could be added to the Report Explorer or some other tabular format.
 
I even attempted to put an Export statement into the script.  I ended up with the details, not a summary, of only the last .AFL file that is run through the batch.
 
Any comments or suggestions would be appreciated.
 
Perry Lentine


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Tomasz Janeczko
Sent: Monday, November 14, 2005 6:44 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] #Include

Hello,
 
#include is not regular function. It is pre-processor command that is executed ONCE before any execution takes place.
This is so for speed because including at execution stage over and over again will slow down the execution significantly.
It works the same way as C language pre-processor.
 
Instead I suggest using OLE automation to backtest all variants. Batch backtesting is described in the User's Guide:
 
There is a BatchTest.js script file that will automatically run backtest ON EACH file stored in selected directory.
So simply put all files you want to test in one separate directory, adjust this line in the script
AFLFolder = "C:\\Program Files\\AmiBroker\\AFL"; // MODIFY TO FIT YOUR SETUP
and double click BatchTest.js (the file with the script) - that way you will launch Windows Scripting host
that will run the script that executes all backtests.
 
Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
Sent: Monday, November 14, 2005 10:37 AM
Subject: [amibroker] #Include

Hello,

I posted this question in boards, but did not get an answer. Could someone give any ideas, please:

-------------------------------
I am trying to user Optimizer to test 100.000 formations stored in separate .afl files. I want to use  #include in something like this:

i = Optimize ("i", 1, 1, 10000, 1);
FileName = "MyFile" + i + ".afl";
#include Filename;

However, this does not work, as apparantely you cannot pas a string as a file name to #include preproccessor.

-------------------------------
I am trying to overcome this by hardcoding #Includes:

inc = Optimize ("include file", 1, 1, 100, 1);

if (inc == 1) {#include "file1.afl"}
if (inc == 2) {#include "file2.afl"}
if (inc == 3) {#include "file3.afl"}
...
if (inc == 100) {#include "file100.afl"}

However, here is another problem I discovered. #Include cashes ALL FILES on EACH optimization. That means, no matter what #include it will use, it still cashes all files. In my case it takes 10 seconds, to put all files into cache, when I need only one, and then onlyu 0.2 seconds to execute! This 10 seconds is a  huge loss in performance, and it is not neccesary.

---------------------------------
Finally, I found a very clumsy workaround, but it is very unreliable and slow (uses hard disc reads/writes):

1. I use fgets and fputs to write "include.afl" file.
2. The file is included using #include "include.afl"
3. The include.afl file is overwritten by the new formations from other files using fgets/fputs.

I would like to ask, if anyone had the same issues? What would you suggest to overcome this?

Many thanks in advance,
B.






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





SPONSORED LINKS
Investment management software Real estate investment software Investment property software
Software support Real estate investment analysis software Investment software


YAHOO! GROUPS LINKS