Herman,
I haven't tested it extensively, but I think it could work and is
worth a try.
At the present, you are able to write backtest, or scan in afl
already because of afl support for OLE. for example
The following afl will run backtest
ab = createobject("Broker.Application");
aa = aa.analysis();
aa.backtest();
The thing that you cant do is to call backtest from with AA/AFL.
However, there exist this possibility.
Instead of running Jscript controlling AFL running in AA. Using AFL
in Guru Commentary to control AA. It might be possible change your
handshake between JS <-> AFL to Guru AFL <-> AA AFL. Of course you
can pass info between them using StaticVarSet/StaticVarGet. From my
very limited experimentation, It seems to work OK. Give that a try.
Of course functions like RunBackKtester, Run Exploration, Run Scan
can be easily coded with a few lines of AFL.
for example
function RunExplore(AFLfilestring, StartDateString, EndDateString)
{
aa.RangeMode = 3;
aa.RangeFromDate = StratDateString;
aa.RangeToDate = EndDateString;
aa.LoadFormula(AFLfilestring);
aa.Explore();
}
To call the function use the afl below:
ab = createobject("Broker.Application");
aa = aa.analysis();
RunExplore("Myfile", "1/1/2006", "1/1/2007");
One advantage over Jscript is that all OLE calls from Guru are
inprocess, in other words, it doesn't go outside AB, allowing you to
run multiple instances of AB. Also it is less likely to encounter
synchronisation issues that you mention earlier.
Hope you have fun.
/Paul.