|
Or use OLE
- AB = new ActiveXObject( "Broker.Application" ); // creates AmiBroker object
- try
- {
- NewA = AB.AnalysisDocs.Open( "C:\\Program Files\\AmiBroker\\APX\\Test.apx" ); // opens given analysis project file
- // NewA represents the instance of New Analysis document/window
- if ( NewA )
- {
- NewA.Run( 4 ); // starts analysis (asynchronous - returns immediatelly
- // (0-scan, 1- exploration, 2- portfolio backtest, 3- Individual Backtest, 4- optimization, 5- Individual Optimization (not supported yet), 6-walk forward)
- while ( NewA.IsBusy ) WScript.Sleep( 500 ); // wait for completion
- NewA.Export( "test.html" ); // exporting results
- WScript.echo( "Completed" );
- NewA.Close(); // closing analysis window
- }
- }
- catch ( exc )
- {
- WScript.echo( "Exception: " + exc.message ); // display error that may occur
- }
複製代碼 |
|