I have multiple Analysis windows and multiple Chart Templates with multple Chart Spreadsheets. I know the capability of explorer result´s list to "sync on chart" with the last open chart. I also use the "Symbol Link" tool to expand this connection.
My question is this: IS IT POSSIBLE TO TELL AMIBROKER TO OPEN A SPECIFIC CHART SPREADSHEET WHEN SELECTING SYMBOLS FROM A SPECIFIC ANALYIS WINDOW?
It would be synchronizing with the desired spreadsheet in a chart template, which is not necesarily the last opened chart. I think it is not possible, but I want confirmation from the experts.
It opens last ACTIVE chart window. You can change ActiveDocument via OLE http://www.amibroker.com/guide/objects.html
So in theory you could place in your code OLE calls that change active chart window when Analysis is run to something of your choice.
Since I am analphabet in .js, I would like to ask you a question to start working in it or not.
The question is if it would be possible to write a .js that tells Amibroker to:
1.check which Analysis Window is opened and ACTIVE,
2. move to the activate the next sequential Analyisis window (assuming there are several analysis windows which are not floating)
3. Activate a specific chart which is in the layout but it is not active.
The idea of Batch is not what I need. I use a .js for running several explorations, and I use the code that I found in the Tomasz documentation as an example:
AB = new ActiveXObject( "Broker.Application" ); // creates AmiBroker object
NewA = AB.AnalysisDocs.Open( "C:\\Program Files\\Amibroker\\Formulas\\Custom\\batch\\1F-Sec.C.1.apx" );
if ( NewA )
NewA.Run( 1 ); // start exploration asynchronously
while ( NewA.IsBusy ) WScript.Sleep( 2000 );
..... This code for several .apx.
So what I have is several Analysis alrady runned. I am not interested in neither opening or running again the Analysis projects. I just want to know how to associate an already opened and runned analysis project with a specific chart that is not opened at this moment.
I have been trying to study the documentation that Tomasz signaled about OLE , and I think that it may be related with
AnalysisDocs and ITEM
, but I have no capacity to program it.
I have tried with things like
oAB = new ActiveXObject("Broker.Application");
NewC = oAB.AnalysisDocs.Count; // get total analysis windows
NewA = oAB.AnalysisDocs.Item(0); // 1st analysis starts with 0
Finally, for the chart that I want to activate, I guess that it would be something similar to this
What a shame on me! You are absolutely right, Cougar. I was trying to get to what I need by a extravagant OLE automation, when I just need to change the Layout to activate the chart that I want. Now I understand why Analyisis windows do not belong to layouts. I think I do not even need the code you kindly wrote for it. Sorry for taking your time, I just want to remind everyone that Amibroker is universal... even for the programming illiterate... Cheers and Thanks