What's new in the latest version?
Highlights of version 7.00
This cycle of releases introduces a groundbreaking AI-powered feature, significant
enhancements to the user interface including a dark mode expansion, and a
host of new capabilities for AFL scripting and analysis. This release cycle
demonstrates a focus on both innovative features with the AI Code Assistant
and continuous improvement
in user
experience, scripting power, and data handling flexibility.
Major New Features & Enhancements:
- Brand-new AFL Code
Assistant integrated in AFL Editor powered by Artificial Intelligence
LLM
Remember our 2007 AFL Code Wizard? Cute, right?
Get ready for the real deal.
Now AmiBroker 7 features a brand-new, complete AI-driven
AFL Code Assistant!
It's a developer, an analyst, and a debugger, all in one.
> Writes
code from your English description.
> Explains any formula you give it.
> Analyzes your code's strengths & weaknesses.
> Fixes bugs and errors instantly.
> Suggests improvements.
THE BEST PART? YOU CHOOSE THE AI BRAIN!
Plug in OpenAI, Google Gemini, or even a 100% PRIVATE local AI
running on your own PC.
Your strategies stay YOURS.
- Symbol Tagging for Organization
Users can now assign color-coded tags
to symbols for easier identification and filtering. These tags are
visible in the symbol list and can be managed programmatically via AFL.
- Integrated
Software Updater
A new built-in software updater allows for checking and installing
new AmiBroker versions directly from the Help menu.
- Plot Opacity and Alpha Blending
Introducing
the SetOpacity function, allowing for transparency effects on various plot
styles
including lines, bars, candles, histograms, and areas when using QuickGFX.
- Dark
Mode Expansion
The dark mode introduced in earlier versions has
been extended to more interface elements in version 6.92, including
the Charts (formula) tree, Interpretation window, Symbol list, and more,
for
a consistent viewing experience.
AFL (AmiBroker Formula Language) Advancements:
- New Analysis and Summary Capabilities
The AddSummaryRows function can
now be used in all analysis modes, not just explorations, to add
summary statistics. New constants like asrTotal and asrAverage have
been added
for this purpose.
- Enhanced Category Management
AFL now provides
more robust control over symbol categories and tags, with new functions
to add, remove, and
retrieve symbols based on their assigned tags.
- File Handling
A new thread-safe
function, fappend, allows for safely appending text to a file from
multiple threads simultaneously.
- Date and Time
StrToDateTime now
supports years up to 2037. Additionally, AddColumn supports new
formats to display only the date or only
the time portion of a DateTime value.
- Analysis Control
A new SetOption("MaxEntryRank",
N) allows users to limit the number of entry signals tracked per
bar
in backtests.
User Interface and Usability Improvements:
- AFL Editor Enhancements
A new keyboard shortcut, Ctrl+/,
has been added for line commenting. Users can also now move selected lines
of code
up or down using Alt+UP/DOWN arrow keys. Copying an entire line without
selection is now possible.
- Improved Analysis Workflow
Selecting a trade in
the New Analysis result list can now automatically synchronize the chart,
display
trade arrows,
and mark the trade range for a more intuitive analysis process.
- Batch
Processing
The ExecuteAndWait command in batch operations now allows
for defining a current working directory.
- UI Polish
Numerous smaller improvements
have been made, such as using the default text tool font for new text
objects on charts,
better number
display in the Account window to avoid scientific notation,
and improved list view copy functionality.
- Data Handling
Flexible N-Second Intervals: N-second intervals no longer need
to be aligned to a full minute, and time compression now supports
second
intervals that are not divisors of 60.
Highlights of version 6.90
- AFL editor improvements
- Multi-cursor Navigation: Enhanced editing with multi-cursor support,
multiple selection editing, and split window editing.
- Information tooltips, showing description
and parameters of each function as you type them.
- Inline "profiler/checker" messages: Added to show which lines/functions
cause look-into-the-future issues.
- better HiDPI scaling
- Synthetic Data for Debugging: When a symbol has no quotes, synthetic
data is created to allow code verification and debugging.
- When errors are detected, an "Explain" button is added to the caption
bar that displays a help page with the error explanation.
- ChatGPT Code Detection: Added a notice to detect and inform users about
potentially invalid ChatGPT-generated code.
- UI Improvements: Fixed typo in auto-complete dropdown, fold margin
width scales with font/DPI, and watch window displays small arrays entirely.
- New Web Research browser
- Brand-new, standard-compliant Chromium / Edge (WebView2) browser is
now available as an alternative to the old browser.
To use the new web browser engine within AmiBroker, you have to use 64-bit
AmiBroker and do the following:
1. Download x64 WebView2 component from Microsoft
https://developer.microsoft.com/en-us/microsoft-edge/webview2/
2. In AmiBroker go to Tools->Preferences, "Miscellaneous" tab
and turn ON the option "Use Chromium/Edge (WebView2) for Web Research"
3. Restart AmiBroker
- AFL new features and improvements
- added support for maps / dictionaries (key-value pairs) - MapCreate
function
- added support for C++ raw strings and Python-style raw strings
- added AddToComposite automatic normalization via atcFlagNormalize
- added TrimResultRows function
- added SparseInterpolate function
- added GetOption("BHSymbol")
- enhanced Nz, SafeDivide, Matrix, StaticVarInfo, SumSince
- added static variable declarations with custom initial value (instead
of Null)
- stricter checking of printf/StrFormat formatting string
- one-shot auto save of persistent static variables via SetOption("StaticVarAutoSave",
-1 )
- Matrix Initialization: New parameter increment allows creation of matrices
with monotonically increasing elements.
- Memory and Performance Enhancements: Increased micro-allocator block
size to 64 bytes and improved handling of static variables.
- Error Handling: New error codes, stricter checking for format strings,
and enhanced warnings for invalid characters.
- Gui Control Functions*: Added extra 'style' parameter for all Gui*
functions.
- Charting improvements / new features
- Text tool allows specifying font style / size.
- increased limit of minimum X grid spacing for HiDPI displays
- lots of QuickGFX fixes, improvements and speed-ups
- Analysis window improvements / new features
- added information on when equity gained from interest is greater than
from trades alone
- added information on how many times liquidity limit was hit
- added support for "Show current trade arrows" after exploration run
- New Analysis Info: Summary of symbols with filtered-out quotes due
to padding displayed in the INFO tab.
- Individual Optimization: Fixed crashes and sharing violations when
GenerateReports was turned on.
- Timestamp Resolution: Increased resolution for report folder timestamps
using a unique counter.
- Category Management: Filter dialog shows instructions if no symbols
meet the selected criteria and shows categories with empty names.
- Report Explorer
- Performance Improvements: Re-reads/refreshes
are 10x faster, and the display performance is improved by 20x using
a hyper-fast list view implementation.
- Error Handling: Sharing violation messages are quietly
displayed in the status bar instead of a modal blocking dialog box.
- Database maintenance / data feed improvements
- Edit->Delete range supports multiple symbol selection, so you can delete
a range of quotes from multiple symbols at once.
- IQFeed plugin now has an option to consolidate unbundled ticks and symbol
lookup in the context menu.
- ASCII Import: Improved performance by early removal of duplicate lines
in large files.
- UI improvements
- modal dialog boxes flash and move to the mouse position to prevent
user confusion when a modal dialog box opened on another monitor blocks the
program from continuing.
- High DPI Support: Various UI elements, such as flyout buttons, modal
dialog boxes, property grid expand buttons, and XAML markup units, now
properly scale with High DPI displays.
- added the Start page to improve new-user orientation
- added pause button to Batch scheduler
- Dark Mode Improvements: Enhanced readability of read-only items in
the Account Summary page in dark mode.
- Symbol Bar: Added context menu key support (VK_APPS) in addition to
right-click.
- Category Dialog: Prevents setting category names to empty, reverting
to default name if attempted.
- Other fixes
- Parameter file does not get corrupted when parameters mistakenly use
new lines.
- Indicator Maintenance Wizard: Automatically creates timestamped backup
files for easy restoration.
- Easy Alerts: Now displays comment field content in Alert Output window.
Highlights of version 6.40
Version 6.40 brings lots of new functionality, especially with regards to the
formula language and performance. There are hundreds of new features and changes
to existing functionality as compared to version 6.30, listed in detail in "Release
Notes" document in AmiBroker directory. Below is just a short list of a
few of them:
- QuickGFX - brand-new chart rendering engine delivering
up to 100x performance boost as compared to GDI rendering. GDI rendering speed
also improved up to 2x.
In-house developed QuickGFX direct rendering technology
completely bypasses Windows GDI and offers an amazing 10x-100x performance gain
as compared
to GDI rendering.
To enable QuickGFX experimental technology, go to Tools->Preferences, "Miscellaneous" tab,
click "Experimental: Use QuickGFX render" and press "Apply" or "OK".
You can see that when it is enabled, the chart timing footnote (when enabled) will
say "QuickGFX render ...ms" instead of "GDI render ...ms".
This is a PROFESSIONAL edition feature only. Users of the Standard version would
need to purchase an upgrade in order to use this feature.
- Automatic Analysis improvements
- Easy Sequencing of multiple Analysis actions via
#pragma sequence(scan,exploration) and new "Run Sequence" button
without the need to write batches. Allows, for example, single-click two-step
analysis runs, creating composites or static variables in the first step and
using them in the second step.
- Backtester - added "Max. position value" option in the settings
allowing to specify the maximum dollar value of a position. Zero (0) means
no maximum. Positions larger will be shrunk (if shrinking is enabled)
or won't be entered at all (if shrinking is disabled).
- huge speed-ups in running large explorations,
dark theme, and 5x speed-up for rendering huge list views (as compared to
6.31).
- AmiBroker Formula Language new functions
/ features
- FindIndex( array, value, start_from = 0, dir = 1 ) - finds the index of
an array item matching the specified value.
- BarsSinceCompare( past, comparison, current ) - for every bar, compares
past array values with the current bar value and returns the number of bars
since the last time the comparison was true.
- InternetSetHeaders( "headers" ) - sets custom HTTP headers
for subsequent web requests.
- InternetSetOption( option, value ) - sets an HTTP option for an internet session.
- InternetPostRequest(''http://url_to_your_web_resource'', data, flags
= 0) - sends an HTTP Post request to an Internet web resource (URL).
- MxCopy() - in-place copying of rectangular blocks from one matrix
to the other (copies portions of one matrix to the other matrix).
- _exit() - gracefully ends AFL execution at the point of the call.
- InternetGetStatusCode() - returns the HTTP status code of the last
InternetOpenURL or InternetPostRequest call.
- Chr( code ) returns a string representing a single character of a given ASCII
code.
- GetObject( path, class ) provides functionality equivalent to JScript
GetObject and VBScript GetObject.
- GuiSendKeyEvents("ED") - registers given characters to be
sent as a GUI event when a keyboard key is pressed. GuiGetEvent will return
code == notifyKeyDown and the ID of the given character, for example, id == 'D'
for the 'D' letter.
- inverf(x) - inverse of the erf function.
- erf(x) - computes the Error function https://en.wikipedia.org/wiki/Error_function.
- SafeDivide( x, y, valueifzerodiv ) - safe division that handles division
by zero using special handling (replaces the result with a user-defined value).
- new Javascript engine (Chakra) features native JSON support (EnableScript("chakra")).
- AmiBroker Formula Language improvements, enhancements and fixes
- exponentiation operator is made 50-100x faster in cases of small integer
exponents of 2, 3, 4 and 5.
- GuiSetText() function avoids sending change notifications to
prevent update loops.
- ADX function vectorized (2x faster than before).
- added an extra parameter for Error() function to stop execution.
- internal function signatures have changed to allow flexible ordering
of arguments, regardless of their type, and varargs with less
overhead.
- GfxDrawImage with PNG images: exclusive file lock removed.
- the parser warns if an empty body is used in 'for' or 'while' statements.
- support for gzip and deflate compression in Internet functions.
- plugin interface: backward compatibility with changing function signatures.
- more
runtime checks to prevent user errors and other fixes.
- Batch window new features / improvements
- Clipboard Cut/Copy/Paste implemented in the batch editor.
- Edit->Delete (from main menu) and Edit-Delete All implemented for
completeness.
- list view now uses virtual mode (owner data).
- added "add results to watchlist" action / WatchlistAddResults.
- added "clear watchlist" action / WatchlistClear.
- added "comment" action.
- added optional parameter to Data Import ASCII command to allow specifying
a format definition file.
- added optional parameter to Execute and Wait command to specify the current
working directory for the command.
- added optional parameter to Export to File / Export walk-forward to
file to specify the column separator in CSV files.
- Optional parameter defines the column separator used for export. Only
a single character is used. When it is not supplied, a comma is used.
- AFL editor enhancements
- call tips (parameter information tooltips) now provide an extra description
about the function and its parameters (as of v6.39 only 20 functions
have this extra info).
- A debugging session is automatically terminated with appropriate notice
when the user attempts to edit the code during debugging (this saves mouse
clicks that were needed to stop the debug session in order to edit).
- previously when no text was selected and Prettify Code was chosen,
the message box caused the main frame to get focus instead of the focus staying
in the AFL frame. Fixed.
- when a runtime error is detected during a debugging session, the message bar
now shows the number of detected errors (as it did previously during a normal "verify" run).
- when dark mode list views are used, the watch window's default text color
was black, making it hardly visible; it has been changed to white.
- User Interface new features and improvements:
- Dark theme for all owner-draw
list views (NOT in dialogs) now features a customizable theme (currently
available "system (light) theme" and "black theme")
- go to Tools->Customize, "Appearance" tab, "Dark mode
for list views" checkbox.
- 5x speed-up for rendering huge list views (bypassing Windows rendering).
- Preferences: added a Text Tool font setting independent
from the Axis font (Preferences->Miscellaneous page).
- Charts: improved text tool, with per-study selectable font size.
- Parameter names are not truncated in HighDPI screens.
- Database improvements
- A new 8-digit ICB structure implemented: https://www.ftserussell.com/data/industry-classification-benchmark-icb.
- Database Purify is 10x faster.
- OLE: Added the Stock.Quotations.Adjust function to perform adjustments
programmatically. OLE: Added the Stock.Quotations.Adjust() function: long
Adjust(BSTR pszFieldList, float fMultiplier, float fOffset, DATE dDateTime,
boolean bBefore).
- Other fixes
- Parameter file does not get corrupted when parameters mistakenly use
new lines.
- Indicator Maintenance Wizard: Automatically creates timestamped backup
files for easy restoration.
- Easy Alerts: Now displays comment field content in Alert Output window.
Highlights of version 6.30
Version 6.30 brings lots of new functionality, especially with regards to the
formula language and performance. There are hundreds of new features and changes
to existing functionality as
compared to version 6.20, listed in detail in "Release Notes" document
in AmiBroker directory. Below is just a short list of a few of them:
- Huge performance improvements in 64-bit version with migration
to new VC++2017 compiler
Why did we migrate to a new compiler with the 64-bit version?
- The new compiler supports
new CPU instructions (SSE3/AVX) that we can use to offer better performance.
- According to our tests, the new compiler
produces faster code by itself (better optimizations, auto-vectorization,
etc).
- The new compiler is better with error checking (less bugs to slip through).
- We
don't need to care about compatibility with pre-Vista systems
in the 64-bit version, and all 64-bit capable CPUs are "modern" enough.
Why did we stay with the old compiler in the 32-bit version?
- The new compiler does not
produce code compatible with older operating systems (XP or earlier). The old
compiler offers 100% compatibility
with all Windows versions.
- The new compiler requires modern CPUs.
Exact performance improvement is function-dependent and hardware-dependent.
Many functions are faster by 30-50%, but in some cases, such as Min()/Max()
functions, as large as an 8x speed-up can be observed in the 64-bit version.
- Other key improvements
- Auto-optimization framework
- HTML5 compatibility in Web Research window
- comment folding in the AFL editor
- clickable links in Analysis result list
Highlights of version 6.20
Version 6.20 brings lots of new functionality, especially with regards to system
testing. There are hundreds of new features and changes to existing functionality
as compared to version 6.10, listed in detail in "Release Notes" document
in AmiBroker directory. Below is just a short list of a few of them:
- HIGHLIGHT: Integrated Batch Processor -
allowing you to automate complex, sequential tasks and featuring:
- easy-to-use interface
- built-in time scheduler
- command line interface
- AFL triggering
- logging
- New features in AmiBroker Formula Language:
- Performance improvements
- faster startup
- more responsive Analysis window while it is busy processing (plus new
Pause function)
- UI and usability improvements
- many adjustments in UI scaling to better support HiDPI/4K displays
- walk-forward settings are now per-project, not global
- debugger's watch window supports the display of static variables and expressions
with static variables
Highlights of version 6.10
Version 6.10 brings lots of new functionality, especially with regards to system
testing. There are hundreds of new features and changes to existing functionality
as compared to version 6.00, listed in detail in "Release Notes" document
in AmiBroker directory. Below is just a short list of a few of them:
- HIGHLIGHT: Integrated Visual Debugger -
featuring
- single-step execution
- breakpoints
- user-definable watches with expression
evaluator
- array view with per-item change highlighting
- value inspection tooltips
- output window (for printf output)
- HIGHLIGHT: Enhanced Matrix support
- New features in the AFL Editor:
- Bookmarks
- Find in Files
- Block comment/uncomment
- Clickable links to external documentation/files in comments
- New features in AmiBroker Formula Language
- faster composites by means of StaticVarAdd
- compression of persistent static variables (can save as much as 90%
of disk space and memory)
- stricter error checking (printf/StrFormat format string checking)
- static and dynamic variable functions now support matrices
- new functions GfxFillSolidRect, SumSince, MxInverse, MxSolve, MxDet,
MxSetBlock, MxGetBlock, MxSort, MxSortRows, MxToString, MxFromString,
StaticVarAdd, fgetcwd
- new parameters in functions: DateTimeToStr, StaticVarSet
- performance improvements in printf(), variable period Sum
- Charting, User interface and under-the-hood
improvements
- enhanced category window (allowing to rearrange (move up/down) markets/groups/sectors/industries
and watch lists)
- user-definable candlestick wick thickness
- user-definable decimal places in horizontal line price level
- cycle tool handles years past 2038
- large icons are used on HighDPI displays for tree views and list view
checkboxes for much better accessibility
- Auto-size Analysis columns to content
- crash recovery improvements
- tons of other improvements (see Release Notes for details)
Highlights of version 6.00
Version 6.00 brings lots of new functionality, especially with regards to system
testing. There are hundreds of new features and changes to existing functionality
as compared to version 5.90, listed in detail in "Release Notes" document
in AmiBroker directory. Below is just a short list of a few of them:
- Integrated high-performance Monte Carlo
simulator - with cumulative distribution charts of equity,
max. drawdowns, support for custom user-definable metrics and ability
to perform MC simulator-driven optimizations.
- Full Matrix support (two-dimensional
arrays) in AFL with direct native matrix arithmetic (matrix operations
like addition, subtraction, multiplication,
division,
transpose,
etc), see Matrix, MxIdentity, MxTranspose, MxGetSize.
- Detailed Buy-and-hold (benchmark) statistics automatically added to the
backtest reports.
- User-definable stop precedence (SetStopPrecedence function) and
stop validity (ValidFrom/ValidTo parameters in ApplyStop function).
- Sparse array support: SparseCompress, SparseExpand.
- Infinite Impulse Response filter function (IIR) for efficient implementation
of higher-order smoothing algorithms.
- Raw text output in explorations via AddRow function.
- New styles supported by Exploration XYCharts.
- Variable period Percentile function.
- Unicode (UCN) support in PlotText, PlotTextSetFont, GfxDrawText, GfxTextOut,
chart titles, interpretations and commentary windows (allows various graphic
annotations/windings).
- New low-level graphic functions: GfxSelectHatchBrush, GfxSelectStockObject.
- wildcard matching function StrMatch.
- enhanced Assignment Organizer.
- Word-wrap functionality in AFL editor and enhanced
"Code Prettify" function.
Highlights of version 5.90
In addition to completely new functionality, this
version focuses on speed
improvements and enhancements of existing functionality. There are
hundreds of new features and changes to existing functionality as compared
to version
5.80, listed in detail in "Release Notes" document in AmiBroker directory.
Below is just a short list of a few of them:
- Performance improvements
- AFL Engine: custom memory allocator no longer uses Microsoft
runtime libraries for reference tracking. Result: complex formulas with
lots of loops and OLE (especially low-level custom backtests) run
up to 3 times faster in 32-bit and 4 times faster in 64-bit.
- execution speed improved by a factor of > 2x for AFL functions:
MACD, Signal, CCI, Sum (variable period).
- Brand-new Code Snippets window and keyboard triggers
- added Code Snippets window - allows inserting, deleting, and saving selected
parts of the formula as snippets. Also, convenient drag-and-drop
of snippets to the formula edit window is implemented.
- Code snippets are available in the auto-complete list (type @ plus
first letter of snippet key trigger), and even without auto-complete
activated, @keytrigger is replaced by snippet text.
- Redesigned Report Explorer and improved Report Viewer (HTMLView)
- Column layout (order and sizes) is now saved and restored
between runs.
- Loading and refresh performance significantly improved (5x)
using owner-draw/virtual mode.
- Multi-column sorting
implemented.
- Numeric columns are now right-aligned for
better readability.
- visuals significantly improved (list uses modern
style, grid lines, immediate column resizing, double buffering for
no flicker, thousand separators, negative values are displayed in dark
red, HighDPI-aware, and changed
toolbar).
- HTMLView – Backtest report viewer – added Edit/Copy, Edit/Select All,
and Edit/Copy TABLE. The last command transforms HTML tables into CSV
format and copies them to the clipboard so tables can be pasted easily to
Excel. It also divides Entry/Exit columns into separate Entry/exit date/price
columns.
- new Bid/Ask trend indicator in the Real-time quote
window -
a graphical indicator showing the direction of the 10 most recent changes in real-time
bid/ask prices.
The right-most box is the most recent, and as new bid/ask quotes arrive, they are shifted
to the left side.
- User-definable HTML backtest reports
- Now it is possible to output HTML instead of graphics
in report chart formulas using AFL: EnableTextOutput( 3 ) – HTML output
to backtest
report.
- rewritten 3. Profit Table.afl using HTML embedding
features auto-scalable layout (so it enlarges when numbers are bigger),
bold summary
columns, negative values in red, and boundary date changed to the last
day of year/month.
- Charting improvements
- Left/right extended trend lines and rays now use a user-definable
Extension Factor (a new field in Study properties) instead of always
having infinite extent. An Ext. Factor equal to ZERO means INFINITE; other values
0.1 ... 26 define how far to the left/right the line is extended.
- Max zoom achievable via View->Zoom Out is increased to 5
million bars. Also, the Pref/Charting/Default zoom limit is set to 5 million.
- Line drawings now have user-definable line width in pixels (a new "Line
width" field in the Study Properties dialog). In addition to that, the "Thick
line" box makes the line twice as wide (so the actual width of a thick line
is 2 * lineWidth instead of adding 1 pixel to the width).
- added ability to control the number of decimals in chart value labels via
GraphLabelDecimals variable (example, adding GraphLabelDecimals = 2;
to the formula would give you value labels with 2 decimal places).
- User Interface improvements
- Parameter window's look and feel improved. Item height is increased,
and the slider thumb is made wider for easier use on small-size/high-DPI screens.
- New Analysis UI refreshes faster.
- Colors, bold and italic styles are now added to Interpretation and
Commentary windows.
- Filter dialog now shows the number of matching symbols in real-time.
- Column setup dialog has new "Mark All / Toggle All" buttons.
- AFL new features / improvements:
- new AFL functions: GetFormulaPath, NullCount, Sort, Reverse, StrSort,
StrTrim, SendEmail
- extended functionality of AFL functions: StrExtract, StrMid, RestorePriceArrays,
PlotGrid, EnableTextOutput, GetOption
- Single-character literals added to AFL.
- Stability & debug improvements
- added lots of parameter checks
- 64-bit version now has a call stack trace in the bug report for better
debugging
- added more memory checks, early warnings, and error messages when running
out of memory
- added checks for unusual, yet potentially 'troublemaker' scenarios
Highlights of version 5.80
In addition to completely new functionality, this version focuses on incremental
improvements and enhancements of existing functionality. There are hundreds
of new features and changes to existing functionality as compared to version
5.70,
listed in detail in "Release Notes" document in AmiBroker directory.
Below is just a short list of a few of them:
- Brand-new, completely rewritten AFL Formula
Editor that
supports the following features:
- Improved syntax highlighting
- Automatic brace matching/highlighting (NEW)
- Auto-indentation (NEW)
- Indentation markers (NEW)
- Enhanced auto-complete in two modes (immediate (NEW) and on-demand)
- Parameter information
- Line numbering margin and selection margin (NEW)
- Code folding (NEW)
- In-line error reporting (NEW)
- New tabbed user interface with the ability to work in both MDI and separate
floating frame mode, can be moved behind the main AmiBroker screen and brought
back (Window->Toggle Frame) (NEW) or kept on top (Window->Keep on top)
- Rectangular block copy/paste/delete (Use mouse and hold down left Alt key
to mark rectangular block)
- Enhanced printing (with syntax highlighting and header/footer)
- Code snippets - these are small pieces of reusable
AFL code. They can be inserted by right-clicking in the AFL editor window and
choosing "Insert
Snippet" menu. Code snippets are user-definable.
- New features in Low-level graphics
- multiple Z-order layers (GfxSetZOrder)
- coordinates can now be given in both pixels and bar-price mode (GfxSetCoordsMode)
- speed improvements (up to 3x)
- Persistent static variables - StaticVarSet/StaticVarSetText (added
'persistent' parameter)
- Analysis (Backtest/Optimize) enhancements
- a new "Trade using FX cash conversion" setting
- 64-bit SPSO/Tribes engine fixes
- New/enhanced AFL functions
Highlights of version 5.70
In addition to completely new functionality, this version focuses on incremental
improvements and enhancements of existing functionality. There are 116 new
features and changes to existing functionality as compared to version 5.60,
listed in detail in "Release Notes" document in AmiBroker directory. Below
is just
a
short list
of a few of them:
- Analysis improvements:
- New multi-threaded Individual Optimization
- New general-purpose ranking functions: StaticVarGenerateRanks/StaticVarGetRankedSymbols
- User-definable ranking columns (via AddRankColumn function)
- Lots of internal speed-ups in backtesting/optimization engine
- SPSO, Tribes optimization engines now also available in 64-bit.
- Time&Sales improvements: user-definable filtering, user-definable colors,
and 2 user-selectable display modes.
- Database improvements:
- 64-bit version supports files larger than 2GB per symbol
- in-memory cache can hold up to 100,000 symbols (up from 20K)
- new 64-bit DDE and ODBC plugins
- Charting improvements:
- Greatly improved performance: QuickData technology implemented, lowering
CPU usage for charts.
- Edit->'Paste Special' allows copying and pasting an entire chart pane
with various options.
- Distance measuring when drawing trendlines (X, Y distance in the status
bar).
- X/Y constraints for drawing tools (press X and/or Y key to constrain
movement in either X or Y direction when drawing).
- ASCII importer adds support for millisecond timestamps.
- AFL improvements:
- new functions:
- performance improved for Percentile() (by order(s) of magnitude).
- new fields supported in GetFnData.
- XShift support added to PlotShapes.
- speeded up transcendental math functions (sqrt, sin, asin, cos, acos,
tan, atan, ln, log10, etc).
- improved SetSortColumns.
Highlights of version 5.60
- Multithreaded GDI (graphics) rendering - now all drawing (graphic
rendering) is done in separate worker threads, so the user interface is far
more responsive, and charts are updated faster and completely independently
from each other.
- Automatic Walk-Forward out-of-sample summary
report - each out-of-sample
step now produces an individual report, plus there is a new summary
report that
covers all out-of-sample steps. It is visible in the Report Explorer as the last
one and has "PS" type.
- Enhanced color-coded backtest report
- XY (scatter) charts in explorations
- Chart themes and improved
chart look (esp. the grid).
- One-click automatic setup and update of stocks listing, sector,
and industry assignments for
all major US exchanges.
- Unlimited ad-hoc chart intervals by means of a new Interval
combo box that accepts any interval typed manually.
- Support for ICB (Industry Classification Benchmark) categories
in AFL, UI, ASCII importer and OLE interface.
- native Gradient area charts
- super-thick lines in Plot,
PlotOHLC, PlotForeign
- new AFL functions: GetAsyncKeyState, InIcb, IcbID, StaticVarInfo,
SetGradientFill, XYChartAddPoint, XYChartSetAxis
- updated AFL functions with new functionality: Status,
CategoryGetSymbols, CategoryGetName, CategorySetName, CategoryAddSymbol,
CategoryRemoveSymbol, CategoryFind, Plot, PlotOHLC, PlotForeign
- new 64-bit eSignal plugin
- updated UI in many places
- many other improvements (see Release Notes for details)
Highlights of version 5.50
- New Analysis window introduced
in version 5.50 brings the following improvements over the old Automatic Analysis:
- multi-threaded operation = speed - the new Analysis window
uses all available CPUs/cores to execute formulas in many threads in parallel,
providing significant speed-ups. For example, on a 4-core Intel i7 that can
run up to 8 threads, it can run up to 8 times faster than the old Analysis window.
The exact speed-up depends on the complexity of the formula (the more complex it
is, the more speed-up is possible) and the amount of data processed (RAM access may
not be as fast as CPU, thus limiting possible speed gains).
- non-blocking operation - you can now view, scroll, and
sort results of analysis while they are still generated. Also, as the user interface
thread is not used for processing for the most part, charts and other GUI-driven
program parts are far more responsive than with the old automatic analysis.
- multiple instances - you can run more than one instance
of New Analysis at a time, so you can run many scans, backtests, explorations, and optimizations
in parallel without waiting for one to complete.
- slicker user interface - the New Analysis window
can act as a tabbed document, can be floated, and buttons can be rearranged
for better workflow. There is far more space for the result list, and extra
information
about execution is provided on the new "Info" tab. Also, walk-forward
results are now displayed within the New Analysis window for less clutter.
- Mini High-Low rank chart in the Real-Time quote window.
- User-definable mini bar charts in Explorations (see AddColumn function).
- Add Rank Column feature - right-click the Analysis result list and choose "Add
Rank column" - it adds a column with ordinal rankings based on the current sort
or just a row number column
when
the list
is not
sorted.
- IRA account backtesting via SettlementDelay feature (see SetOption function).
- Range bars algorithm improved significantly.
- new AFL functions: ThreadSleep, StaticVarCompareExchange
- updated AFL functions with new functionality: AddColumn, SetOption,
GetOption, CategoryGetSymbols,
PopupWindow, GetFnData,
ClipboardSet
- updated OLE interface to support the new Analysis
window.
- updated custom backtester interface to
support access to local, per-analysis EquityArray property.
- updated UI in many places.
- Owner-draw list views for a 10x speed improvement when displaying millions
of rows.
- many other improvements (see Release Notes for details).
Highlights of version 5.40
- Fully multi-threaded charting; massively parallel AFL execution (each
chart pane runs in a separate thread) allows to maximize speed and utilization
of modern multi-core / multi-CPU computers. For example, on an 8-core Intel
i7 CPU, your charts will run up to 8 times faster than in version 5.30. The
AFL engine has been completely rewritten from the ground up to allow
multiple instances
of the engine running simultaneously. This enables not only multithreading
but also enhances the responsiveness of the entire application, as even a badly-written
user formula used in a chart is not able to lock or slow down the rest of the
program. Multi-threading is ON by default. It can be turned off by unchecking
"Multi-threaded charts" box in Tools->Preferences, "AFL" tab, but it is strongly
discouraged. Multi-threading should be ON if you want AmiBroker to operate
at full speed.
- 12 new AFL functions
- DateTimeAdd - adds specified number
of seconds/minutes/hours/days to a datetime.
- HMA - Hull moving average.
- FIR - Finite Impulse Response filter.
- PercentRank - calculates percent rank.
- Lookup - searches the array for a bar with
specified date/time.
- FirstVisibleValue - gets the first
visible value of the array.
- LastVisibleValue - gets the last
visible value of the array.
- InGICS - checks if a given symbol belongs
to a specified GICS category.
- GicsID - gets information about a GICS category.
- PlaySound - plays a .WAV sound file.
- ShellExecute - executes an external
program/file.
- _DT - Synonym of StrToDateTime.
- Quote Editor improvements and fixes: allows the user to turn on/off
time shift and editing timestamps down to milliseconds; fixed handling of
12-hour (AM/PM) regional settings.
- Charting improvements: better-looking value labels, low-level gfx functions
sped up 4 times.
- Charting-related changes
- Data Window and data tooltip readout is immediate
and does not require extra AFL execution (values required for display
are stored in RAM during normal chart refresh and available without the
need to re-run the formula). Tooltip variable is now obsolete. To display
custom
values in tooltips without plotting a line you can use Plot() with
styleHidden flag.
- Interpretation display does not require AFL execution.
- Inserting an indicator and resetting parameters are orders of magnitude
faster.
- chart zoom setting is now saved in a layout file and restored when
layout is loaded.
- OLE interface improvements (new IsBusy method of Analysis object and Import
method refreshes the UI automatically).
- AFL engine improvements:
- added warnings that detect potential user mistakes, such as assignment
within conditional expression or redundant calls to Plot() function.
- added extra checks for invalid parameter values for many functions
and array subscript == Null; an appropriate error message is displayed.
- PlotText optimized to conserve memory and reduce execution time by
skipping invisible parts.
- Account Manager fixes.
- improved compatibility with Windows 7 (high-DPI-aware manifest, compatibility
with Internet Explorer 9).
- 64-bit-specific fixes (including fixing problems with 3rd party DLLs).
- new appearance themes and many other improvements
and fixes.
Highlights of version 5.30
- changed database format to support timestamp granularity down to one microsecond
(0.000001s) and more data fields.
- static array variables.
- user-definable backtest report charts (see examples in Charts window, "Report
Charts" folder).
- new Data Window (Window->Data Window).
- new Performance Monitor tool.
- tick statistics added to Time&Sales window.
- chart blank area extension using the END key
(on the keyboard); to restore the original setting, press the HOME key.
- added an option to require variable declarations (SetOption("RequireDeclarations",
True )).
- persistent column state (widths, order, visibility) in the Automatic
Analysis and all other list views.
- gradient area charts capability (see Charts - Basic Chart - Gradient Price
chart).
- new typeof() AFL operator.
- new AFL functions
- User-definable Z-order of drawings and indicator plots.
- optional data padding for non-trading days.
- Rectangle and ellipse drawing tools are now solid by default.
- X-Y coordinate labels added (use View->X-Y Labels menu
to display/hide).
- Support for SSL (secure connection) and TCP/IP port selection for email
alerts added.
- new Symbols window with ultra-quick full-text
search and sorting.
- support for GICS 4-level category system.
- placing orders directly from chart (Interactive Brokers).
- many other improvements and fixes (see Release Notes document for details).
Highlights of version 5.20
- Smart (non-exhaustive) trading system optimization
AmiBroker now ships with three non-exhaustive, evolutionary optimization algorithms:
SPSO (Standard Particle Swarm Optimizer)
TRIBES (Advanced Particle Swarm)
CMA-ES (Covariance Matrix Adaptation Evolutionary Strategy).
- Support for market-neutral, long-short balanced strategies via MaxOpenLong/MaxOpenShort
control and separate long/short rankings in the backtester.
- Performance optimizations in chart drawing engine - charts are orders
of magnitude faster when the number of bars displayed is much greater than the
number of pixels.
- Log window implemented – allowing tracing and run-time error reporting.
- QuickAFL implemented
in the Automatic Analysis - speeds up backtests, optimization,
and explorations by a factor of 2 or more (if range is less than all quotations).
(Note: in order to enable it you need to check "Use QuickAFL" box in the Automatic
Analysis settings).
- Multiple-segment Volume-At-Price charts (via PlotVAPOverlayA function).
- 32-bit AmiBroker is now LARGEADDRESSAWARE, i.e. can now use up to 4GB of
RAM.
- Built-in Quarterly and Yearly intervals
- Automatic summary rows in the explorations (via AddSummaryRows AFL
function).
- Charting enhancements and improvements
- better handling of drawing tools
- better magnet mode
- Fibonacci timezones now include lines 144 and 233
- zooming via scroll bar improved
- Range bars now use per-symbol TickSize as a unit.
- new AFL functions:
GetChartBkColor
CategorySetName
PlotVAPOverlayA
AddSummaryRows
DaysSince1900
OptimizerSetEngine
OptimizerSetOption
StrCount
- AFL performance improvements in LinearReg, LinRegSlope, LinRegIntercept,
TSF and StdErr, Day(), Month(), Year(), DaysSince1900(), DayOfWeek(), DayOfYear()
functions (order of magnitude faster).
- Improved AFL functions: queued Say() command
(text-to-speech), improved StrExtract() -
can now refer to items counting from the end.
- real-time data plugins updated (IB version 1.2.4, eSignal version 1.9.0);
IBController updated to support the latest changes in data sources.
Highlights of version 5.10
- Automatic Walk-Forward testing (trading system optimization and validation
technique).
- Floating windows (TRUE multi-monitor charting capability).
Ability to "undock" (or "float") the chart window and move it to a separate
monitor.
All layout code is also updated to correctly save and restore multi-monitor
chart setups.
http://www.amibroker.com/video/FloatAndLink.html
- Symbol and Interval linking
multiple charts can now be linked by symbol and/or by interval using
easy-to-use color-coded links.
- AFL Code Profiler - shows code analysis with a detailed per-function
timing report (AFL Editor: Tools->Code Check & Profile menu).
- Real-time quote window improvements:
- reordering of symbols in the RT quote using drag-and-drop
- direct type-in of symbols into RT quote window
- ability to separate groups of symbols by inserting an empty line
- faster refresh and multi-stage background color fading upon quote change.
- new/improved AFL functions
- Improved speed of backtesting/optimization (up to 2x in some cases as compared
to v5.00).
- improved chart crosshairs - no flicker, work faster, and can be switched
on/off globally.
- track more foreign markets: now you can define rates for up to 20 currencies
(different from the base currency) for multiple currency backtesting in the preferences
window.
Highlights of version 5.00
- New Watchlist system featuring:
- Support for AFL Code Wizard - a brand-new automatic formula creation program
for people without any programming experience. For more information about
AFL Code Wizard, see this introductory video: http://www.amibroker.com/video/amiwiz/AFLWiz1.html.
- AFL engine enhancements:
- New dedicated memory heap allocators for quotes and trading system signals
resulting in the ability to run much longer optimizations than ever without getting
out-of-memory messages.
- Two new backtester modes (available using SetBacktestMode function)
allowing the handling of unfiltered (raw) entry signals.
- User-definable 5-tier commission schedule in the backtest (Automatic Analysis
/ Settings).
- Chart template sharing:
now you can save the chart as "Chart Template, Complete
(*.chart)" that stores all layout AND referenced formulas in a SINGLE file
that can
be sent to your friend, and the entire chart will be restored on any computer
with ease, without the need to copy individual formulas.
- New-Look charts – divider lines between panes are now single-pixel and
no borders around charts, giving a cleaner, larger, and more readable chart
display and printout.
- Custom Range Bars (supported in charts and via TimeFrameSet()).
- New Low-level graphics interface (23 new AFL functions).
- HTML Import in Automatic Analysis.
- Full-screen anti-aliasing in 3D optimization chart viewer (beautifully
smooth 3D charts and improved readability).
- Enhanced Real-Time Quote window display (faster updates, dual-color change
marks).
- Control of Time Shift in the ASCII importer.
Detailed Change Log
CHANGES FOR VERSION 6.10.0 (as compared to 6.09.0)
- SetOption new fields for Monte Carlo:
MCUseEquityChanges – use equity changes instead of a trade list.
MCChartEquityScale
– 1 for log scale, 0 for linear scale.
MCLogScaleFinalEquity – 1 for log scale,
0 for linear scale.
MCLogScaleDrawdown – 1 for log scale, 0 for linear scale.
MCNegativeDrawdown – 1 – use negative numbers for drawdown (reverse drawdown
CDF).
- QuickData cache was not flushed when double-clicking on the Analysis result list to display a chart. Fixed.
- Monte Carlo: added an option to use negative numbers for drawdowns (on by
default). This reverses the ordering of the "drawdown" column
in the MC table and reverses the meaning (i.e., a 10% percentile value means
that there is a 10% chance of drawdowns being equal to or worse (more negative)
than the presented value). With this option turned off (as in old versions),
drawdowns are reported as numbers greater than zero, and a 10% percentile value
means a 10% chance of drawdowns
being equal to or better (smaller) than the presented amount.
- AFL: Gfx: Low-level graphics recorded on layer 128 was played prematurely. Fixed.
- Added error message when the user attempts to write a value to BarCount (read-only symbol).
- More documentation updates.
CHANGES FOR VERSION 6.09.0 (as compared to 6.08.0)
- AFL: new function fgetcwd - get the current working directory.
- AFL Editor: an error message box displayed when an @link file was not found caused the main frame to get focus. Fixed.
- AFL Editor: auto-complete and parameter tooltips popped up when adding/editing Doxygen/Javadoc comment sections. Fixed.
- Updated documentation.
CHANGES FOR VERSION 6.08.0 (as compared to 6.07.0)
- AFL Editor: Implemented clickable JavaDoc/Doxygen-style
links in doc comments.
To use links in comments, you have to put the @link command followed by the path to
a file or URL inside a JavaDoc/Doxygen style comment:
a) multi-line comment that begins with
/**
@link readme.html
@link http://www.amibroker.com
*/
(note double asterisk after initial slash)
b) single-line comment that begins with a triple slash
/// @link readme.html
/// @link c:\program files\amibroker\readme.html
/// @link http://www.amibroker.com
Now, when you hover the mouse over the @link command, you will see an underline
that indicates it is clickable.
It reacts to a DOUBLE CLICK (not a single click). When you double-click it, the
linked document will open.
@link command can open web pages, local files (both relative and absolute
paths are supported) with a Windows-registered program
to open a given file type. So if you use
/// @link something.doc
then MS Word would be used.
/// @link test.xls
would open test.xls in Excel.
Relative paths refer to the AmiBroker working directory.
HTML files are opened with the default browser; TXT files are usually opened with
Notepad (or whatever application you use).
If the file does not exist, then you will get an error message.
- AFL: Unary minus and the NOT operator could cause a crash when
applied to the result of an undefined function or variable of non-numeric
type. Fixed.
- 64-bit stack walker no longer uses Microsoft symbol server
anymore, so it can initialize a lot faster. Also, initialization
of the stack walker is moved to the startup sequence because doing
it after an exception is risky and unreliable.
- 64-bit: access violations during Analysis run do not result
in an 'application not responding' freeze. Instead, a bug report
is displayed with a proper call stack.
- After a change in 6.02, the exception dialog displayed the first error
in the formula even if the exception was really caused not by the
first but the last error. Fixed.
- Exception info could get mixed up when multiple threads
generated them simultaneously. Fixed.
- New Analysis: Auto-size column functionality re-displayed
hidden columns. Fixed.
- UI: AmiBroker now prevents piling on "Bug recovery" dialogs
when multiple exceptions are thrown from multiple threads.
The first dialog is displayed; other exceptions are logged into
DebugView as long as "Bug recovery" is not dismissed.
- "Rename" and backup functions in several places
could fail if the new file name already existed. Fixed.
- Support for Windows 95 is dropped.
CHANGES FOR VERSION 6.07.0 (as compared to 6.06.0)
- AFL: compression for array static variables implemented
to save memory and file size: StaticVarSet has an additional
parameter that controls compression.
The compressMode parameter decides whether a given variable will be compressed
or not.
By default, only persistent static variables will be compressed (cmDefault).
You can turn it off completely (compressionMode = cmNever) or turn it on for
persistent and non-persistent variables using
compressionMode = cmAlways.
Compression is done by removing repeated values from the sequence, as repeated
values
are restored when doing StaticVarGet.
Compression is NOT compatible with the non-aligned mode of StaticVarGet.
If a compressed array is retrieved by StaticVarGet with align=False, then
repeated values found in the original array would not be retrieved.
Turning compression on slows down StaticVarSet (as it needs to do some
extra processing), but does not affect the performance of other functions,
so StaticVarGet is equally fast with or without compression.
- AFL: printf/StrFormat checks for %s, %c, %d, %x, %i, %u,
%x, %p sequences that are not supported now and prints Error
62 when they are found.
- AFL: printf/StrFormat now implements a check for a correct
formatting string, as sometimes users passed strings with
% (which is a special marker for a formatting string) instead of
%% to print an actual percent sign.
When the check fails, "Error 61. The number of % formatting specifier(s)
does not match the number of arguments passed." is displayed.
- AFL: Some variable period functions such as Ref/Sum/MA
incorrectly accepted a matrix as a 'period'. Fixed (a proper
error message is displayed now).
- AFL: StaticVarGet/StaticVarSet functions now support matrices
including persistency (so matrices can be written to disk
and loaded back between AmiBroker runs).
- AFL: VarSet/VarGet officially accept matrices (allow dynamic
variables of matrix type). (FWIW they were accepted in previous
versions but implementation was incomplete.)
- Charting: Candlestick wick thickness is now user-definable
as a % of candle width with a max. pixel width (Tools->Preferences, "Bars
and Candles" tab). Also, by default, wick thickness is
now 25%/5px max instead of a constant 1 pixel.
- Charting: Cycles tool in weekly chart produced incorrect
lines when it went past 2038. Fixed.
- Charting: Horizontal line tool level is now displayed with
the number of decimals as defined in Preferences (Misc tab, "decimal
places in chart titles/tools"). Note that this setting
is used when you draw a new line or modify an old one.
- Debugger: Added the F5 key as a keyboard shortcut for "Debug
/ Go".
CHANGES FOR VERSION 6.06.0 (as compared to 6.05.0)
- AFL Editor: bookmarks implemented (Ctrl+F2 – toggle bookmark,
F2 – go to next bookmark, Shift+F2 – go to previous bookmark).
- AFL Editor: Find in Files - when a file name contained braces,
double-clicking on it would not open it. Fixed.
- AFL Editor: Line comment puts double // comments on lines
that appear after an empty line. Fixed. Now empty lines are
left untouched.
- AFL: an extra parameter for DateTimeToStr function mode (mode
= 0 - convert both date and time portions, 1 - only date,
2 - only time). Note that mode 2 would give an empty string
when applied on a chart with a daily or longer interval.
- AFL: new function GfxFillSolidRect( x1, y1, x2, y2, color
) - it is the fastest method to fill a solid rectangle with a single
color (faster than GfxRectangle).
pw = Status("pxwidth");
ph = Status("pxheight");
GfxFillSolidRect( 0, 0, pw, ph, colorBlack );
- AFL: new function SumSince - a fast sum of array elements
since a condition was true, works like Cum( array ) - ValueWhen(
condition, Cum( array ) ) or Sum( array, BarsSince( condition
)), but much faster.
Syntax: SumSince( condition, array ).
- AFL: Variable period Sum() performance improved significantly
when period changes +/-1 on a bar-by-bar basis.
- Categories dialog: added the ability to rearrange the order
of markets/groups/sectors/industries and watchlists using "Move
Up" / "Move down" buttons.
This is a non-trivial task, as all symbols must be synchronized with the change;
when the ordering of categories changes, then all symbols' data must be re-indexed
to reflect the new order, as symbols refer to the ordinal position of the category.
- New Analysis: Added an option "Auto-size columns to
fit content" – OFF by default. When turned on, column
widths are adjusted to fit the content after analysis is
complete. Note that this means any widths specified
in the width parameter in AddColumn will be ignored when
this is turned ON.
- New Analysis: when "Wait for backfill" was turned
ON and some symbols in the "Apply to" list were
wrong (non-existing), then Analysis attempted to run code
for a symbol without quotes, causing trouble. Fixed.
CHANGES FOR VERSION 6.05.0 (as compared to 6.04.0)
- AFL Editor: Find in Files implemented – on the output list,
you can double-click on a line to open the file in the editor.
- AFL Editor/Debugger: Code Check and Profile stopped working
when it was run after a debugging session. Fixed.
- AFL: Null is now accepted by MxFromString.
- AFL: performance of printf() for large-volume output (>60000
characters) improved ~60 times.
- Charts: reduced tearing when resizing the chart window.
- Debugger now can use either the base time interval or the current
chart interval (Tools->Preferences, Debugger tab, "Bar
interval" setting).
- Debugger: implemented an Output window (for printf() output
during debugging).
- Removed the old-style legacy AFL editor from the code; removed the "use
new editor" checkbox from the preferences. The new editor
is always used now.
- UI: Unfold triangles in tree views and checkboxes in the Layers
list were hard to click on HighDPI screens because icons
were too small. Fixed. Now, larger icons (32x32) are used
instead of small (16x16) on small tablets like 8'' Windows
with high resolution (such as 1920x1200) that have very high
DPI (approx 200 DPI).
- Watch window: now expressions with 2D subscripts to access
elements of matrix, matrix[ x ][ y ], are supported.
CHANGES FOR VERSION 6.04.0 (as compared to 6.03.0)
- AFL Editor & Watch Window: the contents of matrices
are now displayed in value tooltips and the watch window.
- Debugger state (watch variables/expressions and breakpoint
locations) is now saved between AFL editor sessions (formula-wise,
so each formula has its own "debug state"). The
data are saved in an XML file with a .dbg extension.
- Debugger: MDI mode implemented. In 6.0.3, the AFL Editor did
not support 'MDI mode' (even crashed); now this functionality
is back. Also, the Watch window is available in MDI mode, and the debugger
is working in MDI mode too.
- Preferences: added a new page with Debugger settings.
The settings are as follows:
+ Limit BarCount to – defines the maximum number of bars in arrays (BarCount)
used during debugging.
+ Auto-scroll to first changed item – when this is ON, the "Arrays" list
in the Watch window is scrolled automatically to the first array item that has
changed (so you don't need to locate elements that changed manually).
+ Keep debugging state – when this is ON, the AFL editor saves the debug state
(breakpoints and watches) in the .dbg file along with the formula when closing
the editor and restores the state when the formula is reopened.
- Preferences: the 'Editor' tab moved so that 'AFL', 'Editor', and
'Debugger' tabs are next to each other. Also, the 'Alerts' and
'Currencies' tabs moved before 'Miscellaneous'.
- Watch window: a new tab "Arrays" shows exploration-like
array output for detailed examination of array contents (the first
20 arrays from the watch window are reported).
- Watch window: implemented array item change highlighting
and auto-scrolling so the first changed item is always visible
in the 'Arrays' tab.
- Watch window: implemented an expression evaluator, so you
can not only display variables but also expressions involving
variables such as (high+low)/2 or individual array elements
such as myvariable[ i ] where 'i' is a dynamic loop counter.
- Watch window: implemented value change highlighting: changed
values are displayed with a light yellow background; additionally,
numeric (scalar) values are displayed in green when they
increased or red if they decreased.
- Watch window: pressing DELETE key while editing variable
name caused deletion of the variable from the watch. Fixed.
- Watch window: variables can now be drag-dropped from the AFL
editor window.
CHANGES FOR VERSION 6.03.0 (as compared to 6.02.0)
- AFL Editor: Implemented a brand-new, fully integrated Visual
AFL Debugger.
NOTES: This is work-in-progress; more features will be added in later betas.
- Debugger: Implemented breakpoints (including those set
before compilation, as well as adding/removing breakpoints
during debugging).
To add/remove a breakpoint, use the red circle toolbar button or press F9.
Breakpoints can be added and removed at any time (during editing, when the debugger
is in a 'running' state, or stopped at a breakpoint).
Breakpoints are implemented statement-wise (as single-stepping). Keep in
mind that there can be only one breakpoint in any single line, so if a line
has more than one statement
like this:
x=1;y=1;
the breakpoint will trigger before the first statement in this line.
Breakpoints currently work with:
a) regular statements (that end with a semicolon). For multi-line statements,
place the breakpoint at the beginning line of the statement.
b) for loops
c) while loops
d) do-while loops (you need to place the breakpoint where the 'while' clause is
located; it won't break at the 'do' line as it essentially is a no-op; if
you want to break at the beginning
of 'do', just place the breakpoint on the first statement inside the { block }).
e) return statements.
f) switch/case statements.
g) break statements.
Breakpoints that you place on other lines won't trigger. The AFL editor
won't allow placing a breakpoint on an empty line, or a line that begins with
a // comment or a sole brace.
- Debugger: Implemented single-stepping (Step Into, Step Over).
Single-stepping is done statement-wise, so it works on a single statement at
a time. For example, empty lines are skipped, and statements spanning multiple
rows, like below, are treated as one step.
x = "test" +
" second row" +
" third row";
But if you put two statements in a single line, like this:
x = 1; y = 2;
Then this line would be treated as two steps (each expression 'x = 1;' and
'y = 2;' separately).
Keyboard shortcuts:
Step Over F10
Step Into F11
- Debugger: Implemented variable value inspection tooltips
(hover the mouse over a variable to see its value).
- Debugger: Implemented Watch window with variable value
display, automatically updating when the debugger single-steps
or reaches a breakpoint.
To add a variable to the watch window, simply double-click on the list (at the end
to add a new variable).
You can also change a variable name by double-clicking on an existing item.
- Renaming of PersistVars.temp to PersistVars.bin failed
on some versions of the OS. Fixed.
- RT Quote window: drag-and-drop list view shows a small arrow
marker for the drop point now.
- RT Quote window: when moving items using drag-and-drop, the moved
item's image was flickering. Fixed.
- UI: Chart zoom via Ctrl+mouse wheel now works so it attempts
to use the current mouse position as a "center" point of
zoom when possible. (Previously, it always worked so the right
border was the 'center').
- AFL: Sum(array,N) outputs NULL values for indices starting
from 0 up to index N-1 instead of N.
- When intraday data were used, timestamp of 00:00:00 was
not displayed in data tooltip (empty field was shown). Fixed.
CHANGES FOR VERSION 6.02.0 (as compared to 6.01.0)
- AFL Editor: Implemented Line comment/uncomment feature
(Edit->Line Comment, Ctrl+Q) to automatically add/remove
// line comments from single or multiple lines. If multiple
lines are selected, the content of the first selected line
decides whether a block of lines is to be commented or
uncommented.
- AFL: If any matrix cell has a Null value, then the matrix product
operator @ produces a Null respective row/column of the result
matrix.
- AFL: if a user called (a) GetPerformanceCounter( 1 ) then
(b) GetPerformanceCounter( 0 ), then a subsequent call to GetPerformanceCounter(0)
returned accumulated time not from call (a) but from system
boot. Fixed.
- AFL: matrix identifier can now be used in an if-else statement.
Such a condition checks whether the very first element of matrix
[0][0] is NOT NULL. This is useful for checking the output of
functions like MxInverse/MxSolve that would return NULL in
all cells if the matrix is singular.
So
m = Matrix( 10, 10, 0 );
// do something with matrix
if( m )
{
// some code
}
is equivalent to
if( NOT IsNull(
m[ 0 ][ 0 ] )
)
{
// some code
}
- AFL: MxSolve/MxInverse now return a matrix filled with
Nulls as a result if the source matrix cannot be inverted and
produce warning level 2 instead of an error.
- AFL: On Windows Vista and higher static variables use a slim
read-write (SRW) lock instead of critical section. This gives
a 5% performance increase in multithreading scenarios.
- AFL: StaticVarAdd( "name", value, keepAll = True,
persistent = False ) - an atomic addition (interlocked read-add-write)
operation for static variables.
It is a multithreading-safe addition for static variables that are shared by
multiple threads. This function is atomic with respect to calls to other
static variable functions.
The KeepAll flag, when it is set to true, emulates the behavior of AddToComposite.
It keeps all values that are already present, so if data holes exist in
the current symbol,
the bars that are present in the static variable but not present in the current
symbol remain untouched.
When KeepAll is set to false, then only bars that are present in the current
symbol are kept. Any other bars that were present in the static variable but
not present in currently
processed symbols are removed. That is what normally happens with StaticVarSet().
In fact, when KeepAll is set to False, StaticVarAdd can be seen as the
following pseudo code:
EnterCriticalSection
x = Nz( StaticVarGet( "name" ) ); // read existing value (and
convert Nulls to zero)
x += Nz( value ); // add value to existing
StaticVarSet( "name", x ); // store updated value
LeaveCriticalSection
The function can be used to create composites like this:
if( status("stocknum")
== 0 )
{
// remove any earlier composite values
StaticVarRemove("~Composite");
}
StaticVarAdd( "~Composite", MACD() > Signal()
);
Buy = 0;
NOTES:
1. StaticVarAdd automatically converts all Nulls to zeros (as AddToComposite
does).
2. If you want to replace AddToComposite with StaticVarAdd, keep in mind
that by default AddToComposite skips symbols in group 253. This is done
so composite symbols
are not added to themselves. If you have composite symbols in your database
and want to skip symbols in group 253, you can use
if( GroupID() != 253 ) StaticVarAdd("~Composite", values );
3. Thanks to extensive code tuning, StaticVarAdd generally offers better
performance than AddToComposite, which was already blazing fast. Single-threaded
StaticVarAdd may be twice as fast as ATC. With 8 threads running,
StaticVarAdd may be 4x as fast (it does not scale as much as a naive person
may think, because critical section limits performance due to lock contention).
To illustrate the amount of fine-tuning applied, it can be said that the first
'straightforward' version of StaticVarAdd was actually 20 times slower
than ATC.
4. Be careful when using "quickafl," as StaticVarAdd would not
increase 'required bars' (as ATC does); so if you want to actually add
all bars and quick afl is turned on in analysis, it is better to add SetBarsRequired(sbrAll,
sbrAll).
- AFL: Study() returned NULL array when a line's start date
was greater than the end date. Fixed (now it works for lines
drawn from right to left too).
- Docs: Example polynomial fit formula shows how to gracefully
handle a singular matrix and overflow/not-a-numbers in polynomial
calculations.
order = Param( "n-th
Order", 10, 1, 16, 1 );
length = 60;
lvb = BarCount - 1;
fvb = lvb - length;
yy = Matrix( length + 1, 1, 0 );
xx = Matrix( length + 1,
order + 1, 1 );
yy = MxSetBlock( yy, 0,
length, 0, 0, Ref( C,
fvb ) );
x = BarIndex() - length/2;
for( j = 1;
j <= order; j++ )
{
xx = MxSetBlock( xx, 0,
length, j, j, x ^ j );
}
xxt = MxTranspose( xx );
aa = MxSolve( xxt @ xx, xxt ) @ yy;
//aa = MxInverse( xxt @ xx ) @ xxt @ yy; // alternative
way
if( aa ) // check
if matrix is not null (so solution exists)
{
rr = Null; // store the fit in
rr
for( i = fvb;
i <= lvb; i++ )
{
rr[i] = aa[0][0];
for(
j = 1; j <= order; j++ )
{
rr[i] += aa[j][0]
* x[ i - fvb ] ^ j;
}
}
if( IsNan(
rr[ fvb ] ) )
{
// our polynomial
yields infinite or not-a-number result due to overflow/underflow
Title = "Polyfit
failed. The order of polynomial is too High";
}
else
{
SetChartOptions( 0, chartShowDates );
SetBarFillColor( IIf( C > O, ColorRGB( 0, 75, 0 ), IIf( C <= O, 75, 0, 0 ), colorLightGrey )
) );
Plot( rr, "rr", colorWhite, styleLine | styleThick);
}
}
else
{
Title = "Matrix is singular. The order
of polynomial is too high";
}
Plot( C, "", IIf( C > O, ColorRGB( 0, 255, 0 ), IIf( C <= O, 255, 0, 0 ), colorLightGrey )
), styleDots | styleNoLine );
- Persistent static variables are now saved to PersistVars.temp,
and once write is successful, the file is renamed to PersistVars.bin.
This is to prevent data loss when writing very large sets
of persistent variables.
- When more than one error is detected in a single line of
the formula, then the first error message is displayed instead
of the last one in chart/commentary/analysis.
CHANGES FOR VERSION 6.01.0 (as compared to 6.00.0)
- AFL: MxDet( mx, method = 0 ) - calculates the determinant of
the matrix.
method = 0 – auto (uses slow method for matrices up to and including 5x5,
fast for larger matrices).
method = 1 – slow (slow, more accurate).
method = 2 – fast (LU decomposition, less accurate).
"slow" method uses Laplace expansion.
"fast" method uses LU decomposition.
"Slow" method for small matrices (1x1, 2x2, 3x3, 4x4) is actually
faster than "fast," equally fast for matrix 5x5, and
slower than the "fast" method for matrices larger than 5x5.
For this reason, the "auto" method uses the "fast" LU method
only for matrices larger than 5x5.
CAVEAT: Laplace method has a complexity of O(N!), and for this reason, even
if you use method = 1, the maximum dimension for this method is limited
to 10x10.
Matrices larger than that are always calculated using the LU method.
- AFL: MxFromString() - creates a new matrix out of a string
in Mathematica/Wolfram list-style: "{ { 1, 2, 3 }, {
4, 5, 6 } }" or Matlab/Maple style "[ [ 1, 2, 3
], [ 4, 5, 6 ] ]" or GNU Octave comma-semicolon style
[ 1, 2, 3; 4, 5, 6 ].
- AFL: MxGetBlock( matrix, startrow, endrow, startcol, endcol,
asArray = False )
Retrieves items from a rectangular submatrix (block) and returns either a smaller
matrix (when asArray is set to False)
or a "normal" AFL array (when asArray is set to True). If the array
has a different number of bars, unused elements are filled with Null.
z = Matrix( 2, 20, 0 );
// first row
z = MxSetBlock( z, 0, 0, 0, 19, Close );
// second row
z = MxSetBlock( z, 1, 1, 0, 19, RSI( 5 ) );
printf("Matrix z\n");
printf( MxToString( z ) );
x = MxGetBlock( z, 0, 1, 0, 19, True );
printf("Items are now in regular array (data series):\n" );
for( i = 0; i < 20; i++ )
printf( NumToStr( x[ i ] ) + "\n" );
z = MxGetBlock( z, 0, 1, 0, 1 ); // retrieve upper 2x2 submatrix
printf("Upper submatrix z\n");
printf( MxToString( z ) );
- AFL: MxInverse( mx ) - calculates the inverse of the matrix
(see comments to MxSolve for more info).
- AFL: MxSetBlock( matrix, startrow, endrow, startcol, endcol,
values = 0 )
Sets values in a rectangular block of cells (rows in the range startrow..endrow
and columns in the range startcol..endcol inclusive).
This allows filling entire or partial rows, columns, and all other kinds of
rectangular areas in the matrix with user-specified data.
Row and column numbers are zero-based.
If the values parameter is scalar, all cells in the specified block are filled with
that value.
If the values parameter is an array, cells in the block are filled from left
to right and from top to bottom with consecutive values taken from that array.
If there are more cells in the block than values in the array, the array
item counter wraps around to zero and starts taking values from the beginning.
Note: the function creates a new matrix as a result (so the source matrix is
unaffected unless you assign the result back to the original
variable).
Example 1:
// Create a 6x6 matrix
// and fill the 4x4 interior (except edges) with consecutively increasing numbers.
y = Matrix( 6, 6, 0 );
y = MxSetBlock( y, 1, 4, 1, 4, Cum(1));
printf("Matrix y\n");
printf( MxToString( y ) );
Example 2:
// Create a matrix with 2 rows x 20 columns and fill rows 0, 1 with the first 20
values of Close and RSI(5) arrays, respectively.
z = Matrix( 2, 20, 0 );
// first row
z = MxSetBlock( z, 0, 0, 0, 19, Close );
// second row
z = MxSetBlock( z, 1, 1, 0, 19, RSI( 5 ) );
printf("Matrix z\n");
printf( MxToString( z ) );
- AFL: MxSolve( A, B ) - solves linear equation system A@X
= B.
A needs to be a square matrix NxN.
B has to have N rows and at least one column (a vertical vector).
Then calling
X = MxSolve( A, B ) would give a vertical vector holding the solution of the system
of equations A @ X = B.
B can also be a matrix, with each of its columns representing a different
vector B. This way, a single call to MxSolve can solve several systems with
the same matrix A but different right-hand vectors.
If B is a matrix NxM, then MxSolve will produce a result also having NxM cells,
with each column representing a single solution.
Example 1:
A = MxFromString("[ 1, 1, 1, 1; 0, 2, 5, -1; 2, 5, -1, 1; 2, 2, 2,
1 ]");
B = MxFromString("[ 7; -5; 28; 13 ]" ); // single vertical vector
B
printf( "Solving A * X = B\n" );
printf("Matrix A\n");
printf( MxToString( A ) );
printf("\nMatrix B\n");
printf( MxToString( B ) );
X = MxSolve( A, B );
printf("\nSolution X\n");
Example 2:
A = MxFromString("[ 1, 1, 1, 1; 0, 2, 5, -1; 2, 5, -1, 1; 2, 2, 2,
1 ]");
B = MxFromString("[ 7, 14 ; -5, -10; 28, 56; 13, 26 ]" ); //
2 right-hand side vertical vectors
printf( "Solving A * X = B\n" );
printf("Matrix A\n");
printf( MxToString( A ) );
printf("\nMatrix B\n");
printf( MxToString( B ) );
X = MxSolve( A, B );
printf("\nSolutions X\n");
printf( MxToString( X ) ); // two solutions
(Highly) Technical note about numerical precision:
Despite the fact that both MxSolve and MxInverse use double-precision
arithmetic, solving/inverting matrices is subject to the numerical precision
of double IEEE,
and for example, a zero result may come up as something like 1.4355e-16 (0.0000000000000001)
due to the fact that double precision is still limited in accuracy (16
digits).
The result of
X = MxInverse( A ) @ B;
although mathematically the same as solving the system of equations, would
yield a slightly different result because if you do the inverse, the returned
matrix is converted back
to single precision, and the matrix product is performed with single precision.
When you use MxSolve, you are performing all calculations using 64-bit (double)
precision, and
only the end result is converted back to single precision. So, for example, polynomial
fit code works better with MxSolve than MxInverse.
// Least Squares Polynomial Fit test
order = Param( "n-th Order", 15, 1, 25, 1 );
length = 60;
lvb = BarCount - 1;
fvb = lvb - length;
yy = Matrix( length + 1, 1, 0 );
xx = Matrix( length + 1,
order + 1, 1 );
yy = MxSetBlock( yy, 0,
length, 0, 0, Ref( C,
fvb ) );
x = BarIndex() - length/2;
for( j = 1;
j <= order; j++ )
{
xx = MxSetBlock( xx, 0,
length, j, j, x ^ j );
}
xxt = MxTranspose( xx );
aa = MxSolve( xxt @ xx, xxt ) @ yy;
//aa = MxInverse( xxt @ xx ) @ xxt @ yy; // alternative
way
rr = Null; // store the fit in rr
for( i = fvb; i <= lvb; i++
)
{
rr[i] = aa[0][0];
for( j = 1;
j <= order; j++ )
{
rr[i] += aa[j][0]
* x[ i - fvb ] ^ j;
}
}
SetChartOptions( 0, chartShowDates );
SetBarFillColor( IIf( C > O, ColorRGB( 0, 75, 0 ), IIf( C <= O, 75, 0, 0 ), colorLightGrey )
) );
Plot( rr, "rr", colorWhite, styleLine | styleThick);
Plot( C, "", IIf( C > O, 0, 255, 0 ), IIf( C <= O, 255, 0, 0 ), colorLightGrey )
), styleDots | styleNoLine );
- AFL: MxSort( mx, dim = -1, ascending = True ) - sorts the
matrix.
Sorts all items in a matrix.
When dim == -1 (the default), it would sort:
a) a row if there is only one row (vector is horizontal).
b) a column if there is only one column (vector is vertical).
c) each column separately if there are more rows and columns than one (so
we have an actual 2D matrix).
When dim == 0, the function sorts the items in each row separately.
When dim == 1, the function sorts the items in each column separately.
// example
m = MxFromString("[ 9, 5, 6; 8, 7, 3 ]");
printf( MxToString( m ) + "\n\n" );
printf("%g, %g\n\n", MxGetSize( m, 0 ), MxGetSize( m, 1 ) );
m2 = MxSort( m, 0 ) ;
printf( MxToString( m2 ) + "\n\n" );
m3 = MxSort( m, 1 ) ;
printf( MxToString( m3 ) + "\n\n" );
- AFL: MxSortRows( mx, ascending = True, col1 = 0, col2 =
-1, col3 = -1 )
Sorts the rows of the matrix in ascending/descending order of the col1 column.
When the col1 column has equal values, SortRows sorts according to the col2
and col3 columns in succession (if col2 and col3 are specified and >=
0).
Column numbers are zero-based.
Hint: if you want to sort columns instead, you can Transpose/Sort rows/Transpose
back.
m = MxFromString("[ 9, 1, 6; 40, 30, 20; 8, 7, 3; 3, 5, 1 ]");
printf("Input matrix\n");
printf( MxToString( m ) + "\n\n" );
printf("Rows %g, Cols %g\n\n", MxGetSize( m, 0 ), MxGetSize(
m, 1 ) );
printf("Sorting every row separately\n");
m2 = MxSort( m, 0 ) ;
printf( MxToString( m2 ) + "\n\n" );
printf("Sorting every column separately\n");
m3 = MxSort( m, 1 ) ;
printf( MxToString( m3 )+ "\n\n");
printf("Sorting rows by contents of first column\n");
m4 = MxSortRows( m, True, 0 ) ;
printf(MxToString( m4 )+ "\n\n");
printf("Sorting rows by contents of second column\n");
m5 = MxSortRows( m, True, 1 ) ;