Thanks Mike! I was dealing with the latter case. So your file
operations code looks like it might do the trick.

I will test this out.


--- In [email protected], "Mike" <[EMAIL PROTECTED]> wrote:
>
> You are presumably generating the "stuff" code somewhere, right?
> 
> e.g.
> condition65 = ...stuff;
> condition126 = ...stuff;
> 
> Thus, they are simply suggesting that you additionally generate the 
> population of the array at the same time.
> 
> e.g
> count = 0;
> 
> condition65 = ...stuff;
> good[count++] = 65;
> 
> condition126 = ...stuff;
> good[count++] = 126;
> 
> Now, when constructing your dynamic variable, iterate through the 
> array values something like this (untested):
> 
> index = Optimize("Index", 0, 0, count - 1, 1);
> 
> Buy = VarGet("condition" + good[index]);
> Sell = ...
> 
> If that is not the case, and your conditions are already in the same 
> AFL as your Buy statement, and the DLL just spits out numbers to a 
> file. Then add file operations to populate the good array (untested).
> 
> count = 0;
> fh = fopen("good.txt", "r");  // From DLL, single number per line
> 
> if (fh) { 
>   while(!feof(fh)) { 
>     good[count++] = fgets(fh); // May need to convert to number?
>   } 
> } else { 
>   printf("ERROR: file can not be found (does not exist)"); 
> } 
> 
> index = Optimize("Index", 0, 0, count - 1, 1);
> 
> Buy = VarGet("condition" + good[index]);
> Sell = ...
> 
> Mike
> 
> --- In [email protected], "ozzyapeman" <zoopfree@> wrote:
> >
> > When you say include file, does that only encompass other AFLs? Or
> > could it also include a generic csv file?
> > 
> > If it is only other AFLs, which it appears to be from the online
> > index, then won't I still have to hand set each variable to an 
> array?
> > Or can I just make the file a range of numbers like:
> > 
> > 65      
> > 126     
> > 867     
> > 1023 
> > etc...
> > 
> > Also, the online index says that using include can dramatically slow
> > down AFL, even for a single instance. Is that still the case, or is
> > that based on earlier AmiBroker version performance?
> > 
> > http://www.amibroker.com/guide/afl/afl_view.php?name=%23include
> > 
> > Thanks for any input.
> >
>


Reply via email to