Hello,
I have a folder with some models and i want to backtest them automatically so i execute this:
APXFolder = "C:\\MYAPXFOLDER"; // MODIFY TO FIT YOUR SETUP
/* WScript.Echo("Batch testing of all AFL files stored in " + AFLFolder ); */
var AB, AA;
var fso, f, f1, fc, s;
var filename;
AB = new ActiveXObject( "Broker.Application" ); // creates AmiBroker object
fso = new ActiveXObject("Scripting.FileSystemObject");
/* Iterate through all files in the folder */
f = fso.GetFolder(APXFolder);
fc = new Enumerator(f.files);
for (; !fc.atEnd(); fc.moveNext())
{
// we need to add empty string to make sure that filename is a string object
filename = "" + fc.item();
try
{
NewA = AB.AnalysisDocs.Open( filename ); // opens previously saved analysis project file
Stock=
// NewA represents the instance of New Analysis document/window
if ( NewA )
{
NewA.AFL(
NewA.Run( 2 ); // start backtest asynchronously
while ( NewA.IsBusy ) WScript.Sleep( 500 ); // check IsBusy every 0.5 second
NewA.Close(); // close new Analysis
}
}
catch ( err )
{
WScript.echo( "Exception: " + err.message ); // display error that may occur
}
}
The problem i have is that it backtests the afl models on just one random Symbol for example PEPSI. But i really don't need PEPSI, i need GOOG.
How can i specify the symbol?
Please advice,
Posted by: dpellon@gmail.com
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (1) |
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
EmoticonEmoticon