Amibroker Help

mastermind007

Well-Known Member
#21
First issue ,not tried but seems possible.Used to have two instances of Ami's running at the same time a few years back.One for trading equities and the other for commodities both having different databases and different live feeds.

For the second , i always edit and paste a new formula in the existing formula window.This new version gets saved with a different name and I simply rename the title of the AFL again with the old name.

Can try :D
Yes, I do something similar but use little different approach. I re-insert the file I want into the chart, remove and delete the old one and re-save the chart.
 

trash

Well-Known Member
#22
I think I don't really understand how Amibroker manages layouts and workspaces, but my hunch tells me that if I somehow improve my understanding, it will do what I am aiming to do.
Layouts are a complete set of multiple windows open each with different symbol, different display interval, different size, different set of chart sheets.

old picture from AB documention


Layout files have file extension .awl.

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 DB is applied and you save a local layout then it is saved to
C\...\AmiBroker\Data\Layouts

Local layouts are per DB layouts and are saved in layouts subfolder of each DBs main folder (as mentioned above). Those local layouts are only accessible separately for each DB (so they can only be applied and changed if a particular DB is opened). Global layouts are accessible for all DBs.

If you create a new DB then local layout section in Layout window shows just default layout but that one is not saved as local layout yet (as you can see if you go to ‘Layouts’ folder of that applied DB on your hard drive after DB creation. No AWL file to be found there yet). It is still applied the 'Default' one of Global layout section (so if you change global layout ‘Default’ then local layout ‘Default’ will be same one because it is not saved as local one yet in your newly created DB.

In order to make ‘Default’ one a local one you have to right click it and click ‘Save’ (saves with same name then) or ‘Save as’ to save with different name. Another saving option is ‘Save as Default’.

If a layout is saved as local one then any changes of that layout are not influencing local layouts of same or different names in other databases. Those changes just apply to that local layout of the currently opened DB.

In order to activate a layout you simply double-click it in layout window.

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




Perhaps the most unusual thing on how I use Amibroker is that I keep editing and improving upon my AFLs which also includes some renaming
Second most unusual thing I do differently is how I place AFL on a chart, I very strictly do not do any of the following
a) Double click on the AFL from Chart Window
b) Drag and drop the AFL
c) Cut-paste the code

The above conventional approach can creates multiple copies of same code. It also implies that if I want to make any corrections I will have to be repeat it n number of times.
Unless you are very careful, you can have hundreds of files with identical contents but different names. This is one aspect that annoys me.
Every time, I create a chart file, it makes a copy of entire code into the chart file by replacing newlines with its escape sequences. )
a), b) c) don’t create multiple copies of same code if applied from Charts window one time and if applying global layouts. If you edit drag and dropped file being applied in chart pane of global layout then it will be the same one always and for all databases.

But one thing you should be aware of if you close a pane then drag and dropped AFL will disappear also. Drag & dropped AFLs are like temporary files only being present until chart pane is present and not closed by user.

But there are precautions like options like “Ask before closing indicator pane” of Charting tab in Tools-Preferences.



And there is option to save an edited drag & drop file to custom folder as additional security copy so that AFL does not get lost if chart pane is closed but is still there in custom folder (it’s a setting in Editor tab of Tools-Preferences)



For trading, I keep moving from one database to another and this sometimes causes chart files to get closed. )
Chart panes are the same ones for all databases if you apply global layouts! There is no chart pane closed.

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).

If any of the AFL present in chart was improved while the chart was not open, the embedded copy in the chart file becomes a problem. When I next open the chart file, it renames the AFL adding suffix _imported. Before I understood the problem, I did lose some of the more recent code.
We seem to talk about different things here. You seem to talk about chart template now. I’m talking about layouts and AFLs applied in layouts.

That’s why I said in order for someone to be able to follow precisely of what you are doing you have to explain in proper way (which includes proper names like chart template, window layouts (awl extension), AFL formula file, analysis project file(apx extension)) using step by step procedure

1. First do this
2. Do this
3. ….
10. Then you come to this result if you do this
 

mastermind007

Well-Known Member
#23
Wow!!

This is really amazingly detailed reply. Thank you for that

In the earlier post, after I saw your mention of global / local layout, so I checked and realized that it would be the problem.

I had been setting the lay out files but they were not working because I had been setting them at a global level while some old file had been present at the database level that kept taking precedence.

I simply deleted all the layout files and re-created all files as I needed them. Now it works as expected.

Thank you once again!

Very glad that I can now get rid of all .chart files.

Any similar neat tricks to cleanse the .apx file (Automatic Analysis)?

To retain the liberty of changing the source AFL without having to deal with its *_imported copies, I create one single line AFL file that has include statement to my main file and feed that file to automatic analysis to be saved and embedded into the .apx.

It does solve the problem of duplication but it is bit slow and also at times, changes do not get registered immediately.