Workspace and Database

Hi everybody.

After a computer’s problem, I have reinstalled from scratch Amibroker V.6.20 and created 2 databases (one EOD, one intraday). I observe a behaviour that I have never seen before: everytime I change something in the workspace of a database, it is also changed in the workspace of the other database.
My understanding, as well as my previous experience with Amibroker, was that each database has its proper workspace.
What should I do to have independant workspaces?

N.B. Preference/Miscellaneous are set to “Autosave templates and layouts”.

You have applied global layout only. In roder to have independent layouts per database then you have to create local layouts.

Read my below additional information about differences between global and local layouts.

From the manual

Picture from AB documentation


Global layouts are saved to C...\AmiBroker\Layouts folder.

Local layouts are saved to particular DB that is currently applied. I.e. if default AB data base of AB main directory is applied and you save a local layout then it is saved to C...\AmiBroker\Data\Layouts. Layout files have file extension .awl. They are human readable with any text editor. You can copy & paste local layout files from one DB to another DB without problem (AB must be closed before).


Global layouts are accessible from all DBs. So if you do changes in an applied global layout then those changes will be visible in another DB that you would open later and if that same global layout is applied there. So if you apply global layouts then chart panes (and contained AFLs) are the same ones for all databases! If you edit drag&dropped AFL being applied in chart pane of global layout via formula editor then it will be the same one always and for all databases too.

Local layouts are per data base layouts and are saved in layouts sub-folder of each database's main folder (as mentioned above). Those local layouts are only accessible separately within each data base (so they can only be applied and changed if a particular DB is opened).

If you apply local layouts then layouts may differ from one DB to another (well, since they are local ones). Also it means if you drag&drop a formula from Charts window onto chart in an applied local layout then it will not be present in local layout of other data base(s).

In short if a layout is saved as local one then any changes to that applied layout are not influencing other local layouts of same or of different names in other databases. Those changes just apply to that local layout of the currently open DB. Also layouts of same DB and those layouts having different names are not influencing each other in that very same DB.


If you create a new data base then local layout section in "Layouts" window shows just default layout but that one is not yet saved as local layout as you can see if you go to ‘Layouts’ folder of that applied new data base on your hard drive after DB creation (i.e. in C...\AmiBroker\MyNewDatabase\Layouts). No .awl file is to be found there yet. It is still applied the 'Default' one of Global layout section of "Layouts" window (so if you change global layout ‘Default’ then local layout ‘Default’ will still be same one because it is not saved as local one yet in your newly created DB. Again for checking purposes it (the local one) must be present as .awl file on your hard drive in your particular DB's layouts folder. If there is no awl file there yet then your DB has no local layout yet not even a default one). In order to make an initial ‘Default’ local layout in a new DB you have to right click it and click ‘Save’ (saves with same name then, in this case 'Default') or ‘Save as’ to save with different name. Another saving option is ‘Save as Default’. Layout saving options can be applied any time in any data base.


In order to activate a layout (global or local one) you simply double-click it in Layouts window.


If you want or don’t want to auto save layouts (i.e. after closing AB) then you have this option available in tools-preferences-miscellaneous:

9 Likes

Thank you very much for your detailed explanations.
What is puzzling me is that I have not yet created any global layout. I have only the default local layout of each database.

Mate, why don’t you just do what I have written? Maybe you don’t do the easy choice because it is long text? I don’t know.

You have initial state right after first AmiBroker installation. They share layouts (you even confirmed it in first post) since at least one or both DBs do not have local layout available in their DB’s layouts folder (as I have written go to your database folder on your hard drive and there go to Layouts folder. If there is not any awl file in both DBs’ Layouts folder then there is layout sharing active. Just like you said in first post). I mean you just have to follow what is written above. It is been already said there.

So you want a local layout so that both are independent layouts per each DB. That’s what you “said”, right?
So please do both of us a favour and please do what I have written above and right click on “Default” of “Local layouts” (even if it says “Default” already there, as I have written in previous post already) and choose “Save as Default”. Do it in both DBs! Then save databases. Do some different magic stuff of your choice in both DBs and see the actual magic happen. Do they still share layouts afterwards? I guess no.

I mean if you don’t follow what I have written then this thread will become as long as Great Wall of China.

1 Like

Thanks. It is OK now.