What's new in latest version?
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
Highlights of version 4.90:
- new Fundamental data support including
- automatic download from free Yahoo Finance site
- access to fundamental data from AFL level
- new fundamental data fields in the Information window
- new Web Research window
- user-definable sites
- multiple on-line research windows open simultaneously
- flexible auto-synchronization options
- new Account Manager
- tracking history of all transactions
- tracking open position unrealized profit
- tracking account equity history
- short and long trades, automatic handling of scaling in/out
- unlimited number of accounts
- per-account settings/commissions
- new Bar Replay tool - great learning
tool, featuring
- re-playing all symbols' data at once
- fast scrolling
- user-definable playback speed and interval
- added Text-To-Speech capability via Say()
AFL function. Now AmiBroker can speak out loud any text, for example it can
say "Buy 100 shares of AAPL at 91". This is controllable from formula
level so you can make it to speak depending on market conditions, signals
generated from your formula, etc.
- added ability to fill indicator background with gradient color - via SetChartBkGradientFill AFL
function.
- new Fast Fourier Transform function
- automatic exploration result sorting from AFL level - via SetSortColumns AFL
function.
- high-resolution performance timing added via GetPerformanceCounter,
per-chart timed refreshes via RequestTimedRefresh
- HoldMinDays / EarlyExitDays feature in the backtester
- 'Every tick' chart refresh capability
added (Professional Edition only)
- MDI Tabs added as UI enhancement.
- OLE interface enhancements/additions
For more information about new features please check USAGE NOTES ON NEW
FEATURES.
CHANGES FOR VERSION 5.10.0 (as compared to 5.09.0)
- Small improvement in axis font positioning - based on TEXTMETRIC
- Removed
1-pixel rendering overlap in multi-colored chart titles when ClearType
was enabled
- Hi-Res (256x256) alpha Vista icon
CHANGES FOR VERSION 5.09.0 (as compared to 5.08.0)
- MDI Tab order is now saved in the layout
- Added interface to BugslayerUtil.dll for optional call stack / symbol dump
report in crash recovery window
Now in the bottom of the crash report there is a detailed call stack and
CPU register state. This should allow quicker/easier fixes of any crashes
- New fields in Status() function: pxchart*
Status("pxchartleft") - returns x-coordinate of top-left corner
of chart area
Status("pxcharttop") - returns y-coordinate of top-left corner
of chart area
Status("pxchartright") - returns x-coordinate of bottom-right corner
of chart area
Status("pxchartbottom") - returns y-coordinate of bottom-right
corner of chart area
Status("pxchartwidth") - returns width chart area (right-left)
Status("pxchartheight") - returns width chart area (bottom-top)
Chart co-ordinates are useful because they automatically take into account
selected axis font size, whenever date axis is on or off
and other settings (New Look chart style)
All co-ordinates are in screen pixels. Note that top, left coordinates may
not be zero as chart rectangle is smaller than underlying window because
there is an extra space (padding) around chart.
// Test code:
Title = StrFormat("left=%g,
top=%g, right=%g, bottom=%g, width=%g, height=%g",
left=Status("pxchartleft"),
top=Status("pxcharttop"),
right=Status("pxchartright"),
bottom=Status("pxchartbottom"),
Status("pxchartwidth"),
Status("pxchartheight")
);
GfxSetOverlayMode(1);
GfxRectangle(Left,top,
right, bottom);
============ Overlay sample ================
_SECTION_BEGIN("GfxOverlaySampleNew");
function GetVisibleBarCount()
{
lvb = Status("lastvisiblebar");
fvb = Status("firstvisiblebar");
return Min(
Lvb - fvb, BarCount -
fvb );
}
function GfxConvertBarToPixelX(
bar )
{
lvb = Status("lastvisiblebar");
fvb = Status("firstvisiblebar");
pxchartleft = Status("pxchartleft");
pxchartwidth = Status("pxchartwidth");
return pxchartleft
+ bar * pxchartwidth / ( Lvb - fvb + 1 );
}
function GfxConvertValueToPixelY(
Value )
{
local Miny,
Maxy, pxchartbottom, pxchartheight;
Miny = Status("axisminy");
Maxy = Status("axismaxy");
pxchartbottom = Status("pxchartbottom");
pxchartheight = Status("pxchartheight");
return pxchartbottom
- floor( 0.5 +
( Value - Miny ) * pxchartheight/ ( Maxy - Miny ) );
}
Plot(C, "Price", colorBlack, styleHistogram );
GfxSetOverlayMode(0);
GfxSelectSolidBrush( colorRed );
GfxSelectPen( colorRed );
AllVisibleBars = GetVisibleBarCount();
fvb = Status("firstvisiblebar");
for( i = 0;
i < AllVisibleBars ; i++ )
{
x = GfxConvertBarToPixelX( i );
y = GfxConvertValueToPixelY( C[
i + fvb ] );
GfxRectangle(
x-1, y-1,
x + 2, y+1 );
}
//SetChartBkGradientFill( ColorRGB(200,200,200),
ColorRGB( 255,255,255) );
_SECTION_END();
- OLE: Name property is now writable, allowing switchin currently selected
symbol for the document
Example (JScript):
AB = new ActiveXObject("Broker.Application");
AB.ActiveDocument.Name = "MSFT"; // change the symbol for current
document to "MSFT"
CHANGES FOR VERSION 5.08.0 (as compared to 5.07.0)
- Walk-Forward: "Easy" mode divided into two submodes: EOD and
Intraday
Easy EOD mode assumes that you are using EOD data for walk-forward.
Easy Intraday mode assumes that you are using Intraday data for walk-forward
The difference is that in EOD mode the END date of previous period and START
date of next period are the same - thus avoiding gap
between periods. Intraday mode set START date of the next period as NEXT
DAY after END of previous period. That guarantees
that boundary day is not counted twice when testing on intraday data.
- SetOption("GenerateReport", value )
New option added to SetOption call
" GenerateReport" - 0/1/2
By default backtest reports are generated ONLY for portfolio backtests and
for individual backtests if individual reporting is turned on in the settings.
Reports are disabled for optimization.
Now with the SetOption() function you can either supress report generation
for backtests or enable report generation during certain optimization steps,
all from code level.
SetOption("GenerateReport", 0 ); // suppress generation of report
SetOption("GenerateReport", 1 ); // force generation of full report
SetOption("GenerateReport", 2 ); // only one-line report is generated
(in results.rlst file) viewable as single line in Report Explorer
- Total chart redraw time is calculated properly if multiple documents and
charts are open that results in smoother performance and no update lockup
- When custom color palette is changed, any old RGB color that is not present
in changed palette is matched to closest "standard" color
- Bugfix: when crosshair was enabled and moved OUTSIDE chart windows, then
CPU usage was high. Now it is fixed
- Walk-Forward: when starting date is the last day of the month and step
is n-month then it is treated as special case
AmiBroker now detects that start day is the last day of the month and moves
the window to the last day of NEXT month, even if it is shorter.
That addresses the problem when one starts with January 31 and wants to step
by one month - > since there is NO February 31, previous version
moved to March 3rd. Now it detects that it is last day of the month and moves
to Feb 28 (or 29). Then in next step it will move to March 31.
CHANGES FOR VERSION 5.07.0 (as compared to 5.06.0)
- a bugfix in 5.06 affected Foreign() function so it did not load the data
on very first access - now fixed. This fixes also huge drawdown numbers that
occurred on open positions at the end of trade list if cache size was small
- AFL: SetChartOptions has now 2 more parameters that allow to set custom
scaling
SetChartOptions( Mode = 0, Flags = 0, gridFlags = chartGridMiddle, ymin =
0, ymax = 0 )
new ymin, ymax parameters specify Y-axis minimum and maximum values for custom
scaling.
If you specify any values that meet the condition ymin < ymax, AmiBroker
will turn OFF automatic scaling and use specified min/max values
for Y scale. Note that Mode argument controls when these settings are applied
(0 - only when new chart is created, 1 - always), when modes 2 and 3 are
used - scaling is not changed.
- bugfix: in 5.06.0 deleting the very first symbol raised exception, now
it is fixed
- bugfix: rarely when trade profits gone to absurd levels (for example if
user switched off price checking and used zero as entry price), AmiBroker
would crash when generating profit distribution chart, now it is fixed
- Crosshair moves way faster and flicker is practically eliminated
- Crosshair state is global now and saved between sessions
- Crosshair works now in floating windows and in inactive windows too
- IS, OOS, BEST equity tickers are now put into group 253 and market 253
(composites)
CHANGES FOR VERSION 5.06.0 (as compared to 5.05.1)
- Walk Forward: now you can select "trading days" instead of calendar
days as step unit. Currently it is using simplified method: Mon-Fri as a
trading days
- Walk Forward settings: fixed lockup (due to infinite loop) when step was
set to zero, also added other checks for invalid entries
- RT Quote window: now symbols can be re-arranged by drag-and-drop (simply
click on the symbol, hold and drag to re-arrange order)
- RT Quote window: faster refreshes and multi-step color fading
- RT Quote window: added ability to type-in multiple symbols directly (instead
of selecting one by one or via existing watch list)
- RT Quote window: added ability to insert EMPTY line (to separate symbol
groups)
- Preferences / Currencies: now you can define upto 20 currencies for multiple-currency
backtesting
- New FindSignal function in Backtester object (custom backtester procedure)
allowing fast lookups for signals matching given symbol
bo = GetBacktesterObject();
bo.FindSignal( bar, symbol, type )
where
bar is a bar number
symbol is ticker symbol
type represents type of signal to find: 0 - both entries and exits, 1 -
only entries, 2 - only exits
The function finds for first matching signal that has fPrice != -1 (different
than -1). If 0 is used as type, and entry and exit is on the same bar then
entry signal will be returned. Note: fPrice = -1 is a special marker meaning
that given signal should be ignored.
- Internal symbol pointers stay the same when new symbols are added or deleted.
This addresses exceptions when using AddToComposite during backtests among
other things
This fixes: FC#1101, exceptions when using AddToComposite inside CBT and
exceptions occuring sometimes with COM when adding / removing symbols
- Floating panes are now "sticky" that makes it easier to arrange
the workspace
- Charts: ability to hide vertical quote marker
The control over vertical quote marker is given now via
Parameter dialog -> Axes & Grid -> Vert. quote marker: Show/Hide
And programmatically via SetChartOptions function:
SetChartOptions( 2, chartHideQuoteMarker );
- Bugfix: when "pad and align" was used in AA and reference symbol
did not have all trading days, the data used for very first symbol in the
watch list under test could have been unaligned for the very first AA run,
subsequent runs were OK)
- Alert Output column sizes / layout are now preserved between sessions
- Added two new backtest modes: backtestRegularRaw2 and backtestRegularRaw2Multi
that do not remove excess EXIT signals
The common thing between Raw and Raw2 modes is that they both do NOT remove
excess ENTRY signals.
The difference is that Raw modes remove excess EXIT signals, while Raw2 do
NOT.
In Raw2 modes all exit signals (even redundant ones) are passed
to second phase of backtest just in case that you want implement strategy
that skips first exit. Lets suppose that you want to exit on some condition
from first phase but only in certain hours or after certain numbers of bars
in trade or only when portfolio equity condition is met. Now you can do that
in raw2 modes.
Note that Raw2 modes can get significantly slower when you are using custom
backtester code that iterates thru signals as there can be zillions of exit
signals in the lists even for symbols that never generated any entry signals,
therefore it is advised to use it only when absolutely necessary. Raw2 modes
are also the most memory consuming.
Note also that if you run the system WITHOUT custom backtest procedure
there should be no difference between Raw and Raw2 modes (other than speed & memory
usage) as first matching exit signal is what is used by default.
- 3D chart viewer: process priority is now set to IDLE
- 3D chart viewer: animation is now smoother (upto 100fps vs 25fps)
CHANGES FOR VERSION 5.05.1 (as compared to 5.05.0)
- Walk Forward AA Settings: added error message when start date > end
date
- Walk Forward AA Settings: added "preview" list - showing all
IS and OOS segments with dates
CHANGES FOR VERSION 5.05.0 (as compared to 5.04.2)
- Walk Forward: "Easy" mode in the settings implemented - it sets "out-of-sample" parameters
automatically based on in-sample settings
- GetCursorMouseButtons new flag = 8 - means that current chart just received
mouse click
/////////////////////////////////////////////////
// Low-level graphic + Interactive GUI control
sample
// This example shows:
// 1. how to draw "buttons"
// 2. how to handle mouse clicks
// 3. how to implement event call-backs
///////////////////////////////////////////////////
Version( 5.04 ); //
requires 5.04 or higher
////////////////////////////////////////////////////
// Part 1: DRAWING TABLE OF BUTTONS
//////////////////////////////////////////////////
GfxSetOverlayMode( 2 );
// formatted text output sample via low-level
gfx functions
CellHeight = 20;
CellWidth = 100;
GfxSelectFont( "Tahoma",
CellHeight/2 );
GfxSetBkMode( 1 );
function PrintInCell(
string, row, Col )
{
GfxDrawText( string,
Col * CellWidth, row * CellHeight, (Col + 1 )
* CellWidth, (row + 1 )
* CellHeight, 0 );
}
GfxSelectPen( colorBlue );
for( i = 0;
i < 10 && i < BarCount;
i++ )
{
for( k = 0;
k < 5; k++ )
{
PrintInCell( "Button " +
i + "," + k, i, k );
}
GfxMoveTo( 0,
i * CellHeight );
GfxLineTo( 5 *
CellWidth, i * CellHeight );
}
GfxMoveTo( 0,
i * CellHeight );
GfxLineTo( 5 *
CellWidth, i * CellHeight );
for( Col = 1;
Col < 6; Col++ )
{
GfxMoveTo( Col * CellWidth, 0);
GfxLineTo( Col * CellWidth, 10 *
CellHeight );
}
/////////////////////////////////////////////////////////
// Part 2: MOUSE BUTTON CALL BACKS
//////////////////////////////////////////////////////////
Title="";
function DrawButton(
px, py, Clr1, Clr2, text )
{
Col = floor(
px / CellWidth );
Row = floor(
py / CellHeight );
GfxGradientRect(
Col * CellWidth, row * CellHeight, (Col + 1 )
* CellWidth, (row + 1 )
* CellHeight,
Clr1,
Clr2 );
PrintInCell( text + " " +
row + "," + Col, row, Col
);
}
function OnLMouseButton(x,
y, px, py)
{
_TRACE("LButton
x = " + DateTimeToStr(
x ) + " y = " + y );
DrawButton( px, py, ColorHSB( 50, 255, 255 ), ColorHSB( 90, 255, 255 ), "just
clicked" );
}
function OnRMouseButton(x,
y, px, py)
{
_TRACE("RButton
x = " + DateTimeToStr(
x ) + " y = " + y );
}
function OnMMouseButton(x,
y, px, py)
{
_TRACE("MButton
x = " + DateTimeToStr(
x ) + " y = " + y );
}
function OnHoverMouse(x,
y, px, py)
{
_TRACE("LButton
x = " + DateTimeToStr(
x ) + " y = " + y );
DrawButton( px, py, ColorRGB( 230, 230, 230 ), ColorRGB( 255, 255, 255 ), "mouse
over" );
}
function OnLButtonIsDown(x,
y, px, py)
{
_TRACE("LButton
x = " + DateTimeToStr(
x ) + " y = " + y );
DrawButton( px, py, ColorHSB( 190, 255, 255 ), ColorHSB( 210, 255, 255 ), "down" );
}
/////////////////////////////////////////////////////////
// Part 3: GENERAL PURPOSE EVENT HANDLER (reusable!
- may be put into "include" file)
////////////////////////////////////////////////////////
function EventHandler()
{
local b, x,
y, px, py;
b = GetCursorMouseButtons();
// retrieve co-ordinates in date/value units
x = GetCursorXPosition(0);
y = GetCursorYPosition(0);
// retrieve co-ordinates in pixel units
px = GetCursorXPosition(1);
py = GetCursorYPosition(1);
if( b & 8 ) //
flag = 8 is set when window just received mouse click
{
// not-null means clicked in THIS (current)
window
if(
b & 1 ) OnLMouseButton(
x, y, px, py );
if(
b & 2 ) OnRMouseButton(
x, y, px, py );
if(
b & 4 ) OnMMouseButton(
x, y, px, py );
}
else
{
if(
b == 0 ) OnHoverMouse(
x, y, px, py ); // no button pressed
if(
b == 1 ) OnLButtonIsDown(
x, y, px, py ); // button pressed
}
}
EventHandler();
RequestTimedRefresh( 1 );
- GetCursorXPosition/GetCursorYPosition return non-null values when mouse
is over the current chart regardless if it was clicked or not
- BUGFIX: trend line sometimes moved to the right edge when drawing/moving
them while two charts were opened in different periods
- Selector line is not drawn (does not blink) when GfxOverlayMode is set
to 2
- Walk Forward document can now be closed and/or hidden during WF (it is
not re-opened constantly)
CHANGES FOR VERSION 5.04.2 (as compared to 5.04.1)
- New log scale (5.04.1) was not working nicely for small dynamic range charts
- chart looked compressed. Fixed now.
- Chart Periodicity on MDI tab is now updated when switching
- Trendlines work fine with thick and dotted styles again (broken in 5.04)
- AFL: GetCursorXPosition/GetCursorYPosition functions changed
1. The functions now by default return NULL (empty value) if mouse is OUTSIDE
the current window
2. New "mode" parameter controls what values are returned
GetCursorXPosition( mode = 0 )
GetCursorYPosition( mode = 0 )
mode = -1 - (old compatibility mode) - x - value gives X-coordinate in
DateTime format. y - value gives PRICE. Values are reported no matter where
is the mouse (i.e. may refer to window different than current if mouse
is outside current window).
mode = 0 - (default) x - value gives X-coordinate in DateTime format. y
- value gives PRICE. Returns NULL if mouse is outside current window
mode = 1 - x, y - are mouse coordinates expressed in screen PIXELS. Returns
NULL if mouse is outside current window
CHANGES FOR VERSION 5.04.1 (as compared to 5.04.0)
- WF: Settings "Optimization target" combo box shows all built-in
fields now
- WF: now combined in-sample and out-sample equities are available by ~~~ISEQUITY
and ~~~OSEQUITY composite tickers
(consecutive periods of IS and OOS are concatenated and scaled to maintain
continuity of equity line - this approach assumes that you generally speaking
are compounding profits)
To display IS and OOS equity you may use for example this:
PlotForeign("~~~ISEQUITY","In-Sample
Equity", colorRed, styleLine);
PlotForeign("~~~OSEQUITY","Out-Of-Sample
Equity", colorGreen, styleLine);
Title = "{{NAME}}
- {{INTERVAL}} {{DATE}} {{VALUES}}";
- WF: in-sample best uses "first best" result consistenly instead
of quicksort (that did not prevent original order)
- WF: the output window is re-open when user closes it during Walk Forward
optimization
- Log chart scaling enhanced to handle nicely extreme dynamic range
CHANGES FOR VERSION 5.04.0 (as compared to 5.03.0)
- AFL Formula Editor: Copy-paste does not "eat" last character
- AFL Formula Editor: Edit->Prettify Selection function added
- Calling Activate() method of Window object does not maximize MDI window
any more
- Print Preview works fine now with floating windows
- Walk-Forward Optimization implemented (v1)
CHANGES FOR VERSION 5.03.0 (as compared to 5.02.2)
- Fixed: Pane/Template options do not work on floating window
- Added: Interval linking
- New linking settings are now saved in layouts and restored properly
- (re-)added: Cursor linking - selector line moves together in symbol and/or
linked charts
- Removed File->New->Linked chart (new linking replaces this functionality)
- Fixed: Layouts with old-style linked charts are now automatically converted
into new scheme when loading layout
CHANGES FOR VERSION 5.02.2 (as compared to 5.02.1)
- fixed problem with c-like multi-line comments /* */ that appeared in 5.02.1
beta
CHANGES FOR VERSION 5.02.1 (as compared to 5.01.1)
- Implemented Unlimited nesting of #include and #include_once
- True multi-monitor support. Chart windows can now be floated (outside main
application frame) and moved to different monitors
- Implemented new way of symbol-linking of charts (the button next to scrollbar
allows to choose linked group (1-9))
- Fixed crash when attempting to backtest on empty watch list (bug introduced
in 5.01)
- AFL: SetBarFillColor( colorarray ) allows to independently control candlestick,
bar, cloud, and area chart fill color
- OLE: when Broker.Application reference count drops to zero and AB was not
running prior to CreateObject() then the AB is closed
- Implemented workaround to Windows XP list view drawing bug (MS KB813791)
- Floating pane title is synchronized now (5.02.0 fix)
CHANGES FOR VERSION 5.01.1 (as compared to 5.01.0)
- fixed loading of customized toolbars
- toolbar customizations are now stored in Broker.exe-CommandBars51 (number
increased) to isolate new betas and old versions
CHANGES FOR VERSION 5.01.0 (as compared to 5.00.0)
- Tweaks in backtester for improved performance
Portfolio backtester on average 2x faster for both multiple and single-security
tests (some trivial, frequently trading systems may observe upto 5x speedup
on multiple securities during long analysis periods). Note that AFL engine
speed has NOT changed as compared to 5.00. Speed increase comes from backtester
tweaks alone, so the longer AFL code is the less speed-up you will see,
because backtester processing would account for smaller part of overall
execution time.
- Tweaks in quote handling for improved performance
- Code profiler - shows code analysis with detailed per-function timing report.
Available from AFL Editor: Tools->Code Check & Profile menu
CHANGES FOR VERSION 5.00.0 (as compared to 4.99.0)
- Database Purify: Date column type in set correctly now so clicking on
column sorts by date instead of by alpha (FC#1130)
- Elapsed/estimated time
is updated constantly when running long optimizations (FC#1107)
- Extra characters
in the title occuring when using dynamic color with Null values in Plot()
statements. Fixed. (FC#1129)
- Fixed saving of new commission table (FC#1122)
- In some cases slider did
not allow to reach the upper margin of Param() when step was decimal fraction
like 0.1 due to floating point rounding.
Now it addressed.
(FC#1155)
- Price Chart Style is now saved in a layout/template (FC#1039)
- When Find/Replace
dialog is still open while Formula Editor is closed it does not cause exception
anymore
CHANGES FOR VERSION 4.99.0 (as compared to 4.98.0)
- A warning added when closing the last chart window
- Fixed possible stack overflow when using ASCII importer for files without
extension but with . (dot) in a path (directory) name
- TimeFrameMode(3) (range mode) was not functional in 4.98, now it is fixed
- Fixed calculation of profit of leveraged instruments denominated in non-base
currency when dynamic fx rate was used
- Private heap allocator implemented for quotes and for trading signals
This should resolve problem of getting "out of memory" problem
that could occur during very long optimizations due to poor handling of virtual
memory in Windows.
CHANGES FOR VERSION 4.98.0 (as compared to 4.97.0)
- N-tick intervals from View->Intraday menu are enabled again in tick
databases (were disabled in 4.97 only)
- AFL: Status() function: 2 new fields added
"
axisminy" - retrieves the minimum (bottom) value of Y axis (indicators
only)
"
axismaxy" - retrieves the maximum (top) value of Y axis (indicators
only)
Example 1:
Title = "Axis
Min Y = " + Status("axisminy")
+ "Axis Max Y = " + Status("axismaxy");
Example 2:
SetChartOptions( 3, 0,
ChartGridMiddle );
axismin = Status("axisminy");
axismax = Status("axismaxy");
Plot( C, "Price", colorBlack, styleBar );
// draw exactly 5 grid lines
for( i = 0;
i < 5; i++ )
{
y = axismin + i * (axismax - axismin)/4;
PlotGrid(
y, colorRed );
}
- HTML export / import now store extra information about the kind of file
exported so when you export optimization result and re-import it later you
will be able to use optimization graph (FC#: 1029)
- HTML import: sometimes when importing large files duplicate rows appeared
at the end - now it is fixed (FC#1024)
- Fixed formatting of numeric values above 100000 after HTML import when
comma used as thousands separator (FC#: 1029)
- Added protection against using file-system reserved characters (*?#:|></"\)
in watch list names
- Implemented 5-tier commission schedule table in backtester (AA->Settings:
Commission table : DEFINE...) (FC#270)
- Account Manager: commission was not subtracted from equity when scaling-in
position that was open in previous amibroker run, now it is fixed
- Fixed problem with "Use only local database for this symbol" being
set to "yes" during loading of the database with absent broker.master
file
CHANGES FOR VERSION 4.97.0 (as compared to 4.96.0)
- Range Bar compression implemented now (FC#: 210, 1041,897,284)
Range Bars are price-driven bars, with each bar having a required minimum
high-low range. Source data are consolidated into one bar until the range
requirement is reached, then a new bar is started. It works best with tick
data that have only one price per data point. You can use it with other base
time intervals as well, but please note that if single source bar H-L range
exceedes desired range, the output will be single bar that has range higher
than requested. In other words source bars exceeding desired range won't
be splitted into several range bars. For example if you use 1 minute bars
and there is $3 dollar movement and you have selected $1 range bars it won't
be splitted into 3 bars. Instead you will get single bar with original $3
range.This is so because AB has no idea what happened *inside* the bar. Prices
could move first downwards and later upwards or opposite or zigzaging several
times or making any other pattern inside bar and this information is not
available from source bar that only has OHLC prices. Note that range bar
compression is not standarised. Some other softwares may attempt to split
to several artificial bars when range is exceeded, but we belive it is wrong
since it is based on assumptions about price action inside bar that may and
usually are wrong.
Range bars can now be selected as custom compression from Tools->Preferences->IntradayRange
bars are also available via TimeFrameMode() function
TimeFrameMode( 3 ); //
turn on range bars
TimeFrameSet( 1.5 ); //
set compression to 1.5$ range bar
- Mersene Twister MT19937 random number generator added
Two new AFL functions:
mtRandom( seed = Null ) - returns single random number (scalar) in the range
[0,1)
mtRandomA( seed = Null ) - returns array of random numbers in the range of
[0,1)
seed is random generator seed value. If you don't specify one, the random
number generator
is automatically initialized with current time as a seed that guarantees
unique sequence
Both functions use Mersene Twister mt19973ar-cok algorithm.
(Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura.)
Mersene Twister is vastly superior to C-runtime pseudo-random generator
available via Random() function.
It has a period of 219973 = approx 2.9*106012 For more information visit:
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
See also:
M. Matsumoto and T. Nishimura, "Mersenne Twister: A 623-Dimensionally
Equidistributed Uniform Pseudo-Random Number Generator", ACM Transactions
on Modeling and Computer Simulation, Vol. 8, No. 1, January 1998, pp 3--30.
- AFL: PopupWindow() function added (FC#: 840)
SYNTAX:
PopupWindow( bodytext, captiontext, timeout = 5, left = -1, top = -1 );
bodytext - the string containing the text of the window body
caption - the string containing the text of window caption
timeout - auto-close time in seconds (default 5 seconds)
left - top-left corner X co-ordinate (default = -1 -means auto-center)
top - top-left corner Y co-ordinate (default = -1 - means auto-center)
Example code:
if( ParamTrigger("Display
Popup Window", "Press
here" ) )
{
PopupWindow("Current
time is: " + Now(),"Alert", 2, 640*mtRandom(), 480*mtRandom());
}
- ASCII Importer: $TIMESHIFT option added (FC# 1094)
Added ability to time-shift data at the time of the import.
$TIMESHIFT shift_in_hours
For example:
$TIMESHIFT 2
will import with date/time stamps shifted 2 hours forward
$TIMESHIFT -11.5
will import with date/time stamps shifted 11 and half hour backward
Please note that only INTRADAY data (with TIME component provided) are shifted.
EOD data (without time field) are unaffected.]
- AFL: GetPlaybackDateTime() (FC#: 837)
pt = GetPlaybackDateTime(); //
new function to retrieve playback position date/time,
//returns zero if bar replay is NOT active
if( pt )
{
Title = "Playback
time: " + DateTimeToStr(
pt );
}
else
{
Title = "Bar
Replay not active";
}
It returns zero if bar replay is not active.
- Fixed lockup when bar replay was attempted on base time interval = tick
- Fixed passing IDispatch parameters to OLE/COM method calls
- Fixed error message typo in SetCustomBacktestProc (FC: 1085) "exit" vs "exist"
- 3D optimization chart viewer: added 4x4 Full Screen Anti-Aliasing for
beautifully smooth 3D charts and improved readability
4x4 Full-Screen Anti-Aliasing (FSAA) feature is available only on graphic
cards that support this in hardware (all NVidia GeForce cards, and most recent
graphic cards that have 3D acceleration). It is not available for low-end
graphic cards sometimes found in the cheapest notebooks.
If FSAA is not supported by the hardware View->Anti-aliasing menu item
will be disabled (grayed).
If FSAA is supported in hardware then it will be turned on by default.
Note that animation speed with FSAA turned on may be lower on slower graphic
cards. If speed is not acceptable you can turn off anti aliasing by unchecking
View->Anti-aliasing menu (or turning off "A" button in the toolbar)
of 3D chart viewer (O3G.exe).
CHANGES FOR VERSION 4.96.0 (as compared to 4.95.0)
- HTML Import to AA result list implemented (FC#579)
Note that this feature is intended to import only HTML files exported by
AmiBroker. The HTML parser used is specifically written for this particular
purpose and expects certain layout of HTML file. HTML files saved by other
programs can not be imported. Use Automatic Analysis -> File -> Import
to access this feature.
- Account manager: added "per-trade" commission setting (FC#: 973)
- Two new backtester modes that do not remove redundant signals (FC#: 105)
- RAW MODE: signal-based backtest, redundant (raw) signals are NOT
removed, only one position per symbol allowed:
- RAW MODE WITH MULTIPLE POSITIONS - signal-based backtest, redundant
(raw) signals are NOT removed, MULTIPLE positions per symbol will be
open if BUY/SHORT signal is "true" for more than one bar
and there are free funds, Sell/Cover exit all open positions on given
symbol, Scale-In/Out work on all open positions of given symbol at
once.
- AFL: new function SetBacktestMode( mode )
Sets working mode of the backtester:
// default, as in 4.90, regular, signal-based
backtest, redundant signals are removed
SetBacktestMode(
backtestRegular );
// signal-based backtest, redundant (raw)
signals are NOT removed, only one position per symbol allowed
SetBacktestMode(
backtestRegularRaw );
// signal-based backtest, redundant (raw)
signals are NOT removed,
// MULTIPLE positions per symbol will
be open if BUY/SHORT signal is "true" for more than one bar and there
are free funds
// Sell/Cover exit all open positions
on given symbol, Scale-In/Out work on all open positions of given
symbol at once.
SetBacktestMode(
backtestRegularRawMulti );
// rotational trading mode - equivalent
of EnableRotationalTrading() call
SetBacktestMode(
backtestRotational );
- AA window: custom draw buttons (with arrows) are redrawn on killfocus
event to prevent flickering
- Fix: when symbol is deleted from database it is removed from all new watchlists
as well
- Attempt to assign value to the element of the array named the same as the
function inside the function declaration produces error 33 now instead of
crash (FC#: 1011)
- Clicking RMB->Watchlist->Remove inside watch list node was removing
symbol from all watch lists. Now it is fixed.
- Fixed cell text truncation that could happen randomly when using HTML
export
- Position of compound drawings (retracements/cycles) is updated correctly
now when "Properties" dialog was choosen from without selecting
the drawing via LMB click
- Stops were reset to default values (from settings) when custom backtest
routine was stored in separate file (not embedded or included in the formula).
Now it is fixed
CHANGES FOR VERSION 4.95.0 (as compared to 4.94.0)
- Added support for AFL Code Wizard (Analysis->AFL Code Wizard menu
and toolbar button)
AFL Code Wizard is a new add-on for AmiBroker. It allows creation
of trading system formulas without ANY programming experience. It is available
for purchase for $49 one-time fee. Further upgrades are free. AmiBroker
comes with trial version that has all functionality *including* export
of auto-generated AFL formula to AmiBroker. The only missing feature in
trial version of AFL COde wizardis saving the project in .awz format.
To run it select Analysis->AFL Code Wizard menu.
AFL Code Wizard instructional video can be found at: http://www.amibroker.com/video/amiwiz/AFLWiz1.html
- Symbol Tree->Right click->Watch List->Type In works from any
node now (FC#991)
- Filter window supports more than 256 watchlists (FC#1006)
- Aliases are properly recognized when adding symbols to new watchlists
CHANGES FOR VERSION 4.94.0 (as compared to 4.93.0)
- AFL: 23 new low-level graphic functions allowing Windows GDI-like painting
Completely new low-level graphic AFL interface allows complete flexibility
in creating any kind of user-defined display.
The interface mimics closely Windows GDI API, with same names for most functions
for easier use for GDI-experienced programmers. The only differences are:
1. compared to Windows GDI all functions are prefixed with 'Gfx'
2. pen/brush/font creation/selection is simplified to make it easier to use
and you don't need to care about deletion of GDI objects
3. Three overlay modes are available so you can mix low-level graphics with
regular Plot() statements
(mode = 0 (default) - overlay low-level graphic on top of charts, mode =
1 - overlay charts on top of low-level graphic, mode =2 - draw only low-level
graphic (no regular charts/grid/titles/etc))
Low-level graphics tutorial: http://www.amibroker.com/guide/h_lowlevelgfx.html
Available low-level gfx functions (click on the links for detailed explanation):
GfxMoveTo( x, y ) http://www.amibroker.com/f?gfxmoveto
GfxLineTo( x, y ) http://www.amibroker.com/f?gfxlineto
GfxSetPixel( x, y, color ) http://www.amibroker.com/f?gfxsetpixel
GfxTextOut( "text", x, y ) http://www.amibroker.com/f?gfxtextout
GfxSelectPen( color, width = 1, penstyle = penSolid ) http://www.amibroker.com/f?gfxselectpen
GfxSelectSolidBrush( color ) http://www.amibroker.com/f?gfxselectsolidbrush
GfxSelectFont( "facename", pointsize, weight = fontNormal,
italic = False, underline = False, orientation = 0 ) http://www.amibroker.com/f?gfxselectfont
GfxRectangle( x1, y1, x2, y2 ) http://www.amibroker.com/f?gfxrectangle
GfxRoundRect( x1, y1, x2, y2, x3, y3 ) http://www.amibroker.com/f?gfxroundrect
GfxPie( x1, y1, x2, y2, x3, y3, x4, y4 ) http://www.amibroker.com/f?gfxpie
GfxEllipse( x1, y1, x2, y2 ) http://www.amibroker.com/f?gfxellipse
GfxCircle( x, y, radius ) http://www.amibroker.com/f?gfxcircle
GfxChord( x1, y1, x2, y2, x3, y3, x4, y4 ) http://www.amibroker.com/f?gfxchord
GfxArc( x1, y1, x2, y2, x3, y3, x4, y4 ) http://www.amibroker.com/f?gfxarc
GfxPolygon( x1, y1, x2, y2, ... ) http://www.amibroker.com/f?gfxpolygon
GfxPolyline( x1, y1, x2, y2, ... ) http://www.amibroker.com/f?gfxpolyline
GfxSetTextColor( color ) http://www.amibroker.com/f?gfxsettextcolor
GfxSetTextAlign( align ) http://www.amibroker.com/f?gfxsettextalign
GfxSetBkColor( color ) http://www.amibroker.com/f?gfxsetbkcolor
GfxSetBkMode( bkmode ) http://www.amibroker.com/f?gfxsetbkmode
GfxGradientRect( x1, y1, x2, y2, fromcolor, tocolor ) http://www.amibroker.com/f?gfxgradientrect
GfxDrawText( "text", left, top, right, bottom, format
= 0 ) http://www.amibroker.com/f?gfxdrawtext
GfxSetOverlayMode( mode = 0 ) http://www.amibroker.com/f?gfxsetoverlaymode
- AFL: Two new fields in Status() functions: pxwidth and pxheight (
Status("pxwidth") - gives pixel width of chart window (useful for
low level graphics functions that operate on pixels)
Status("pxheight") - gives pixel height of chart window
- Better scaling and no more black rectangle on the bottom in images created
via Edit->Image->Copy / Export
- "New Look" charts (switchable via Tools->Preferences "Charting")
- give cleaner, larger and more readable chart display and printout
- Printing/copy-metafile function uses now Enhanced Metafile format that
handles clipping regions (styleClipMinMax)
CHANGES FOR VERSION 4.93.0 (as compared to 4.92.0)
- Fixed exception that maight occur when copying to clipboard very long lines
from AA result list
- CategoryGetName() now returns empty string for non-existing categories
instead of some uninitialized (random) string
- Fixed exception when trying to apply commentary on blank chart pane
- AFL editor fix: right Alt + z does not trigger 'undo' anymore (allows
to enter Polish z (z-dot-above) letter)
- Fixed exception occuring when Symbol Information was edited at the same
time while first auto-analysis was run
- Fixed bar replay not functioning when viewing interval was the same as
base time interval and set to less than 5 minute, mixed mode was off, and
no afterhours/weekend filtering was enabled (FC#: 899)
- Fix: defined FXRate for the very first symbol in the database is used
correctly now (FC#: 975)
- When LoadFormula() method of Analysis object is called parameters are
reset now (FC#: 958)
- Ability to export Chart in "portable" format so you can distribute
chart templates to others and they will be restored together with all linked
formulas (FC#: 96)
This feature is available from RIGHT CLICK on chartTemplate->Save...Template->Load...
menus.
In addition to old local template format a new one is added with .chart extensionthat
keeps not only window sizes and formula references (paths) but also formulas
themselves,so all you need to do is to save your chart into one file (Chart
Template, Complete *.chart)and copy that file onto different computer and
chart will be recreated with all formulas linked to it.
To Save chart into new format do the following:
1. Click with RIGHT MOUSE button over the chart and select Template->Save...
2. In the file dialog, "Files of type" combo select "Chart
Template, Complete (*.chart)"
3. Type the file name and click Save.
To load previously saved complete chart do the following:
1. Click with RIGHT MOUSE button over the chart and select Template->Load...
2. In the file dialog, select previously saved *.chart file and press "Open"
Note: The procedure AmiBroker does internally is as follows: When you save
the chart into new format it saves XML file with:
a) names of all sheets, panes, their sizes, locations and other settings
b) paths to all formulas used by all panes
c) the text of formulas themselves
When you load the chart in new format AmiBroker:
a) sets up the sheets/panes according to information stored in the file
b) for each formula stored in the file it checks if the same formula exists
already on target computer:
- if it does not exist - it will create one
- if it exists and the contents is identical to the formula stored in .chart
file it will do nothing
- if it exists and the contents is different then it will create NEW formula
filewith _imported.afl suffix (so old file is not touched) and will reference
the pane to the _imported.afl formula instead.
IMPORTANT NOTE: if you use any #include files AmiBroker will store the contentsof
include files as well inside chart file and will attempt to recreate them
on target machine.Please note that in case of includes it will check if it
exists and if it is different.If both conditions are met (different file
exists already) it will ask to replace or not.If you choose to replace -
it will replace and make backup of existing one with .bak extensionIf you
are using any files in "standard include files and include them using <> braces,
AmiBroker will restore files in target machine standard include folder as
well evenif the standard include folder path is different on the source machine).
Note also - that this functionality is a bit experimental and pretty complex
internally. There may be some bugs even though it was tested on number of
different setups. Feedback is welcome. It is intended to be used to port
charts between different computers. For storing layouts/templates on local
computer you should rather use old formats as they consume much less space
(they store only references,not the formulas themselves). One may however
use new format for archiving purposes as itkeeps formulas and all references
in one file that is very convenient for backups.
CHANGES FOR VERSION 4.92.0 (as compared to 4.91.1)
- Watch list tooltips now show WL ordinal number (index), name and symbol
count
- new menu item "WatchLists->Hide Empty watchlists" allows
to show/hide empty watchlists
Note that when you add new watch list AmiBroker will automatically unhide
empty watch lists so you can see newly added list.
- AFL: Category* functions work fine now with more than 256 watch lists
- AFL: new function: CategoryFind() allows to search for category by name
SYNTAX: CategoryFind( "name", category )
RETURNS: number
FUNCTION: It allows to search for category by name. It takes category name
and kind as parameters and returnsINDEX (ordinal number). For example it
allows to find watch list index by name:
wlnumber = CategoryFind("MyWatch
List 1", categoryWatchlist );
mysymbols = CategoryGetSymbols(categoryWatchlist,
wlnumber );
The index (in the above example watch list number) can be later used in functions
thatneed the index (like CategoryGetSymbols).
- AFL: new function: InWatchListName() allows to reference watch list by
name
It is equivalent to InWatchList function except that it takes watch list
name as parameter instead of the index.
SYNTAX InWatchListName( "listname" )
RETURNS NUMBER
FUNCTION Checks if the stock belongs to a watch list having name of listname.
If yes - the function returns 1 otherwise 0.
EXAMPLE
Filter= InWatchListName( "mywatchlist" ) OR InWatchListName( "mysecondwatchlist" );
Note that this function is a bit slower than InWatchList() function.
- Fixed Watch List Export - now exports from selected watch lists (not only
from watch list number zero)
If you select only one watch list to export then original symbol order is
preserved, multiple watch list export uses alphabetical order to prevent
duplicates.
- Fixed Watch List Sorting - now sorts selected watch list (not only watch
list number zero)
CHANGES FOR VERSION 4.91.1 (as compared to 4.91.0)
- fixed symbol tree refresh after Watchlist->Import
CHANGES FOR VERSION 4.91.0 (as compared to 4.90.5)
- AA: new options in the context menu "Replace watch list with the
results/selected results"
This new option empties the watch list before adding results. The order of
symbols in the result list is preserved in the watch list.
- Watchlists: context (right click) menu - now there is no WL selection dialog
displayed
If you select the watch list from symbol tree and click with RIGHT mouse
button to bring up watch list menu the selected watch list is used automatically
and watchlist selector dialog is not displayed.
- Watchlists: redesign - now there is no limit on number of watch lists you
can use
a) watch lists are now stored as text files inside "Watchlists" folder
inside database. The folder contains of any number of .TLS files with watch
lists themselves and index.txt that defines the order of watch lists. You
can add your own .tls file (one symbol per line) and AmiBroker will update
index.txt automatically (adding any new watch lists at the end)The .TLS files
can also be open in AmiQuote.
b) watch lists remember the order in which symbols were added, so for example
if you sort AA result list in some order and then you"add symbols
to watch list" the order will be kept in the watch list.
c) you can now Add/Delete watch lists using Symbol->Watch List-> menu
or from watch list context menuNote that if you have done any customization
to the menu, you may need to go to Tools->Customize, select "Menu
Bar" and press "Reset" button for this new menu items to
appear.
d) you can now alphabetically sort the symbols in the watch list
e) all watch lists are shown in the symbol tree now, even if they are empty.
f) for backward compatibility OLE automation WatchListBits/WatchListBits2
properties of Stock object continue to work for first 64 watch lists
(bit states are transparently emulated)
g) Watch lists created in 4.91 are not visible for older versions
-
When changing selected symbol, the tree is not traversed to the bottom
(root). Instead only current branch is checked and if symbol is selected
only if it is present under this branch (This prevents unnecessary unfolding
of "All" and other branches)
-
AFL Editor: AUTOWORDSELECTION turned off
-
AFL: switch/case statement added (completed: 2007-03-31) (ext.ID: 580).
More information: http://www.amibroker.com/guide/v50/keyword/switch.html
Example:
for(
n = 0; n < 10;
n++ )
{
printf("Current
n = %f\n", n );
switch(n)
{
case 0:
printf("The
number is zero.\n");
break;
case 3:
case 5:
case 7:
printf("n
is a prime number\n");
break;
case 2: printf("n
is a prime number\n");
case 4:
case 6:
case 8:
printf("n
is an even number\n");
break;
case 1:
case 9:
printf("n
is a perfect square\n");
break;
default:
printf("Only
single-digit numbers are allowed\n");
break;
}
-
AFL: break/continue statements added (supported inside for/while/do-while/switch
statements). More information:
http://www.amibroker.com/guide/v50/keyword/break.html
http://www.amibroker.com/guide/v50/keyword/continue.html
Example:
for(i
= 1; i < 1000;
i *= 2 )
{
if(
i > 50 ) break;
printf("%f\n",
i );
}
- AFL: new C-like assignment operators +=, -=, *=, /=, %=, &=, |=
New operators are shortcuts for some common operations.
x += y; is equivalent to x = x + y;
x -= y; is equivalent to x = x - y;
x *= y; is equivalent to x = x * y;
x /= y; is equivalent to x = x / y;
x %= y; is equivalent to x = x % y;
x &= y; is equivalent to x = x & y; // bitwise and
x |= y; is equivalent to x = x | y; // bitwise or
-
Enanced display in Real Time Quote window (dual-step change coloring -
when field changes it is highlighted with bright yellow for 0.25 second
then color changes to pale yellow and after a while to default (white)
background))
CHANGES FOR EARLIER VERSIONS ARE DOCUMENTED IN RELEASE NOTES DOCUMENT THAT
YOU CAN FIND IN AMIBROKER INSTALLATION FOLDER.