Hi Seniors,
I am running on script which provide me output of my logic, but every time when i am running this script AmiBroker "Automatic Analysis" form was opening on over the AmiBroker screen and i have to wait till complete the operation.
Need help from seniors. how and what changes i need to do in script, so i can get my output and without opening Automatic analysis form.
// Exploration_Example.js
// This Java Script file should:
// 1. Load a Database
// 2. Run an exploration on an afl.
// 3. Exports the exploration to a csv file.
// ----------------------------------------------------------------------------
// Create AmiBroker object and get Analysis object
// ----------------------------------------------------------------------------
var AB, AA, i;
AB = new ActiveXObject("Broker.Application");
AA = AB.Analysis;
// ----------------------------------------------------------------------------
// Load Database
// ----------------------------------------------------------------------------
//AB.LoadDatabase("C:\\ValveNet Technologies\\BestRT Pro\\BestRT Pro");
// ----------------------------------------------------------------------------
// Automatic Analysis Input and Export Information
// ----------------------------------------------------------------------------
AFL_Directory = "C:\\Program Files (x86)\\AmiBroker\\"; // Location of AFL
AFL_ExploreFileName = "MyLogic.afl"; // AFL program to get the data to be exported
AFL_ExploreFile = AFL_Directory + AFL_ExploreFileName; // Name of the above program with it's path included
Export_Directory = "C:\\Program Files (x86)\\AmiBroker\\rupee^xn\\" // Location where Exported data will be saved
ExportFileName = "MyLogic.txt"; // Name of export file
ExportFile = Export_Directory + ExportFileName; // Name of above export file with its path included
Settings_Directory = "C:\\AmiBroker\\Settings\\";
SettingsFileName = "SettingsBasic.ABS";
SettingsFile = Settings_Directory + SettingsFileName;
// ----------------------------------------------------------------------------
// Load Reference Ticker into AmiBroker
// ----------------------------------------------------------------------------
//AB.ActiveDocument.Name = "RUT-I"; // Set RUT-I as reference ticker
// ----------------------------------------------------------------------------
// Automatic Analysis - Setup Exploration using info defined above
// ----------------------------------------------------------------------------
AA.LoadSettings( SettingsFile );
AA.LoadFormula( AFL_ExploreFile );
// Use the following to tell Amibroker what to Include/Exclude and what dates to use
//
// "index", "favorite", "market", "group", "sector", "index", "watchlist"
// 0 = include; 1 = exclude
// 0 = all stocks, 1 = current stock, 2 = use filter
// 0 = all quotes, 1 = n last quotes, 2 = n last days, 3 = from-to date
//
// Set Filters
AA.ClearFilters();
//AA.Filter(0,"favorite") = 1; // Try this to load a long ticker which is favorites ^rut
AA.ApplyTo = 2; // 0 = all stocks, 1 = current stock, 2 = use filter
AA.Filter(0,"watchlist") = 01; // 0 = Include; "watchlist" number
// Set Dates
AA.RangeMode = 3; // 0 = all quotes, 1 = n last quotes, 2 = n last days, 3 = from-to date
//AA.RangeN = 5000;
AA.RangeFromDate = "12/20/2018";
AA.RangeToDate = "12/20/2018";
// ----------------------------------------------------------------------------
// Run exploration, export exploration to csv file
// ----------------------------------------------------------------------------
AA.Explore();
AA.Export( ExportFile );
// ----------------------------------------------------------------------------
// Save database (not really needed), Refresh database (also not really needed
// and close AA window when done.
// ----------------------------------------------------------------------------
//AB.SaveDatabase();
AB.RefreshAll();
//AA.ShowWindow(0); // 0 = all stocks, 1 = current stock, 2 = use filter
// ----------------------------------------------------------------------------
Thank you to all.