AmiBroker 6.39.1 BETA Read Me
March 9, 2021 21:00
THIS IS A BETA VERSION OF THE SOFTWARE. EXPECT
BUGS !!!
Backup your data files and entire AmiBroker folder
first!
INSTALLATION INSTRUCTIONS
Run the BETA installer and follow the instructions.
Then run AmiBroker. You should see "AmiBroker 6.39.1" 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.
UPGRADE POLICY: This version is a free upgrade for users
who purchased AmiBroker license after March 5, 2019.
6.39 FEATURE HIGHLIGHTS:
6.39 provides 30 new features and enhancements
- AFL editor enhancements
- new AFL functions
- support for gzip and deflate compression in Internet functions
- in-place matrix copy
- backtester enhancements
- improved text tool with per-study selectable font size
- new 8-digit ICB structure
- plugin interface backward compatibility with changing function signatures
- improved performance
- more runtime checks to prevent user errors and other fixes
CHANGE LOG
CHANGES FOR VERSION 6.39.1 (as compared to 6.39.0)
- 64-bit uses a bit faster float versions powf and modf instead of double
pow/mod for ^ and % operators (non integers)
- Analysis/Settings: added 3 checks
and warnings to prevent users from entering
combination of MinPosValue/MaxPosValue/AllowPosShrinking/RoundLotSize that
are likely to prevent all trades from being taken at all
- array ^ (exponentation)
operator made 50-100x faster in special cases of small INTEGER, scalar
exponents of 2, 3, 4 and 5 by using multiplication
instead
of calls to C runtime powf()
- calling GuiSetText from AFL formula caused
notifyEditChange notification to be sent. If user formula responded to
notification with another
GuiSetText this could create loops. Now notifications are silenced
if changes come
from
user code
- When one pane had Gui controls and the other pane on another
chart sheet was completely blank, then GUI controls from populated tab
remained displayed
after
switching to completely blank sheet. Fixed
CHANGES FOR VERSION 6.39.0 (as compared to 6.38.0)
- 64-bit: AmiBroker, AmiQuote, AFL Code Wizard migrated to newest VC++ 2019
for even better performance
- AFL Editor: @link commands are executed at mouse
up (instead of previous mouse down) to prevent unwanted text selection when
message boxes are dismissed
- AFL Editor: call tips (parameter information tooltips)
now provide extra description about the function and its parameters (as of
v6.39 only 20 functions
have this
extra info)
- AFL Editor: debugging session is automatically terminated with
appropriate notice when user attempts to edit the code during debugging (this
saves mouse
clicks that were needed to stop debug session in order to edit)
- AFL Editor:
previously when no text was selected and Prettify Code was choosen, the message
box caused main frame to get focus instead of focus staying in
AFL frame. Fixed
- AFL Editor: when an runtime error is detected debugging session
the message bar shows now number of detected errors (as it did previously
during normal "verify"
- AFL Editor: when dark mode list views are
used watch window default text color was black making it hardly visible,
changed to white
- AFL/CBT: AmiBroker now displays an error when user passes
incorrect bar number to ProcessTradeSignals() instead of silently skipping
wrong arguments
- AFL: added protection against assigning wrong types to some
built-in variables such as *Price arrays. If wrong type is assigned the error
71 Type mismatch
in assignment is displayed
- AFL: ADX() function vectorized in 64-bit version
(2x faster than before)
- AFL: backtester crashed when user incorrectly assigned
string value to BuyPrice/ShortPrice/CoverPrice arrays. Fixed.
- AFL: Error("text",
stop=False) function - added extra parameter to stop execution regardless
of "stop execution at first error" preference
setting
- AFL: FindIndex( array, value, start_from = 0, dir = 1 ) - find index of
array item matching specified value
Returns:
NUMBER - the index of matching array item
if value is not found in the array, the function returns -1
Parameters:
array - input data
value - what we are looking for
start - the index to start the search from
dir - the direction of the search, 1 is up, -1 is down
Notes:
start can be positive - then it refers to index number counting from the
beginning of array
or it can be negative then it refers to index counting from the END of
the array
// example find all indices when condition
was true
condition = Cross( C, MA( C, 20 )
);
// search forwards
printf( "Search
forwards:\n" );
for( index = 0;
( index = FindIndex( condition, True, index ) ) != -1;
index++ )
{
printf( "condition is
true at index %g\n", index );
}
// search backwards
printf( "Search
backwards:\n" );
for( index = -1;
( index = FindIndex( condition, True, index, -1 )
) != -1; index-- )
{
printf( "condition is
true at index %g\n", index );
}
- AFL: If warning
level >= 3, InternetOpenURL() function now displays a
warning 507 if OS generated exception when accessing remote resource, the
same way
as InternetPostRequest
- AFL: increased calculated bar requirements for Wilders()
function for better conformance with QuickAFL
- AFL: Last OS error code is set
by Internet* functions regardless of warning level so you can always retrieve
it using GetLastOSError()
- AFL: MA( C, BarCount ), StDev( C, BarCount ) return
non-Null value
- AFL: new field added to SetOption/GetOpion function calls "MaxPosValue" (per
backtest setting)
- AFL: new function InternetSetHeaders( "headers" )
- set custom HTTP headers for subsequent web requests
For example to enable GZIP compression you need to use:
INTERNET_OPTION_HTTP_DECODING = 65;
InternetSetOption( INTERNET_OPTION_HTTP_DECODING, 1 );
InternetSetHeaders("Accept-Encoding:
gzip, deflate");
- note that InternetPostRequest will automatically add "Content-Type:
application/x-www-form-urlencoded" header unless user specifies their
own Content-Type in the InternetSetHeaders call
- AFL: new function InternetSetOption(
option, value ) - set HTTP option for internet session. Internet Options can
be found here: https://docs.microsoft.com/en-us/windows/win32/WinInet/option-flags
// how to request and handle GZIP compressed HTTP
INTERNET_OPTION_HTTP_DECODING = 65;
InternetSetOption( INTERNET_OPTION_HTTP_DECODING, 1 );
InternetSetHeaders("Accept-Encoding:
gzip, deflate");
ih = InternetOpenURL("http://www.amibroker.com/news.html" );
if( ih )
{
while( ( text = InternetReadString(
ih ) ) != "" )
{
printf( "%s", text
);
}
InternetClose(ih);
}
- AFL: new function MxCopy
- for copying rectangular blocks from one matrix to the other (copy portions
of one matrix to the other matrix)
The function works in-place (ie. no allocation occurs - first argument is a
reference to existing array and that array content would be overwritten)
MxCopy( & dstmatrix, dst_start_row, dst_endrow, dst_start_col, dst_end_col,
src_matrix, src_start_row = -1, src_end_row = -1, src_start_col = -1, src_end_col
= -1 )
src_start/src_end values equal to -1 mean "same value as corresponding
dst_start/dst_end value"
To perform a copy the number of columns multiplied by number of rows in
source and destination "rectangles" must be the same
In other words:
(dst_end_row-dst_start_row+1)*(dst_end_col-dst_start_col+1) == (src_end_row-src_start_row+1)*(src_end_col-src_start_col+1)
- AFL: new function: _exit() - that gracefully
ends AFL execution at the point of the call
- AFL: new function: InternetGetStatusCode
function - returns HTTP status code of last InternetOpenURL or InternetPostRequest
call. HTTP status codes are listed here: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
// Example:
// NON existing page (should result in status code 404)
ih = InternetOpenUrl("http://www.amibroker.com/index3434.html" );
if( ih )
{
printf("HTTP status code:
%g", InternetGetStatusCode( ih ) );
InternetClose( ih );
}
else
{
printf("Internet connection
can not be open because: %s", GetLastOSError()
);
}
- Analysis/Backtest: added "Max. position value" option in the
settings allowing to specify maximum dollar value of position. Zero (0) means
no maximum.
Positions larger will be shinked (if shrinking is enabled) or won't be entered
at all (if shrinking is d
- Charts/Preferences: added Text Tool font setting
independent from Axis font (Preferences->Miscellaneous page)
- Charts: Text
Box tool supports user-selectable font size now (selectable in Study Properties
window)
- Database: new 8-digit ICB structure implemented: https://www.ftserussell.com/data/industry-classification-benchmark-icb
- Got
rid of obsolete "Request data on save" setting that wasn't
performing as expected
- Plugin interface: added compatibility layer allowing
old plugins to safely call functions even when they have modified signature
(added new default
parameters). When plugin calls function with less than expected number
of arguments, missing
some of defaul
- When variable was passed to user function by reference, ++
operator inside had no effect on referenced variable (outside of function).
Fixed.
CHANGES FOR VERSION 6.38.0 (as compared to 6.35.1)
- 64-bit version could produce "Invalid parameter" exception from
CRT after backtesting when symbols under test had forbidden characters in
them like "%". Fixed
- 64-bit version: address space layout randomization
disabled by /DYNAMICBASE:NO linker option to facilite easier crash location
finding
- AFL: assignment new matrix value to a variable already holding matrix
value did not immediately free memory (at the time of assignment). This memory
was only freed at the end of the formula. Now it is freed earlier (at assignment)
to lower memory usage.
- AFL: GetFnData("lastsplitdate") returns empty
val instead of zero if last split date is not set
- AFL: GfxDrawImage with PNG
file could fail if very same file was accessed simultaneously from multiple
threads due to "no-sharing" mode that
3rd party XTP lib used. Fixed by using shareDenyWrite
- AFL: new function Chr(
code ) returns string representing single character of given ascii code
- AFL:
new function GetObject( path, class ) providing functionality equivalent
to JScript GetObject and VBScript GetObject
- AFL: new function GuiSendKeyEvents("ED")
- register given characters to be sent as Gui event when keyboard key is
pressed. GuiGetEvent will return
code == notifyKeyDown and id of given character, for example id == 'D' for
D letter
- AFL: StaticVarAdd when scalar value was added to already existing
static var array sometimes random value would appear. Fixed.
- AFL: when file
creation or modication date was exact midnight fgetstatus() returned datetime
indicating "eod mark" (date without time), now
it gives 00:00:00
- Analysis: Maximum number of threads per single Analysis
window has been increased to 64 (from 32)
- Backtester: generation of Buy&Hold
stats was not working when "Allow
position shrinking" was turned OFF by the user and commission > 0.
Fixed
- Chart: Data window can now display upto 40 values per single chart pane
- Chart:
Horizontal line snap to open price (keypress O) or close price (keypress
C) was snapping to H-L instead. Fixed
- Charts: Snap to price - the meaning
of threshold is changed - instead of % of price it now means % of chart height.
So 5% will snap within +/-5 of
chart
height. This allows it to work universally across different securities (stocks/forex)
and different zo
- IQFeed: improved IQFeed plugin (better support for long EOD
histories in mixed mode)
- New Analysis: the name of column "contracts/shares" changes
each time you change futures mode to prevent confusion among newbies
- Plugins:
when AFL plugin crashes (throws structured exception) the editor and indicator
windows will display call stack for easier debugging of 3rd
party
plugins
- UI: Dialog boxes are moved back main display screen if multi-monitor
configuration was changed and multi-monitor setup is not rectangular (for
example monitors
of different sizes)
- UI: Listview sorting by (single) date column is now
10+ times faster
- UI: Listview uses non optimized parsing for str to date
conversion for date formats that include names of the months instead of
numbers (avoids
problems
with different names of months in different languages)
- UI: Main window
and AFL Editor frame is moved back to (0,0) if multi-monitor configuration
was changed and multi-monitor setup is not rectangular
(for example monitors of different sizes), so saved position falls
outside currently
available
working area
- UI: MDI Close/Minimize/Restore buttons are now HighDPI
aware
- UI: MDI Tab client window buttons are now HighDPI aware
- UI: Minimized flicker
during docking panes resize by disabling Windows copy bits
- UI: Toolbar split-popup
buttons are now HighDPI aware
- x64 eSignal: reverted to more compatible version
compiled with VC2005
CHANGES FOR VERSION 6.35.1 (as compared to 6.35.0)
- When .abb file was saved in older version and was missing Param2 then Param
was incorrectly used as default value. Fixed.
- Changed threshold year for two
digit year data files to 25 (previously it was 20). So YY is now interpreted
as 19YY when YY < 25, otherwise it is
interpreted as 20YY
CHANGES FOR VERSION 6.35.0 (as compared to 6.31.0)
- AFL: new function inverf(x) - inverse of erf function
- AFL Editor: added function
navigation combo box in the toolbar - detects user defined functions and
allows to quicky navigate to function definition
- AFL: GetOption("PadAndAlignToReference")
allows to query Pad and align setting status (note that this is read-only
field, so it will
not work
with SetOption)
- AFL: new function erf(x) - computes Error function https://en.wikipedia.org/wiki/Error_function
- AFL: parser warns if
empty body is used in 'for' statement, like this: for( i = 0; i < 10;
i++) ; // extra semicolon at the end - empty body Warning 510
- AFL: parser
warns if empty body is used in 'while' statement, like this: while( condition
) ; // extra semicolon at the end - empty body Warning 510
- AFL: SafeDivide(
x, y, valueifzerodiv )- safe division that handles division by zero using
special handling (replace result with user-defined value)
- Batch: added optional
parameter to Data Import ASCII command to allow specify format definition
file
- Batch: added optional parameter to Execute and Wait command to specify
current working directory for command
- Batch: added optional parameter to Export
to File / Export walk-forward to file to specify column separator in CSV
files
-optional parameter defines the column SEPARATOR used for export. Only single
character is used. When it is not supplied, comma is used.
- Batch: Clipboard Cut/Copy/Paste implemented in batch editor
- Batch: Edit->Delete
(from main menu) and Edit-Delete All implemented for completeness
- Batch: list
view uses virtual mode now (owner data)
- UI: All owner-draw list views (NOT
in dialogs) now feature customizable theme (currently available "system
(light) theme" and "black theme")
- go to Tools->Customize, "Appearance" tab, "Dark mode
for listviews" checkbox
- UI: Analysis and RT quote window use now exactly
the same RGB values for up/down (green/red) colors for consistency
- UI: Custom
virtual listview (owner data) supports per-item data now (SetItemData/GetItemData
work with LVS_OWNERDATA)
- UI: Found workaround to avoid terrible flicker
and bad rendering of list view controls during fast page up/down and side
scrolls (even though
they are double
buffered by Windows and in theory should be smooth).
- UI: Identified
even more bottlenecks in Windows OS that caused even owner data and owner
draw Listview performance to suffer with large
number
of columns. OS code circumvented. Listview redraw speeds increased
more than
5x compared
to previous speedy implementation
- UI: Implemented resizing of Listview
column customization dialog
CHANGES FOR VERSION 6.31.0 (as compared to 6.30.0)
- AFL: Access violation in PercentRank when period is wrong (Null/unitialized).
Now error 52 is displayed instead.
- AFL: InternetPostRequest now silently (or with warning
507 under debugger) returns NULL handle instead of error when remote server
responds with HTTP
Status 50x
- Analysis: manual column re-sorting could be bit off if scientific
output format (xxxEyyy) was used with different exponents. Fixed.
- ASCII importer
now handles LastSplitRatio of X:Y where X and Y are 1...32767 (previously
only 1..127)
- Batch: add "add results to watchlist" action / WatchlistAddResults
- Batch:
add "clear watchlist" action / WatchlistClear
- Batch: add "comment" action
- Core/DB: fixed access violation when
all data were removed while QuickData was turned on
- DebugView: eliminated
some internal messages from DebugView output (from release version)
- InternetPostRequest
- even if URL started with https, previous version wanted to connect to port
80, instead of 443. Fixed.
- UI/Listview: since 6.28 exception could occur if
single cell text length exceeded 1024 characters. Fixed.
- When database is
empty, ticker box displays <No symbol> grayed text
instead of blank or reminiscent of previous database symbol
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