Lab: Install AmiBroker and Verify Your Setup
By the end of this lab you will have AmiBroker running, you will be able to state your version, edition and bitness from evidence inside the program rather than from memory of what you downloaded, you will know where the three windows this course lives in are, and you will have a written setup record.
That last item is the point of the lab. Everything else takes ten minutes. The record takes five, and it is what stops a lesson in Part 22 from failing for a reason you could have discovered today.
Step 1 — Install
Section titled “Step 1 — Install”Download the setup program from AmiBroker’s download page and run it. The guide’s own instruction is that you can safely accept every default: click Next on each page and Install on the last one. If the installer asks to restart the machine, do it — it is replacing system components.
The default install location is C:\Program Files\AmiBroker, and the documentation calls
this the main AmiBroker directory. That phrase appears repeatedly in later lessons —
it is where the Formulas folder, the Plugins folder, the Formats folder and the
sample data database live — so it is worth knowing where yours actually is if you
changed it.
After installing, start AmiBroker from the Windows Start menu. You will see a splash window, then a pause of a few seconds while the quotation database loads, then the main screen: a toolbar across the top, a workspace pane on the left containing a symbol list, and chart windows filling the rest.
If you already own a licence, install the licensed version from the Members’ Area rather
than applying a key to the demo build — the demo build is not upgraded in place by a
key. Registration for the 32-bit build uses ABReg.exe and for the 64-bit build
ABReg64.exe, and running the wrong one produces no error message whatsoever. If a
licence appears not to have taken, that is the first thing to check.
Step 2 — Confirm what you actually installed
Section titled “Step 2 — Confirm what you actually installed”Three facts, each read from the program rather than assumed.
For the edition, use capability rather than a label. The most reliable single test is the interval list, because the Standard edition has no tick or second bars at all:
A second, complementary check exists once you have a database with data in it: the Real-Time Quote window holds at most 10 symbols on Standard and any number on Professional, and the Time and Sales window is limited to one symbol on Standard. Neither is useful yet, since you have no live feed, but both are worth remembering as confirmations for later.
Step 3 — Find the three windows this course lives in
Section titled “Step 3 — Find the three windows this course lives in”Almost everything in the remaining thirty-four parts happens in one of three places. Open each one now, so that when a lesson says “in the Analysis window”, you do not have to go looking.
The Formula Editor — Analysis -> Formula Editor. This is where AFL is written,
checked and saved. Note two things about its toolbar, because the naming trips people up:
the button is labelled Check syntax, while the equivalent menu item is
Tools -> Verify syntax. Same action, two names. There is also a Formula Name edit
field on the toolbar: type a name there and press Save to store the formula under it. The
Apply indicator button puts the formula on the current chart.
The Analysis window — Analysis -> New Analysis, or File -> New -> New Analysis,
or the New Tab button in an existing Analysis window. This is where scans, explorations,
backtests and optimizations run. Its three most important controls are the Apply to
combo (All symbols, Current symbol, or Filter), the Range combo (All quotations,
N recent bars, N recent days, or a From-To date pair), and the Settings button.
Multiple Analysis windows may be open and running at once.
Preferences — Tools -> Preferences. Global program settings, arranged in tabs:
Charting, Color, Editor, Data, Intraday, Miscellaneous, Alerts, AFL, Debugger and
Currencies, plus an AI tab in version 7.00. You are not changing anything here yet, but
two of its behaviours matter later and are worth reading now.
Two further panes are worth opening once so you recognise them: Window -> Symbols, the
symbol tree with the category system in it, and Window -> Charts, the tree of chart
formulas. Both are covered properly in the next lesson.
Step 4 — Run the setup report
Section titled “Step 4 — Run the setup report”You have read three facts out of dialog boxes. Now produce them as data, alongside something the dialogs cannot tell you: what is actually inside the database that is currently open. How many symbols, how many bars each, over what date range. This is the first AFL you will run in the course, and its job is to describe your environment rather than to say anything about markets.
The formula
Section titled “The formula”Complete runnable AFL
// ===========================================================================// Setup report// One row per symbol describing what this installation and this database// actually hold. Written for the "Install AmiBroker and Verify Your Setup"// lab in Part 3 of the AmiBroker technical analysis course.//// HOW TO RUN// Analysis -> Formula Editor, paste, save, press the Analysis button.// In the Analysis window set Apply to = All symbols and// Range = All quotations, then press Explore.//// ASSUMPTIONS, STATED SO THEY CAN BE CHECKED// - The formula only reads. It writes nothing to the database.// - Interval() reports the interval of THIS analysis run, not the// database's base time interval. Change the Analysis window interval// and run it again if you want to see a different periodicity.// - "First bar" is the first bar inside the selected Range, which is only// the first bar ever stored if Range = All quotations.// - Version() returns the running AmiBroker version as a number, so 7.00.1// is reported as 7 rather than as a three-part version string. Read the// full build number from Help -> About instead.// ===========================================================================
// One row per symbol: report on the last bar the analysis range contains.Filter = Status( "lastbarinrange" );
// Replace the automatic Ticker and Date/Time columns with explicit ones, so an// exported CSV explains itself without the reader needing this formula.SetOption( "NoDefaultColumns", True );
BarsInRange = Cum( 1 ); // 1 on the first barFirstBarDate = ValueWhen( BarsInRange == 1, DateTime() );
// Calendar span, not trading days: DaysSince1900 counts every day, so the// difference is real elapsed time rather than a bar count.FirstDayNumber = ValueWhen( BarsInRange == 1, DaysSince1900() );CalendarYears = ( DaysSince1900() - FirstDayNumber ) / 365.25;
AddTextColumn( Name(), "Symbol", 1.0, colorDefault, colorDefault, 80 );AddTextColumn( FullName(), "Full name", 1.0, colorDefault, colorDefault, 200 );AddTextColumn( Interval( 2 ), "Interval", 1.0, colorDefault, colorDefault, 90 );AddColumn( Version(), "AmiBroker", 1.2 );AddColumn( BarsInRange, "Bars", 1.0 );AddColumn( FirstBarDate, "First bar", formatDateTime );AddColumn( DateTime(), "Last bar", formatDateTime );AddColumn( CalendarYears, "Calendar years", 1.1 );
// Sort by bar count ascending so the thinnest histories - the ones most likely// to break a study later - come to the top of the list rather than hide at the// bottom of a long table.SetSortColumns( 5 );How it works
Section titled “How it works”The formula has four logical sections.
The filter decides which bars produce a row. Filter = Status("lastbarinrange")
evaluates to true on exactly one bar per symbol — the last one inside the range you
selected — so the exploration produces one row per symbol rather than one row per bar.
Without it, running over the sample database would emit tens of thousands of rows.
SetOption("NoDefaultColumns", True) turns off the automatic Ticker and Date/Time
columns. Every column in the output is then one you asked for, which matters when the
result is exported to CSV and read by someone who does not have the formula.
Two derived quantities are computed before any column is added. Cum(1) is a running
count of bars, so it equals 1 on the first bar and the total bar count on the last one.
ValueWhen(BarsInRange == 1, DateTime()) carries the first bar’s date forward to every
subsequent bar, which is how a value from the start of the history becomes readable at
the end of it. The calendar span uses DaysSince1900() rather than the bar count,
because bars are trading days and the question “how much history is this” is a calendar
question.
The columns are added in reading order, and the sort is deliberate.
SetSortColumns(5) sorts ascending by the fifth column, the bar count, so the symbols
with the least history appear first. Thin histories are what break studies later, and a
report that hides them at the bottom of a long table is a report you will not read.
Key functions
Section titled “Key functions”| Function | What it gives you |
|---|---|
Version() |
The running AmiBroker version as a number, so 7.00.1 reads as 7 |
Interval(2) |
The name of the current analysis interval, as a string |
Status("lastbarinrange") |
1 on the last bar of the selected range, 0 elsewhere |
Cum(1) |
A running bar count, starting at 1 |
ValueWhen(condition, array) |
The value the array had at the most recent bar where the condition was true |
DaysSince1900() |
Calendar days elapsed, so date arithmetic ignores weekends and holidays |
SetSortColumns(n) |
Sorts the result by column n; a negative number sorts descending |
Expected result
Section titled “Expected result”Run it as an Exploration with Apply to = All symbols and Range = All quotations.
Test it
Section titled “Test it”A report you cannot falsify is not evidence. Two checks:
- Change the Range to
1 recent bar(s)and re-run. Every bar count should collapse to 1 and every first-bar date should equal the last-bar date. If it does not, the filter is not doing what you think it is. - Change the Analysis window’s interval to Weekly and re-run at All quotations. The interval column should read “Weekly” and every bar count should drop to roughly a fifth of the daily figure. This proves that the interval column reports the run rather than the database, which is the formula’s most important limitation.
Common errors
Section titled “Common errors”| Symptom | Cause |
|---|---|
| Thousands of rows instead of one per symbol | The Filter line was edited or removed |
| Only one row appears | Apply to is set to Current symbol rather than All symbols |
| The interval column says “Daily” on an intraday database | Correct behaviour: it reports the analysis interval, not the base interval |
| Calendar years looks far too small | Range is not set to All quotations |
| Empty result, no error | The database has no symbols, or the range excludes all data |
Extension
Section titled “Extension”Add a column that flags symbols whose last bar is not the same as the newest last bar in
the database — the ones that quietly stopped updating. You have everything you need:
DateTime() on the filtered bar is that symbol’s last bar, and comparing it against the
date you expect is a subtraction. That check becomes a lesson of its own in Part 12.
Step 5 — Record your capability level
Section titled “Step 5 — Record your capability level”This course uses three labels for what a setup can do. They are the course’s own shorthand, not AmiBroker terminology, and they exist so that lessons can say “Level A path” without restating the whole matrix each time.
| Level | What you have | What it unlocks |
|---|---|---|
| A | Any edition, end-of-day data only, free sources | Parts 1–16 and 27–36 in full; the Level A path through Parts 17–26 |
| B | Any edition plus an intraday feed at one-minute grain or above | Everything in A, plus Parts 19–26 worked at one-minute bars |
| C | Professional plus a real-time streaming feed | Everything in B, plus tick and second intervals, GetRTData(), unlimited streaming symbols, wait-for-backfill, MAE/MFE charts, and up to 32 analysis threads |
Level A is the default and is entirely sufficient. The course is designed so that it can be completed end to end at Level A, and the two labs in this part are Level A work. If you are at Level A, say so in your record and stop worrying about it.
Step 6 — Write the setup record
Section titled “Step 6 — Write the setup record”Copy this into a text file and fill it in. Keep it somewhere you will find it: alongside your database folder is a good choice.
AMIBROKER SETUP RECORDDate recorded: .......................................Version (Help -> About): .......................................32-bit or 64-bit: .......................................Edition (or "trial"): .......................................Main AmiBroker directory: .......................................Windows version: .......................................RAM: .......................................
Course capability level: A / B / CData source in use: .......................................Databases on this machine: 1. path ................................ base interval ......... 2. path ................................ base interval .........
Preferences changed from default: - AFL tab: Stop parsing on first error = OFF - AFL tab: Catch system exceptions = ON - ...........................................................Verification checklist
Section titled “Verification checklist”What you should be able to do before moving on
- State your version and bitnessRead from Help -> About, not from the installer filename
- Justify your edition claimFrom a capability test, not from a label
- Open the Formula Editor, the Analysis window and PreferencesBy menu path, without hunting
- Run an exploration and read its outputThe setup report returns one row per symbol
- Produce your setup recordWritten down, saved, findable
Work through it item by item. Everything below is a yes/no question with an answer you can point at.
- AmiBroker starts and shows the sample DJIA database with charts drawn.
-
Help -> Aboutreports a version number, and states 32-bit or 64-bit. - You have run the interval test and formed a view on your edition, with the end-of-day-database caveat understood.
-
Analysis -> Formula Editoropens, and you can find the Formula Name field and the Check syntax button on its toolbar. -
Analysis -> New Analysisopens, and you can find Apply to, Range and Settings. -
Tools -> Preferencesopens, andStop parsing on first erroris now off whileCatch system exceptions in Indicators and commentariesis on. - The setup report runs and returns one row per symbol, sorted ascending by bar count.
- Both of the setup report’s tests behave as described.
- Your setup record file exists, is filled in as far as it can be, and you know where it is.
If any item fails, fix it now rather than continuing. Every one of them is a dependency of something later.
What changed in your understanding
Section titled “What changed in your understanding”You have moved from “I downloaded AmiBroker” to a set of statements about your installation that you could defend with evidence from inside the program. You have run AFL for the first time, in the mode that this course uses most — an exploration producing one row per symbol — and you have seen that a formula’s output depends on the Analysis window’s settings as much as on the code. You have a written record that later parts will refer back to.
You have also met the distinction that dominates the next lesson without it being named yet: the difference between a property of your installation and a property of your database. The greyed-out intraday menu is not a limitation of the program you installed. It is a consequence of a choice made when a database was created.
Check your understanding
Sources for this lesson
9 verified · checked 2026-08-31
- 01AmiBroker User's Guide — Getting startedamibroker.com/guide/start.html2026-08-31
- 02AmiBroker User's Guide — About AmiBroker Editionsamibroker.com/guide/versions.html2026-08-31
- 03AmiBroker Knowledge Base — Differences between 32-bit and 64-bit versionamibroker.com/kb/2016/02/20/differences-between-32-bit-and-64-bit-version2026-08-31
- 04AmiBroker User's Guide — AFL Formula Editoramibroker.com/guide/w_afledit.html2026-08-31
- 05AmiBroker User's Guide — New Analysis windowamibroker.com/guide/h_newanalysis.html2026-08-31
- 06AmiBroker User's Guide — Preferencesamibroker.com/guide/w_preferences.html2026-08-31
- 07AmiBroker AFL Function Reference — Versionamibroker.com/guide/afl/version.html2026-08-31
- 08AmiBroker AFL Function Reference — Statusamibroker.com/guide/afl/status.html2026-08-31
- 09AmiBroker AFL Function Reference — Intervalamibroker.com/guide/afl/interval.html2026-08-31
Every technical claim on this page was checked against the official AmiBroker documentation on the date shown. Where the course disagrees with folklore, the source is how you can tell which one to trust.