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

RE: [amibroker] #Include



PureBytes Links

Trading Reference Links

There is a Reports subfolder of Amibroker folder. The Results.rlst file should be in there along with a directory for each backtest.  To show the resports in the report explorer you should click teh down arrow on the Report button in the AA window and then click the Report Explorer button.
 
Aha!   Just realized that you need to have the backtest type in the .Backtest method.
 
 
PortfolioBackTest = 0
IndividualBackTest = 1
OldBackTest = 2
so you'll need to change the .backtest line to .Backtest(0 or whatever)
 
d


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

d,
 
Deleted the lines as recommended.  Script completes successfully.  Yet nothing in the Report Explorer.  I also did a search of the file system since the Report Explorer is looking for a file named "Results.rlst".  It doesn't appear that any file is created/modified as a result of the script running. 
 
Any other ideas?
 
Thanks again,
 
Perry Lentine


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

Just delete the following:
 
          reportname = filename.substr( 0, filename.length - 3 ) + "HTML" ;
           AA.Report( reportname ); // generate report file
      //AA.Report(""); // generate report
and it should be in report explorer.
 
You can also delete the export if you don't need the data.
 
d


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Perry Lentine
Sent: Tuesday, November 15, 2005 8:54 AM
To: amibroker@xxxxxxxxxxxxxxx
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");
 
      
        }
//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