List of open charts

Is it possible to get a list of open charts displayed on AB?
What I mean is: if I have three charts in the main AB wndow displaying APPL, FB and GOOG, is it possible to get this as a list?

Manu thanks,
Polo

There's a feature called Active Files. If you click on the area marked with a yellow arrow, you will see a list of all open charts and analysis windows.

Image 7

1 Like

Many thanks Milosz.
I had noticed that. I was womdering if it was possible to get the same information using AFL, or some other means such as using the OLE object broker (which I have never used)?

If you need that menu, you have way too many (MDI) tabs open.

Instead of opening dozens of tabs (that consume resources), you should utilize super fast switching of symbols in AmiBroker. You can scroll thru watch lists immediately using single chart window.

BTW: the list of Windows (including MDI charts) is available in .... (surprise)... Window menu. And yes it is also available via OLE (Documents collection).

Tomasz,

After 10+ years of using AB, I would hope that I would know that the list of charts is available in the Windows menu. For my own trading platform, I wanted a way to get a list of displayed chart windows in an AFL formula.

Where are the OLE functions documented?. I've seen this documentation webpage:
https://www.amibroker.com/guide/objects.html
Is there a tutorial or coded examples available.?

Many thanks,
Polo

Yes AmiBroker Object Model is correct doc. Examples are within that document.

AB = CreateObject("Broker.Application");
Docs = AB.Documents;

for( i = 0; i < Docs.Count; i++ )
{
   Doc = Docs.Item( i );
   printf("Document %g %s\n", i, Doc.Name );
}
1 Like

Excellent Tomasz.

Great explanation!. It would be nice to add this simple example to the Documents section in the AB Object Model. The Item() method documented there does not explain the return object type. But the Documents object Description does explain it.

All objects use same convention as Microsoft does in their OLE. So PLURAL Documents is a collection of Document objects. In each collection Item() method is the way to get access to items in given collection. It works the same in MS Word, MS Excel, all MS office, see: Excel VBA Collections - Automate Excel (note: the link talks about VBA but it not specific to any particular language, collection is just the way how OLE automation servers allow to access items of same type).

1 Like

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.