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 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 looking into the future.
- 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 the "Explain" button is added to the caption
bar that displays help page with 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 old browser
To use 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 to specify 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 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
range of quotes from multiple symbols at once
- IQFeed plugin now has 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 where mouse position is to prevent
user confusion when modal dialog box opened on other 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 used
new lines
- Indicator Maintenance Wizard: Automatically creates timestamped backup
files for easy restoration.
- Easy Alerts: Now display 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
few of them:
- QuickGFX - brand new chart rendering engine delivering
upto 100x performance boost as compared to GDI rendering. GDI rendering speed
also improved upto 2x.
In-house developed QuickGFX direct rendering technology
completely bypasses Windows GDI and offers amazing 10x-100x performance gain
as compared
to GDI rendering
To enable QuickGFX experimental tech go to Tools->Preferences, "Miscellaneous" tab,
click "Experimental: Use QuickGFX render" and press "Apply" or "OK"
You can see when it is enabled, chart timing footnote (when enabled) will
say "QuickGFX render ...ms" instead of "GDI render ...ms"
This is PROFESSIONAL edition feature only. Users of Standard version would
need to purchase 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 need to write batches. Allows for example single click two-step
analysis runs creating composites or static variables in first step and
using them in second step
- Backtester - added "Max. position value" option in the settings
allowing to specify maximum dollar value of position. Zero (0) means
no maximum. Positions larger will be shinked (if shrinking is enabled)
or won't be entered at all (if shrinking is disabled)
- huge speedups in running large explorations,
dark theme and 5x speed up for rendering huge list views like (as compared to
6.31)
- AmiBroker Formula Language new functions
/ features
- FindIndex( array, value, start_from = 0, dir = 1 ) - find index of
array item matching specified value
- BarsSinceCompare( past, comparison, current ) - for every bar, compare
past array values with current bar value and return the number of bars
since last time comparision was true
- InternetSetHeaders( "headers" ) - set custom HTTP headers
for subsequent web requests
- InternetSetOption( option, value ) - set HTTP option for internet session
- InternetPostRequest(''http://url_to_your_web_resource'', data, flags
= 0) - send HTTP Post request to Internet web resource (URL)
- MxCopy() - in-place copy of rectangular blocks from one matrix
to the other (copy portions of one matrix to the other matrix)
- _exit() - gracefully ends AFL execution at the point of the call
- InternetGetStatusCode() - returns HTTP status code of last
InternetOpenURL or InternetPostRequest call
- Chr( code ) returns string representing single character of given ascii
code
- GetObject( path, class ) providing functionality equivalent to JScript
GetObject and VBScript GetObject
- GuiSendKeyEvents("ED") - register given characters to be
sent as Gui event when keyboard key is pressed. GuiGetEvent will return
code == notifyKeyDown and id of given character, for example id == 'D'
for D letter
- inverf(x) - inverse of erf function
- erf(x) - computes Error function https://en.wikipedia.org/wiki/Error_function
- SafeDivide( x, y, valueifzerodiv )- safe division that handles division
by zero using special handling (replace result with user-defined value)
- new Javascript engine (Chakra) featuring native JSON support (EnableScript("chakra"))
- AmiBroker Formula Language improvements, enhancements and fixes
- exponentation 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 extra parameter for Error() function to stop execution
- internal function signatures changed to allow flexible ordering
of arguments regardless of their type and varargs with less
overhead
- GfxDrawImage with PNG images exclusive file lock removed
- parser warns if 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 batch editor
- Edit->Delete (from main menu) and Edit-Delete All implemented for
completeness
- list view uses virtual mode now (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 specify
format definition file
- added optional parameter to Execute and Wait command to specify current
working directory for command
- added optional parameter to Export to File / Export walk-forward to
file to specify column separator in CSV files
-optional parameter defines the column SEPARATOR used for export. Only
single character is used. When it is not supplied, comma is used.
- AFL editor enhancements
- call tips (parameter information tooltips) now provide extra description
about the function and its parameters (as of v6.39 only 20 functions
have this extra info)
- debugging session is automatically terminated with appropriate notice
when user attempts to edit the code during debugging (this saves mouse
clicks that were needed to stop debug session in order to edit)
- previously when no text was selected and Prettify Code was choosen,
the message box caused main frame to get focus instead of focus staying
in AFL frame. Fixed
- when an runtime error is detected debugging session the message bar
shows now number of detected errors (as it did previously during normal "verify"
- when dark mode list views are used watch window default text color
was black making it hardly visible, changed to white
- User Interface new features and improvements:
- Dark theme for all owner-draw
list views (NOT in dialogs) now feature customizable theme (currently
available "system (light) theme" and "black theme")
- go to Tools->Customize, "Appearance" tab, "Dark mode
for listviews" checkbox
- 5x speed up for rendering huge list views (bypassing Windows rendering)
- Preferences: added Text Tool font setting independent
from 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
- new 8-digit ICB structure implemented: https://www.ftserussell.com/data/industry-classification-benchmark-icb
- Database Purify is 10x faster
- OLE: added Stock.Quotations.Adjust function to perform adjustments
programmatically OLE: added Stock.Quotations.Adjust() function. long
Adjust(BSTR pszFieldList, float fMultiplier, float fOffset, DATE dDateTime,
boolean bBefore)
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 few of them:
- Huge performance improvements in 64-bit version with migration
to new VC++2017 compiler
Why do we migrate to new compiler with 64-bit version?
- New compiler supports
new CPU instructions (SSE3/AVX) that we can use to offer better performance
- According to our tests new compiler support
produces faster code by itself (better optimizations, auto-vectorization,
etc)
- 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 64-bits version and all 64-bit capable CPUs are "modern" enough.
Why do we stay with old compiler in 32-bit version?
- New compiler does not
produce code compatible with older operating systems (XP or earlier). Old
compiler offers 100% compatibility
with all Windows versions
- 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 8x speed up can be observed in 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 few of them:
- HIGHLIGHT: Integrated Batch Processor -
allowing you to automate complex, sequential tasks, 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 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 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 accessability
- auto-size Analysis columns to contents
- 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 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 peform 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 few of them:
- Performance improvements
- AFL Engine: custom memory allocator does not use Microsoft
runtime lib for reference tracking anymore. Result - complex formulas with
lots of loops and OLE (especially low-level custom backtests) run
upto 3 times faster in 32 bit and 4 times faster in 64-bit
- execution speed improved by factor > 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/saving selected
parts of the formula as snippets. Also implemented is convenient drag-drop
of snippet to the formula edit window
- Code snippets are available in auto complete list (type @ plus
first letter of snippet key trigger), and even without auto complete
activated @keytrigger is replaced by snippet text
- Re-designed 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, 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 it into clipboard so tables can be pasted easily to
Excel. Also it divides Entry/Exit columns into separate Entry/exit date/price
columns
- new Bid/Ask trend indicator in Real-time quote
window -
a graphical indicator showing the direction of 10 most recent changes in real-time
bid/ask prices
The right-most box is 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, boundary date changed to last day
of year/month
- Charting improvements
- Left/right extended Trend lines and Rays now use user-definable
Extension Factor (new field in Study properties) instead of always
infinite extent. Ext. Factor equal to ZERO means INFINITE, other values
0.1 ... 26 define how far to the left/right line is extended
- Max zoom achievable via View->Zoom Out is increased to 5
million bars, also Pref/Charting/Default zoom limit set to 5 million.
- Line drawings now have user definable line width in pixels (new "Line
width" field in Study Properties dialog). In addition to that "Thick
line" box makes line twice as wide (so actual width of thick line
is 2 * lineWidth instead of adding 1 pixel to width)
- added ability to control number of decimals in chart value labes via
GraphLabelDecimals variable (example, adding GraphLabelDecimals = 2;
to the formula would give you value lables with 2 decimal places)
- User Interface improvements
- Parameter window look and feel improved. Item height is increased
and slider thumb made wider for easier use on small size/high DPI screen
- New Analysis UI refreshes faster
- Colors, bold and italic styles are now added to Interpretation and
Commentary windows
- Filter dialog now shows 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-characters literals added to AFL
- Stability & debug improvements
- added lots of parameter checks
- 64-bit version has now 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 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 ability to work in both MDI and separate
floating frame mode, can be moved behind 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 re-usable 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
- co-ordinates can now be given in both pixels and bar-price mode GfxSetCoordsMode
- speed improvements (upto 3x)
- Persistent Static variables - StaticVarSet/StaticVarSetText (added
'persistent' parameter)
- Analysis (Backtest/Optimize) enhancements
- 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 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 speedups in backtesting/optimization engine
- SPSO, Tribes optimization engines now available also in 64-bit
- Time&Sales improvements: user-definable filtering, user-definable colors,
2 user-selectable display modes
- Database improvements:
- 64-bit version supports files larger than 2GB per symbol
- in-memory cache can hold upto 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 to copy-paste entire chart pane
with various options
- Distance measuring when drawing trendlines (X,Y distance in the status
bar)
- X/Y constrains 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() (order(s) of magnitude)
- new fields supported in GetFnData
- XShift support added to PlotShapes
- speeded up transcendental mathfunctions (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 way
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 produces individual report now, plus there is a new summary
report that
covers all out-of-sample steps. It is visible in the Report Explorer as 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 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 old Automatic Analysis
- multi-threaded operation = speed - new Analysis window
uses all available CPUs/cores to execute formulas in many threads in parallel
providing significant speed ups. For example on 4 core Intel i7 that can
run upto 8 threads, it can run upto 8 times faster than old Analysis window.
Exact speed up depends on complexity of the formula (the more complex it
is, the more speedup is possible), amount of data processed (RAM access may
be not 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 user interface
thread is not used for processing for most part, charts and other GUI-driven
program parts are way more responsive than with old automatic analysis
- multiple instances - you can run more than one instance
of New Analysis at a time, so you can run many scans/backtest/explorations/optimizations
in parallel without waiting for one to complete
- slicker user interface - New Analysis window
can act as tabbed document, can be floated, buttons can be re-arranged
for better workflow. There is way more space for the result list, extra
information
about execution is provided on the new "Info" tab. Also walk-forward
results are now displayed within New Analysis window for less clutter.
- Mini High-Low rank chart in Real Time quote window
- User-definable mini bar charts in Explorations (see AddColumn function)
- Add Rank Column feature - right-click Analysis result list and choose "Add
Rank column" - it adds a column with ordinal rankings based on current sort
or just row number column
when
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 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 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 separate thread) allows to maximize speed and utilisation
of modern multi-core / multi-CPU computers. For example on 8-core Intel
i7 CPU your charts will run upto 8 times faster than in version 5.30. The
AFL engine has been completely rewritten from ground up to allow
multiple instances
of the engine running simultaneously. This enables not only multithreading
but also enhances responsiveness of entire application, as even badly-written
user formula used in a chart is not able to lock or slow 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 datetime
- HMA - Hull Moving average
- FIR - Finite Impulse Response filter
- PercentRank - calculate percent rank
- Lookup - search the array for bar with
specified date/time
- FirstVisibleValue - get first
visible value of the array
- LastVisibleValue - get last
visible value of the array
- InGICS - check if given symbol belongs
to specified GICS category
- GicsID - get information about GICS category
- PlaySound - play .WAV sound file
- ShellExecute - execute external
program / file
- _DT - synonym of StrToDateTime
- Quote Editor improvements and fixes: allows user to turn on/off
time shift and editing timestamps down to milliseconds, fixed handling of
12 hour (AM/PM) regional setting
- Charting improvements: better looking value labels, low-level gfx functions
speeded up 4 times.
- Charting-related changes
- Data Window and data tooltip readout is immediate
and does not require extra AFL execution (values required to display
them are stored in RAM during normal chart refresh and available without
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.
- Interpreation display does not require AFL execution
- Inserting 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 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 - 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)
- 64bit-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 time stamp 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 END key
(on the keyboard), to restore original setting press HOME key
- added 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 co-ordinate labels added (use View->X-Y Labels menu
to display/hide).
- Support for SSL (secure connection) and TCP/IP port selection for e-mail
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 3 non-exhaustive, evolutionary optimization algorithms:
SPSO (Standard Particle Swarm Optimizer)
TRIBES (Advances 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 number of bars displayed is much greater than number
of pixels.
- Log window implemented - allow tracing and run-time error reporting
- QuickAFL implemented
in the Automatic Analysis - speeds up backtests, optimization
and explorations by 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 setttings).
- Multiple-segment Volume-At-Price charts (via PlotVAPOverlayA function)
- 32-bit AmiBroker is now LARGEADDRESSAWARE, i.e. can now use upto 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 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 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 detailed per-function
timing report (AFL Editor: Tools->Code Check & Profile menu)
- Real-time quote window improvements
- re-ordering of symbols in the RT quote using drag-and-drop
- direct type-in symbols into RT quote window
- ability to separate groups of symbols by inserting empty line
- faster refresh and multi-stage background color fading on 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 than base currency) for multiple currency backtesting in the preferences
window.
Highlights of version 5.00
- New Watchlist system featuring:
- Support for AFL Code Wizard - 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 ability to run much longer optimizations than ever without getting
out-of-memory messages
- Two new backtester modes (available using SetBacktestMode function)
allowing 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 SINGLE file
that can
be sent to your friend and entire chart will be restored on any computer
with ease, without need to copy individual formulas.
- New-Look charts - divider lines between panes are now single pixel and
no borders around charts giving cleaner, larger and more readable chart display
and printout
- Custom Range Bars (supported in the 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 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 Analysis result list to display chart. Fixed.
- MonteCarlo: added an option to use negative number for drawdowns (on by
default). This reverses the ordering of "drawdown" column
in the MC table and reverses the meaning (i.e. 10% percentile value means
that there is 10% chance of drawdowns being equal or worse (more negative)
than presented value). Wwith this option turned off (as in old versions),
drawdowns are reported as numbers greater than zero and 10% percentile value
means 10% chance of drawdowns
being equal or better (smaller) than presented amount.
- AFL: Gfx: low-level graphic recorded on layer 128 was played prematurely. Fixed.
- Added error message when user attempts to write 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 current working directory
- AFL Editor: an error message box displayed when @link file was not found caused main frame to get focus. Fixed.
- AFL Editor: auto-complete and parameter tooltips poped 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 @link command followed by path to
file or URL inside JavaDoc/Doxygen style comment:
a) multiline 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 triple slash
/// @link readme.html
/// @link c:\program files\amibroker\readme.html
/// @link http://www.amibroker.com
Now when you hover the mouse over @link command you will see the underline
that indicates it is clickable.
It reacts to DOUBLE CLICK (not single click). When you double click it
linked document will be open
@link command can open web pages, local files (both relative and absolute
paths are supported) with Windows-registered program
to open 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 AmiBroker working directory.
Html files are open with default browser, txt files are usually open with
Notepad (or whatever application you use).
If file does not exist then you will get an error message.
- AFL: Unary minus and NOT operator could cause crash when
applied to result of undefined function or variable of non-numeric
type. Fixed.
- 64-bit stack walker does not use Microsoft symbol server
anymore so it can init a lot faster. Also initialization
of stack walker is moved to startup sequence because doing
it after exception is risky and unreliable
- 64-bit: access violations during Analysis run do not result
in 'application not responding' freeze. Instead bug report
is displayed with proper call stack.
- After change in 6.02 exception dialog displayed first error
in the formula even if exception was really caused not by
first but last error. Fixed.
- Exception info could get mixed up when multiple threads
generated them at the same time. 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.
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 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 additional
parameter that controls compression
compressMode parameter decides whenever 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
persitent 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 non-aligned mode of StaticVarGet.
If compressed array is retrieved by StaticVarGet with align=False, then
repeated values found in original array would not be retrieved.
Turning compression on slows down StaticVarSet (as it needs to do some
extra processing), but does not affect performance of other functions,
so StaticVarGet is equally fast with or without compression.
- AFL: printf/StrFormat check 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 implement a check for correct
formatting string as sometimes users passed strings with
% that is special marker for formatting string instead of
%% to print actual percent sign
When check failes, "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 matrix as a 'period'. Fixed (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 wicks thickness is now user definable
as % 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 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
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 old.
- Debugger: Added F5 key as 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 file name contained braces
() double click on it would not open it. Fixed.
- AFL Editor: Line comment puts double // comments on lines
that appear after empty line. Fixed. Now empty lines are
left untouched.
- AFL: extra parameter for DateTimeToStr function mode (mode
= 0 - convert both date and time portion, 1 - only date,
2 - only time ) Note that mode 2 would give you empty string
when applied on chart with daily or longer interval
- AFL: new function GfxFillSolidRect( x1, y1, x2, y2, color
) - it is fastest method to fill solid rectangle with 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 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 bar by bar basis
- Categories dialog: added ability to re-arrange the order
of markets/groups/sectors/industries and watch lists using "Move
Up" / "Move down" buttons
This is non-trivial task as all symbols must be synchronized with the change
as when the ordering of categories change then all symbols data must be re-indexed
to reflect new order as symbols refer to oridinal position of 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 that any widths specified
in width parameter in AddColumn width 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 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 line to open the file in the editor
- AFL Editor/Debugger: Code Check and Profile stopped working
when it was run after debugging session. Fixed.
- AFL: Null is accepted by MxFromString now
- 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 base time interval or current
chart interval (Tools->Preferences, Debugger tab, "Bar
interval" setting)
- Debugger: implemented Output window (for printf() output
during debugging)
- Removed old-style legacy AFL editor from the code, removed "use
new editor" checkbox from the preferences. A new editor
is used always now.
- UI: Unfold triangles in tree views and checkboxes in 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 righ resolution (such as 1920x1200) that have very high
DPI (approx 200DPI).
- 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
is now displayed in value tooltips and 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 XML file with .dbg extension
- Debugger: MDI mode implemented. In 6.0.3 AFL Editor did
not support 'MDI mode' (even crashed), now this functionality
is back. Also Watch window is available in MDI mode and debugger
is working in MDI mode too.
- Preferences: added new page with Debugger settings.
The settings are as follows:
+ Limit BarCount to - defines 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 first array item that has
changed (so you don't need to locate elementsm that changed manually)
+ Keep debugging state - when this is ON, 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 formula is reopened.
- Preferences: 'Editor' tab moved so 'AFL', 'Editor', and
'Debugger' tabs are next to each other, also 'Alerts' and
'Currencies' tabs moved before 'Miscellaneous'
- Watch window: a new tab "Arrays" shows exploration-like
array output for detailed examination of array contents (first
20 arrays from watch window are reported)
- Watch window: implemented array item change highlighting
and auto-scrolling so first changed item is always visible
in the 'Arrays' tab
- Watch window: implemented 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 dynamic loop counter
- Watch window: implemented value change highlighting: changed
values are displayed with light yellow background, additionally
numeric (scalar) values are displayed in green when they
increased or red if they are decreased
- Watch window: pressing DELETE key while editing variable
name caused deletion of variable from watch. Fixed.
- Watch window: variables can now be drag-dropped from AFL
editor window
CHANGES FOR VERSION 6.03.0 (as compared to 6.02.0)
- AFL Editor: Implemented brand new fully integrated Visual
AFL Debugger
NOTES: this the 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 breakpoint use red circle toolbar button or press F9
Breakpoints can be added and removed at any time (during editing, when debugger
is in 'running' state or stopped at 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 line
has more than one statements
like this:
x=1;y=1;
the breakpoint will trigger before first statement in this line.
Breakpoints currently work with:
a) regular statements (that end with semicolon). For multi-line statements
place breakpoint at the beginning line of the statement
b) for loops
c) while loops
d) do-while loops (you need to place breakpoint where 'while' clause is
located, it won't break at the 'do' line as it essentially is no-op, if
you want to break at the beginning
of do, just place breakpoint on first statement inside { block }
d) if statements
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 to place breakpoint on empty line, or line that beginnins with
// comment or sole brace
- Debugger: Implemented single-stepping Step Into, Step Over
Single-stepping is done statement-wise. So it works on single statement at
a time. So 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 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 mouse over variable to see its value)
- Debugger: Implemented Watch window with variable value
display automatically updating when debugger single-steps
or reaches breakpoint
To add variable to watch window simply double click on the list (at the end
to add new variable).
You can also change variable name by double clicking on existing item
- Renaming of PersistVars.temp to PersistVars.bin failed
on some versions of OS. Fixed.
- RT Quote window: drag-drop list view shows small arrow
marker for the drop point now.
- RT Quote window: when moving items using drag-drop, moved
items image was flickering. Fixed
- UI: Chart zoom via Ctrl+mouse wheel now works so it attempts
to current mouse position as a "center" point of
zoom when possible. (Previously it always worked so right
border was the 'center').
- AFL: Sum(array,N) outputs NULL values for indices starting
from 0 upto 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
is deciding whenever block of lines is to be commented or
uncommented
- AFL: If any matrix cell has Null value then matrix product
operator @ produces Null respective row/column of the result
matrix.
- AFL: if user called (a) GetPerfomanceCounter( 1 ) then
(b) GetPerformanceCounter( 0 ) then subsequent call to GetPerformanceCounter(0)
returned cumulated time not from call (a) but from system
boot. Fixed.
- AFL: matrix identifier can now be used in if-else statement.
Such condition checks whenever very first element of matrix
[0][0] is NOT NULL. This is useful for checking output of
functions like MxInverse/MxSolve that would return NULL in
all cells if 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 source matrix can not be inverted and
produce warning level 2 instead of an error.
- AFL: On Windows Vista and higher static variables use slim
read-write (SRW) lock instead of critical section. This gives
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 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.
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 exists in
current symbol,
the bars that are present in static variable but not present in current
symbol remain untouched.
When KeepAll is set to false then only bars that are present in current
symbol are kept. Any other bars that were present in 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 exisiting 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 earier 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 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 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 line's start date
was greater than end date. Fixed (now it works for lines
drawn from right to left too).
- Docs: Example polynomial fit formula shows how to gracefully
handle singular matrix and overflow/not-a-numbers in polynomial
calcs
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, ColorRGB( 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, ColorRGB( 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 single line of
the formula then the first error message is displayed instead
of last one in chart/commentary/analysis.
CHANGES FOR VERSION 6.01.0 (as compared to 6.00.0)
- AFL: MxDet( mx, method = 0 ) - calculates determinant of
the matrix
method = 0 - auto (use slow method for matrices of upto 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 "fast" method for matrices larger than 5x5
For this reason "auto" method uses "fast" LU method
only for matrices larger than 5x5
LU decomposition is fast but subject to higher numerical errors. "Slow" method
is slower yet produces much more reliable results.
For example Octave/MatLab that use LU decomposition would say that determinant
of singular matrix like this
{ {16, 2, 3, 13}, { 5, 11, 10, 8}, {9, 7, 6, 12}, {4, 14, 15, 1 } }
is -1.4495e-012 due to roundoff errors of LU method.
If you want to calculate determinant using fast (LU decomposition) method,
call MxDet with fast parameter set to 2.
CAVEAT: Laplace method has 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 LU method
- AFL: MxFromString() - creates a new matrix out of 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 rectangular submatrix (block) and returns either smaller
matrix (when asArray is set to False)
or "normal" AFL array (when asArray is set to True). If array has
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 inverse of the matrix
(see comments to MxSolve for more info)
- AFL: MxSetBlock( matrix, startrow, endrow, startcol, endcol,
values = 0 )
Sets values in the rectangular block of cells (rows in the range startrow..endrow
and columns in the range startcol..endcol inclusive).
This allows to fill entire or partial rows, columns and all other kind of
rectangular areas in the matrix with user specified data
Row and column numbers are zero based.
If values parameter is scalar, all cells in specified block are filled with
that value.
If 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 new matrix as a result (so source matrix is
unaffected unless you do the assignment of the result back to the original
variable)
Example 1:
// Create a matrix 6x6
// and fill 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 2 rows x 20 columns and fill rows 0, 1 with 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 square matrix NxN
B has to have N rows and at least one column (vertical vector).
Then calling
X = MxSolve( A, B ) would give vertical vector holding solution of the system
of equations A @ X = B
B can also be a matrix,with each of its column representing different
vector B. This way single call to MxSolve can solve several systems with
same matrix A but different right hand vectors.
If B is a matrix NxM then MxSolve will produce result also having NxM cells
with each column representing 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 numerical precision
of double IEEE
and for example 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 slightly different result because if you do the inverse the returned
matrix is converted back
to single precision and matrix product is performed with single precision.
When you use MxSolve you are performing all calcs using 64-bit (double)
precision and
only 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, ColorRGB( 75, 0, 0 ), colorLightGrey )
) );
Plot( rr, "rr", colorWhite, styleLine | styleThick);
Plot( C, "", IIf( C > O, ColorRGB( 0, 255, 0 ), IIf( C <= O, ColorRGB( 255, 0, 0 ), colorLightGrey )
), styleDots | styleNoLine );
- AFL: MxSort( mx, dim = -1, ascening = 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 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 ) ;
printf(MxToString( m5 )+ "\n\n");
- AFL: MxToString - creates string out of matrix variable
in the Wolfram list style like this (for 3x3 matrix): { {
x00, x01, x02 }, { x10, x11, x12 }, { x20, x21, x22 } }
CHANGES FOR EARLIER VERSIONS ARE DOCUMENTED IN RELEASE NOTES DOCUMENT THAT
YOU CAN FIND IN AMIBROKER INSTALLATION FOLDER.