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

[amibroker] #Include



PureBytes Links

Trading Reference Links

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





YAHOO! GROUPS LINKS