In the earlier portion of this book, rather loose reference was made to databases, layouts, windows, charts, panes, drawing objects, and so forth. To fully understand AmiBroker, it is necessary to understand the structure into which these components fit.
• The top level component is a Layout.
• Each Layout is associated with a single Database when that layout is active.
• Each Layout consists of one or more Windows.
• Each Window has data for one Symbol.
• Each Window displays with one Periodicity.
• Each Window contains one or more Sheets.
• Each Sheet contains one or more Panes.
• Each Pane contains one or more Chart, Formula, or Tool.
You can have as many layouts as you wish. But only one layout can be active (open) at a time.
107
Layouts can be local or global. Local layouts are associated only with a specific database. Each local layout is stored in the database directory it is associated with, in the file named broker.workspace. Global layouts can be used with more than one database. Global layouts are stored in the AmiBroker\Layouts subdirectory.
WINDOW LAYOUTS
A window layout (that is, an AmiBroker window layout) is a complete set of one or more windows. Each window displays data for its own symbol, has its own display interval, its own size on the monitor, its own set of charts, its own panes, and its own charts and formulas.
The image below shows a 2-window layout. Each window has a differ-ent stock and a differdiffer-ent set of indicator panes.
•wtgg
gite Edit yiew insert Format Symbol Analysis Iools window Help
ם a s o 8 mJ: - • 0 ׳ o a . - 6 ,־v • ״. & \ v • / / o . Layouts ••> X sS AA (Daily) X ־CM (Ddilyi
?8.67180 XOM - Daily 4/7/2008 Open 89 32. Hi 89 95, Lo 88 69, Close 88 92 (0 2%) Vol 19.586,200 MA(Ciose,15) = 86 57, Mid MA(C:lose,45) = 86 04,
"Jul 1Jun 1May 'February 1March ,April
׳2008
, /1" " י
א 1 ו /־
LV v H a A
A
XOM - RSI( 15) = 57 37 .
' ׳ I
D08 ,February ,March ,April ,May TJun
V | ! \ / יי•' »;et ? ^ Sheet 3 ^ Sheet 4 ^ Sheet_ S l ^ t 6 S i ^ e e t 7 ^ She^ 8 y • s -1
NYSE, Common Stocks, Materials, Mrwng-N •<׳ QPEnd of Day Opens currently selected window layout
You can have an unlimited number of single or multiple-window lay-outs. Each can be a custom set up; they do not need to share anything.
Switch between them by double clicking on the layout's name in the layouts tab.
The active layout can be automatically saved whenever the database is switched or AmiBroker is exited. To set this, use the Tools menu >
Pref-erences > Miscellaneous. In the Auto-save area, Check the Layouts box.
Information saved in layouts include: window sizes and positions, bar interval, symbol, chart sheets, panes, charts, formulas.
Preferences
Charting Colors Editor Date Intraday Miscellaneous Alerts AFL ;; Currencies Display options
PI Price data tooltips Data tip auto-hide timeout (sec): ! 5 j f~1 Show interpretation in tooltips
I | Add full n a m e to ticker in ticker box f | Add full n a m e to ticker in tree
@ Full-name tooltips in symbol tree [ | Display chart timing (advanced)
T h o u s a n d separator: Auto-tile multiple chart windows Q
Ask to s a v e c h a n g e d d a t a Additional settings
• No minimum size for resizing dialogs fH Display plugin activity I | Case-sensitive ticker symbols When non-existing symbol is typed-in
@ T e m p l a t e s 0 Layouts Auto-save
P I Preferences
Apply
You can switch between multiple windows (within a layout) using ei-ther the Window menu and selecting the desired window from the list at the bottom of the menu, or using the new MDI tabs.
Help
QQ.QQ. - POWERSHARES QQQ TRUST-UNIT SER 1 - Daily
To begin with, a single window layout will probably be sufficient. You will need a multi-window layout if you want to :
• Display charts for more than one ticker symbol
• Display charts of different periodicity
• Display charts showing different range of bars.
While not necessary, you may want a multi-window layout in order to be able to float a window and move it to a second monitor.
Most of the concepts and techniques that are described in the pages that follow are applied to the active pane and are independent of the layout structure.
Sheet Sheet Sheet
1 2 N
| Pane 1 | | Pane 1 | Pane 1 |
| Pane 2 \ | Pane 2 | Pane 2 | 1 Pane 3 1 | Pane 3 | Pane 3 |
| Pane N | | Pane N | | Pane N |
Sheet
1 Sheet 2
Sheet N
1 1 1
Pane 1 | Pane 1 | Pane 1 Pane 2 | Pane 2 | Pane 2 Pane 3 | Pane 3 | Pane 3 |
Pane IM | Pane N | Pane N |
BLOCK DIAGRAM
On the left is a block diagram view of layouts, their components, and their relationship to databases.
One layout is shown. You can have as many layouts as you want. Only one layout can be open and active at a time. To make another active:
• Save the current database
• Open the new database
• Select the layout you want to use
Everything shown on the block diagram will change to reflect the new layout / database combination - all windows, sheets, panes, tools, watchlists.
To reiterate:
• The top level component of the AmiBroker structure is the layout.
• Each layout can be associated with any number of databases (there is no limit). Only one database is open and active when a layout is active.
• Some layouts ־ local layouts - are associated with only one da-tabase. Other layouts - global layouts - are associated with two or more databases, but only one at a time.
• Each layout consists of one or more windows. Only one win-dow can be active at a time. All of the winwin-dows associated with the layout are listed in the windows menu. If you choose a multi-window layout, all the windows will be visible; other-wise only the active window is visible. You can change back and forth from window to window as you wish.
• Each window displays data for one symbol at a time.
• Each window displays data in one time frame at a time.
• Each window contains one or more sheets (there is no limit).
Only one sheet can be active at a time. To make another sheet active, click its tab. All sheets display the same range of dates.
• Each sheet contains one or more panes (there is no limit).
• Each pane contains one or more displays of price data, manu-ally applied tools, or formulas. Only one pane can be active at a time. To make another pane active, click anywhere in it.