AmiBroker 4.99.0 Beta Read Me
August 11, 2007 22:43
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
4.90 first.
Just run the installer and follow the instructions.
Then run AmiBroker. You should see "AmiBroker 4.99.0 beta" written
in the About box.
See CHANGE LOG below for detailed list of changes.
CHANGE LOG
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))
If you experience any problem with this beta version please send detailed
description of the problem (especially the steps needed to reproduce it) to
bugs at amibroker.com