AmiBroker 5.80.0 RC1 Read Me
June 4, 2014 15:55
Backup your data files and entire AmiBroker folder
first!
INSTALLATION INSTRUCTIONS
Just run the installer and follow the instructions.
Then run AmiBroker. You should see "AmiBroker 5.80.0 RC1" written
in the About box.
See CHANGE LOG below for detailed list of changes. Note that only changes
that affect end-user directly are listed here. Internal code changes/refactoring
is usually not mentioned.
CHANGE LOG
CHANGES FOR VERSION 5.80.0 (as compared to 5.79.0)
- New Analysis: An error 709 is displayed when user specified so many Optimize()
calls that search space is larger than 10^19 combinations (100 times more
than the age of The Universe in seconds)
- New Analysis: progress bar update
is forced so even if program is 100% busy
the progress bar gets repainted
- New Analysis: "the analysis is in progress" text
was not always cleared after analysis has completed. Fixed.
- New Editor: Param
info is displayed even when there are spaces between identifier and opening
brace
- New Editor: A full path to formula is displayed in the Status bar when
mouse hovers over formula name edit
- New Editor: pressing ENTER just after
identifier name resulted in auto-change case function ommitting first letter
of the word. Fixed
- New Editor: added Window->Keep On Top menu (in separate
frame mode)
- New Editor: Auto-complete pop up in immediate mode now does not
appear when editing existing word in the middle, but it is available on demand
(Ctrl+SPACE)
- AFL: increased maximum acceptable value for ThreadSleep function
to 1000 ms, and added appropriate level2 warning
- AFL: Error 52 wording changed
from 'argument must be positive' to 'argument must be greater than zero'
- UI: when any non-modal dialog was displayed, activation of the app always
brought up main frame in front possibly hiding New Editor. Fixed.
- UI: removed "use
new editor" option from Preferences window. New
editor is always used now.
- UI: Main frame is now disabled (modal) when file
dialog is open from AFL editor
- Pre-processor errors occuring in run-time caused
that chart pane stopped refreshing. Fixed.
- Charts: Bar chart close/open ticks
are by default one pixel smaller
- Weekly compression for Sunday data was off
by one day for dates pre-1970. Fixed.
- Weekly compression now offers user-selectable "first
day of the week" in
File->Database Settings->Intraday Settings
- Application manifest modified
to include compatibility section for Win 8.x
- Threads use current dir stored
at application startup and resolve relative paths in AB, not to rely on
Windows, so relative paths are resolved even
if Windows changes dir
CHANGES FOR VERSION 5.79.0 (as compared to 5.78.0)
- New Editor: Inverting colors on printout did not work for many backgrounds.
Now white color is always used for background, foreground colors are kept
unchanged, except for white which is replaced with black
- New Editor: Changing
formula name marks it as "modified" so Save
icon becomes enabled
- New Editor: Edit->Clear error message menu item added
in MDI mode
- New Editor: Save icon is now grayed when formula is not modified
- New Editor:
when separate editor frame was minimized, choosing "Edit formula" did
not restore frame back to normal (non-minimized) state. Fixed.
- New Editor:
Fold/Unfold did not always work correctly. Fixed. Also Fold All folds on
1st level only, so it requires less clicks to unfold one section.
- New Editor:
Copy as HTML automatically replaces white font with black. Also HTML is shorter
(black text does not use <font> tag) and coloring is
forced, so long texts are correctly copied with colors.
- New Editor: relative
paths caused problems with ReplaceFile API and FAT32, so relative paths are
now converted to absolute prior to saving
- New Analysis now rejects attempts
to use non-exhaustive optimization (OptimizeSetEngine) when number of exhaustive
optimization steps is less than 100 (Error 708)
- DB: when broker.markets, broker.groups,
broker.workspace files were missing then markets and groups from previously
loaded DB leaked to newly created/loaded
db. Fixed - now they are always initialized with defaults. Also default market
0/group 0/sector 0/industry 0 is now labelled "Undefined"
- ASCII
import: $MARKET and $GROUP commands allow to specify the name of market/group
(after comma) to be updated during import
- UI: added File->Save All menu
item to separate editor frame
- AFL: reverted change #2623 as it resulted in
regression in custom portfolio backtest speeds
- Charts: Reverted #2621 change
from 5.78.0 cached bitmap is now stretched when chart is resized while
the formula is being run
- Persistent variables that were loaded from PresistVar.bin
but not updated by the formula were removed on next start. Now they are
kept.
CHANGES FOR VERSION 5.78.0 (as compared to 5.77.0)
- Prefs: "Use new editor" is now always turned ON at the start
of application.
- Low Level Gfx: performance improved for formulas making thousands
of calls to Gfx functions (3x speed up for 200K calls)
- Charts: cached bitmap
is now stretched when chart is resized while the formula is being run
- On saving
broker.newcharts file a backup file is created prior to saving. Then on startup
in case broker.newcharts is corrupted, a backup file is used
instead
- New Editor: when auto-complete was in immediate mode typing xx.a resulted
in xx.AddCustomMetric to be shown immediately. Fixed - now in 'immediate'
mode
single-selection choices are not auto-completed without user consent.
- New Editor: when user selected black background the colors on printout
are inverted to save toner/ink. Also added File->Print/Print Setup menu
item.
- New Editor: on application close editor window frame is closed first
instead of last. This gives more 'graceful' exit.
- New Editor: on dark backgrounds unmatched brace is displayed in lighter
blue color (instead of dark blue) for better visibility
- New Editor: Autocomplete listbox is now dismissed when user drags separate
editor frame or MDI child frame
- New Editor: now it uses application theme instead
of hard-coded "VS2010" theme
- New Editor: auto complete does not
try to pop up in file paths in #includes. Also improved auto-complete operation
in the very last line.
- New Editor prints debug string when saving document in order to diagnose
possible issues with FAT32/WinXP
- Sometimes crash occured on Window->Floating command when Interpretation
window was open. Fixed.
- UI: Window->Toggle Frame restores window from icon state (if was minimized)
now.
- UI: added View->Fold / Unfold, Margin menu items in the MDI editor menu
- UI: Charts file treeview gets refreshed when saving AFL to any folder,
not only 'Custom'
- UI: Customize keyboard page now displays an error message on attempt to
create shortcuts with A-Z letters and 0-9 digits without Ctrl/Shift/Alt modifiers
to prevent clash with the editor
- UI: AFL formulas are saved in separate MRU (most recently used) list (File->Recent
Formulas) so they do not interfere with other document types using Recent
File list
CHANGES FOR VERSION 5.77.0 (as compared to 5.76.0)
- New Editor: 'Use separate frame' mode implemented (Tools->Preferences, "Editor" to
turn this off and open as tab in main frame)
- New Editor: Toolbar customization
functionality added
- UI: Window->Toggle Frame (Ctrl + ` ) menu/shortcut
added to quickly switch between main and separate editor frame
- UI: Window
menu reordered (Tile/Cascade items moved up)
- New Editor: in 5.76 pressing
Help button on dialogs when new editor was open, directed help file to 'formula
editor' page instead of given dialog help
file. Fixed.
- New Editor: On dark backgrounds the selection is darker than
it was before
- New Editor: typing non-US characters (with right Alt key) is now
working
- New Editor: Copy As HTML implemented
- New Editor: added ability to turn off line number margin, selection
margin, fold margin (from View menu)
- New Editor: added View->Fold All /
Unfold All commands
- New Editor: when relative paths were used sometimes auto-reload
and auto-save before analysis did not work. Fixed.
- New Editor: Caret Ln/Col
position is displayed in the status bar
- New Editor: Closing top error message
bar clears ALL in-line error messages
- New Editor: added Edit->Clear Error
message menu (Ctrl+E) - it clears an error(s) in currently selected line/range
- New
Editor: The width of line number margin is automatically adjusted with
regards to font size and line count and zoom level
- New Analysis: Progress bar is shown/hid quicker
CHANGES FOR VERSION 5.76.0 (as compared to 5.75.0)
- New Editor: Auto-complete has now 3 modes: disabled, on-demand (shows auto
complete list when you press Ctrl+SPACE as in old editor) and immediate (auto-complete
pops up immediately)
- New Editor: Auto change case and auto parameter info
features can be turned off from the preferences
- Prefs: Editor page changed:
a) added "Virtual space" checkbox to control whenever ability to
move caret past the end of the line is enabled or not
b) replaced "Auto-complete" box with 3-way selection radio buttons
(Disable/On-demand (Ctrl+Space)/Immediate) - to control whenever auto-complete
opens on Ctrl+SPACE combination or immediately after typing first letter
c) removed "Use syntax highlighting" box (now it is always ON)
d) removed "Highlight error line" (now it is always ON)
- New Editor: File is saved automatically when it is open in Analysis window
and analysis is run
- UI: leftover and/or user-defined keyboard accelerators
for HOME/END/PAGE UP/DOWN, letters and digits without Ctrl/Alt modifier are
removed on startup
not to
interfere with the editor
- UI: Ctrl+F added to default key accelerators
- New Editor: Implemented user-defined
colors/styles/font (from Tools->Preferences, "Editor").
NOTE:
In 5.75 on Vista, Windows 7 and Windows 8 the editor automatically switched
to modern ClearType "Consolas" font that is present on those systems.
If you want to use this new font instead of old "courier" font, go
to Tools->Preferences, "Editor" and choose "Consolas" font
and size 10pt.
- New Editor:
Implemented Help features (access to help pages Function reference, Using
AFL Editor, Param info, etc)
- New Editor: Chart tree is auto-refreshed when
formula is saved under new name (Save As...)
CHANGES FOR VERSION 5.75.0 (as compared to 5.74.0)
- Completely new AFL Editor, integrated with MDI structure with many new
features
- line
numbering
- code folding
- automatic indent
- indentation markers
- brace highlighting
- improved auto-complete
- shows up immediately after typing 1 char
- properly detects multi
line comments
- displays custom backtester member methods / properties
- in-line error
reporting / highlight
TO SWITCH BACK TO OLD editor use Tools->Preferences, "Editor" tab:
UNCHECK "Use New Editor"
NOTE ALSO: that color/font preferences do not affect new editor yet (it is
on to-do list).
- New
Analysis: few messages displayed in modal message box were moved to message
bar
- UI: Active state is tracked separately for each document type (so there
is 'last active chart' , 'last active analysis") to allow functioning
of new editor
- InfoSite added to the PluginNotification structure (Notify
API callback)
struct PluginNotification
{
int nStructSize;
int nReason;
LPCTSTR pszDatabasePath;
HWND hMainWnd;
struct StockInfoFormat4 *pCurrentSIOld;
struct _Workspace *pWorkspace;
struct StockInfo *pCurrentSINew;
struct InfoSite *pInfoSite; // NEW 5.74
};
- AFL: Parser tracks position of some operators better so errors
and warnings should show locations more precisely (for example Warning 501
points to =
sign now)
- AFL: Parser produces more descriptive "Syntax error, indentifier
'name' is undefined " or "... is not a function" when it encounters
a function call for undefined identifier or indentifier that is a variable.
Previously it returned 'syntax error, unexpected '('
- UI: removed global user-definable
accelerators for Chart/Pageup/down/home/end because they interferred with
new AFL editor. Instead chart page/up/down/home/end
implemented locally (work only when chart has focus)
CHANGES FOR VERSION 5.74.0 (as compared to 5.73.0)
- AFL Editor: Code snippets implemented (phase 1). Code snippet is a small
piece of AFL code. It can be inserted by right-clicking in the AFL editor
window
and choosing "Insert Snippet" menu
This is phase 1 of implemetation of code snippets. There will be other elements
added in the future.
There are two files located in AmiBroker directory that hold snippets:
CodeSnippets.xml - these are snippets shipped with AmiBroker installation (and
can be replaced in subsequent installations, so don't modify it!)
UserSnippets.xml - these are user-definable snippets. This file is NOT present
in the installation and user can create it by him/herself.
The XML schema for snippets file is simple (as below). Key trigger functionality
is NOT yet implemented, however Keytrigger fields should be included in the
definition for future use. It will be work like 'autocomplete' so that you
type the shortcut it, it will unfold to the formula.
Suggestions for new snippets are welcome.
<?xml version="1.0" encoding="ISO-8859-1"?>
<AmiBroker-CodeSnippets CompactMode="0">
<Snippet>
<Name>First Snippet</Name>
<Description>Description of the snippet</Description>
<Category>User category</Category>
<KeyTrigger>?trigger1</KeyTrigger>
<Formula>
<![CDATA[
// the formula itself
]]>
</Formula>
</Snippet>
<Snippet>
<Name>Second Snippet</Name>
<Description>Description of the snippet</Description>
<Category>User category</Category>
<KeyTrigger>?trigger2</KeyTrigger>
<Formula>
<![CDATA[
// the formula itself
]]>
</Formula>
</Snippet>
</AmiBroker-CodeSnippets>
- AFL: Low level GFX: Multi-layering
(z-order) implemented. AFL: GfxSetZOrder implemented
Plot( C, "Price", colorDefault );
GraphGridZOrder = 1;
GfxSetZOrder(0);
GfxSelectSolidBrush( colorGreen );
GfxCircle( 100, 100, 100 );
GfxSetZOrder(-1);
GfxSelectSolidBrush( colorRed );
GfxCircle( 150, 150, 100 );
GfxSetZOrder(-2);
GfxSelectSolidBrush( colorBlue );
GfxCircle( 180, 180, 100 );
- AFL: Low-level GFX: radius
in GfxCircle() function is expressed in "X" units
(so it actually draws circle instead of ellipse when coords mode is 1). Additionally
you can specify radius in pixels even in co-ords mode = 1. To do so pass
radius as NEGATIVE number. Also one pixel is now added to the rounding box
so circle
is centered at "x,y".
// fractional radius is
supported, so 0.5 would mean half of space between bars
Plot ( C, "", colorDefault);
GfxSetCoordsMode( 1 );
GfxSelectSolidBrush( colorViolet );
GfxSelectPen( colorRed );
bi = BarIndex();
start = FirstVisibleValue(
bi );
end = LastVisibleValue(
bi );
r = Param("radius", 1,
-5, 4, 0.1 );
for ( i = start;
i <= end; i ++ )
{
GfxCircle (
i , Close [i]
, r);
}
- AFL: Low level GFX: in 5.73.0 the pixel co-ordinates
were rounded differently than in 5.72 and earlier. Fixed.
- AFL: Low level GFX:
new function GfxGetTextWidth - returns pixel width of specified string. NOTE:
it is slow because it has to create temporary DC
and font to
measure the text. It takes 40us (microseconds), that is about 40 times more
than other Gfx functions.
GfxSetZOrder(5 );
GfxSelectFont("Tahoma", 30 );
GfxSetTextColor( colorWhite );
text = "This is a test";
GfxTextOut(text, 0, 50);
GfxSetTextColor( colorRed );
GfxTextOut("second
part in red", GfxGetTextWidth(text), 50 );
- AFL: fopen - new parameter: 'sharing' decides whenever
file is open in sharing mode or not. When sharing is True a file is prepared
for subsequent shared
reading and writing.
When sharing parameter is True the following things happen:
- when mode is "w" (writing) or "a" (appending) then file
is open with a sharing flag that denies others to read and/or write at the
same time
- when mode is "r" (reading) then file is open with a sharing flag
that denies others to write to the file (shared reads are allowed)
- when open is unsuccessful due to sharing violation (other processes / threads
have that file open and deny reads/writes) then fopen would wait for 250ms
and retry automatically 4 times. After 4 unsuccessful retries it fails with
file handle == Null.
When sharing parameter is set to False (default) no such checking occurs
and file is open anyway without denying others to read/write. This may cause
data corruption if file is written to from multiple threads/external processes
at the same time. If you want to use this mode (sharing set to False) in
multithreaded environment to write data, you need to care about synchronization
yourself for example using critical section.
- UI: Added "Name" (full name) column to Real-time
quote window
- AFL: Implemented user control over Y-axis cursor and tooltips
by means of new option chartDisableYAxisCursor, chartDisableTooltips added
to SetChartOptions
SetChartOptions( 1, chartDisableYAxisCursor | chartDisableTooltips ); //
don't change cursor shape in Y axis area and tooltips
CHANGES FOR VERSION 5.73.0 (as compared to 5.72.0)
- AFL: SetOption("StaticVarAutoSave", interval ) - added to allow
periodical auto-saving of persistent static variables
The interval is given in seconds.
For example:
SetOption("StaticVarAutoSave", 60 ); // auto-save persistent variables
every 60 seconds (1-minute)
It is important to understand that persistent variables are saved ON EXIT
automatically, without any user intervention
so it should be enough for most cases. If you for some reason want auto-saves
when AmiBroker is running, then
you can use this function.
Please note that writing many static variables into physical disk file
takes time and it blocks all static variable access
so you should AVOID specifying too small auto-save intervals.
Saving every second is bad idea - it will cause overload. Saving every
60 seconds should be fine.
Calling function with interval set to zero disables auto-save.
SetOption("StaticVarAutoSave", 0 );
-
AFL: new GfxSetCoordsMode
- rewritten Low-Level Gfx to allow fractional coords and bar/price co-ords
mode in addition to pixel
// NEW FUNCTION
GfxSetCoordsMode( mode );
- allows to switch co-ordinate system for low-level gfx functions from sceen
pixel (mode = 0) - the default, to
bar / price mode (mode = 1 ) where X is expressed in bar index and Y is expressed
in
price.
This new mode allows way easier overlays on top of existing charts without need
to do conversion between bars/price pixels
and without any extra refresh normally required in old versions when Y scale
changed.
The function can be called to switch back and forth from pixel -> bar/price
mode and vice versa a number of times
allowing to mix different modes in the same chart.
When co-ordinate mode 1 is selected (bar/price), co-ordinates can be fractional.
For example if x is 2.5 it means half way between bar 2 and 3.
Example:
// The sample shows
how using GfxSetCoordsMode( 1 )
// results in
// a) easier coding of overlay charts that plot
on top of built-in charts (no need to convert from bar/price to pixels)
// b) perfect matching between built-in Plot()
and Gfx positioning
Plot( C, "Price", colorDefault, styleLine );
GfxSetOverlayMode( 1 );
GfxSetCoordsMode( 1 ); //
bar/price mode (instead of pixel)
GfxSelectSolidBrush( colorRed );
GfxSelectPen( colorRed );
boxheight = 0.01 *
( HighestVisibleValue( C )
- LowestVisibleValue( C )
);
bi = BarIndex();
start = FirstVisibleValue(
bi );
end = LastVisibleValue(
bi );
for ( i =
start; i <= end; i++ )
{
Cl = Close[
i ];
Op = Open[
i ];
Color = IIf( Cl > Op, colorGreen, colorRed );
GfxSelectPen(
Color );
GfxSelectSolidBrush(
Color );
bodyup = Max( Op,
Cl );
bodydn = Min( Op,
Cl );
GfxEllipse(
i - 0.4, bodyup,
i + 0.4, bodydn );
GfxMoveTo(
i, H[ i ]
);
GfxLineTo(
i, bodyup );
GfxMoveTo(
i, bodydn );
GfxLineTo(
i, L[ i ]
);
}
-
Charts: functions calculating day offset (GetBarsBetweenDates) support
years > 2038
and are now much faster (don't count days in loops but use smarter
calendar math instead)
-
Charts: Cycle Lines tool has drawn lines in weird
places when using very long cycles that resulted in lines being positioned
beyond 2038. Fixed.
-
UI: added View->Price chart style->Bars
without ticks
-
Change #2534 made in 5.71.0 (allowing Null for Close
field in bar chart) created backward compatiblity issue. Reverted.
Instead a
new styleBarNoTick
introduced
that allows to plot bar chart without open/close ticks:
Plot( IIf( Month() & 1, C, Null ), "Price", colorDefault, styleBarNoTicks | styleThick ); //
bar chart without open/close ticks
-
New Analysis: when Non-exhaustive Optimize was used on symbol
without any quotes, UI displayed error and remained disabled
and it was
not possible to re-run
non-exhaustive opt. Fixed.
-
New Analysis: Backtest: Profit
figures are color-coded now (negative - red/positive - green)
CHANGES FOR VERSION 5.72.0 (as compared to 5.71.0)
CHANGES FOR VERSION 5.71.0 (as compared to 5.70.2)
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