AmiBroker 5.09.0 Beta Read Me
April 30, 2008 17:21
THIS IS A BETA VERSION OF THE SOFTWARE. EXPECT BUGS !!!
Backup your data files and entire AmiBroker folder
first!
INSTALLATION INSTRUCTIONS
IMPORTANT: This archive is update-only. You have to install full version
5.00 first.
Just run the installer and follow the instructions.
Then run AmiBroker. You should see "AmiBroker 5.09.0 beta" written
in the About box.
See CHANGE LOG below for detailed list of changes.
CHANGE LOG
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
If you experience any problem with this beta version please send detailed
description of the problem (especially the steps needed to reproduce it) to
support at amibroker.com