AmiBroker 6.30.5 Official Release Read Me
March 20, 2019 10:45
INSTALLATION INSTRUCTIONS
Run the setup program and follow the instructions.
Then run AmiBroker. You should see "AmiBroker 6.30.5" 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 14, 2017.
What's new in the latest version?
Highlights of version 6.30
Version 6.30 brings lots of new functionality especially with regards to the
formula language and performance . There are hundreds of new features and changes
to existing functionality as compared to version 6.20, listed in detail in "Release
Notes" document in AmiBroker directory. Below is just a short list of
few of them:
- static variable declaration
- passing variables by reference
- new voice functions
-
VoiceSetRate - sets
voice speech rate (AFL 4.30)
-
VoiceSetVolume -
set the volume of speech (AFL 4.30)
-
VoiceWaitUntilDone -
waits until TTS voice has finished speaking (AFL 4.30)
- system error handling via GetLastOSError
- support for geometric pens in GfxSelectPen
-
Huge performance improvements in 64-bit version with migration
to new VC++2017 compiler
Why do we migrate to new compiler with 64-bit version?
- New compiler supports new CPU instructions (SSE3/AVX) that we can use
to offer better performance
- According to our tests new compiler support produces faster code by
itself (better optimizations, auto-vectorization, etc)
- New compiler is better with error checking (less bugs to slip through)
- We don't need to care about compatibility with pre-Vista systems in
64-bits version and all 64-bit capable CPUs are "modern" enough.
Why do we stay with old compiler in 32-bit version?
- New compiler does not produce code compatible with older operating systems
(XP or earlier). Old compiler offers 100% compatibility with all Windows
versions
- New compiler requires modern CPUs
Exact performance improvement is function dependent and hardware dependent.
Many functions are faster by 30-50% but in some cases such as Min()/Max()
functions as large as 8x speed up can be observed in 64-bit version.
-
Other key improvements
- Auto-optimization framework
- HTML5 compatibility in Web Research window
- comment folding in the AFL editor
- clickable links in Analysis result list
Highlights of version 6.20
Version 6.20 brings lots of new functionality especially with regards to system
testing. There are hundreds of new features and changes to existing functionality
as compared to version 6.10, listed in detail in "Release Notes" document
in AmiBroker directory. Below is just a short list of few of them:
-
HIGHLIGHT: Integrated Batch Processor -
allowing you to automate complex, sequential tasks, featuring
- easy-to-use interface
- built-in time scheduler
- command line interface
- AFL triggering
- logging
-
New features in AmiBroker Formula Language:
- direct internet access functions (IntenetOpenURL/InternetReadString/InternetClose)
allow interfacing with web / REST services from AFL
- general purpose distribution function: PriceVolDisribution
- more statistical functions: NormDist/Kurtosis/Skewness
- variable period PercentRank and StDev
- cumulative product functions CumProd/Prod/ProdSince
- bitmap image drawing function GfxDrawImage
- ability to select Speech API voice via VoiceSelect/VoiceCount
- multi-text exploration columns via AddMultiTextColumn
-
Performance improvements
- faster startup
- more responsive Analysis window while it is busy processing (plus
new Pause function)
-
UI and usability improvements
- many adjustments in UI scaling to better support HiDPI/4K displays
- walk-forward settings are now per-project, not global
- debugger's watch window supports display of static variables and
expressions with static variables
CHANGE LOG
CHANGES FOR VERSION 6.30.5 (as compared to 6.30.2)
- AFL editor switched back from UTF-8 to ANSI to maintain compatibility
with old formulas without rewriting
- Windows 7: when error line was clicked and help file displayed Windows
HELP window did not take focus properly. Fixed.
- New Warning 509 behaved like error (stopped optimization). Fixed.
CHANGES FOR VERSION 6.30.2 (as compared to 6.30.0)
- AFL Editor: @link command now works on single click (instead of double
click)
- AFL Editor: multiple error messages per single code line are now differentiated
and lead to different user guide pages when clicked
- AFL Editor: When mouse
hovers over the error message the mouse cursor changes to "Hand" and
the error message is clickable as normal "link" leading
to users guide description of error message
- AFL: ApplyStop with ExitAtStop=2
parameter when used together with backtestRegular mode did not trigger stops
in 6.25-6.30. Fixed.
- AFL: new function InternetPostRequest( url, data, flags
= 0 ) - allows to make POST HTTP requests
ih = InternetPostRequest( "http://server_name_here.com/testpost.php?param3=7&m4=8", /*POST
DATA*/ "param1=9&m2=12" );
if( ih )
{
while( ( str = InternetReadString(
ih ) ) != "" )
{
printf( "%s",
str );
}
InternetClose( ih );
}
// testing code (server side ) in PHP:
<?php
echo "Post variables: \r\n";
foreach ($_POST as $key => $value){
echo "{$key} = {$value} \r\n";
}
echo "Get variables: \r\n";
foreach ($_GET as $key => $value){
echo "{$key} = {$value} \r\n";
}
?>
- AFL: Now() function supports format
= 11 - returns Unix timestamp (number of seconds since Jan 1, 1970)
- AFL: OscP/OscV
could cause exception in unlikely event when entire Close or Volume array
was filled by Null values. Fixed
- Docs: added detailed descriptions of Warnings
504, 505, 506, 507, 508 and 509, Errors 63, 64, 65, 66, 67, 68, 69, 70
- Docs:
updated documentation on ApplyStop to include activationFloor
- Intraday date
axis hours could show 24:00 when negative timeshifts were defined in the
settings. Fixed
- Matrix variables that were passed to single-argument math
functions (sqrt, exp) did not have their ref count updated correctly. Fixed.
- Plugins
are now loaded from work_dir\Plugins if exe_dir\Plugins folder does not exist
- Pref: "Ask
before closing indicator pane" is now turned on by default
- Pref: Misc/
Max Number of decimal places in titles and RT quote bumped o 7
- UI: In 64-bit
version only the .AFL extension in the editor window caption was removed.
Fixed.
- Web Research predefined profiles: removed "MarketWatch" because
the site is not available anymore
CHANGES FOR VERSION 6.30.0 (as compared to 6.29.0)
- AFL: GfxSelectPen function - added support for geometric pens (including
flat endcap):
PS_ENDCAP_FLAT = 0x200;
PS_ENDCAP_SQUARE = 0x100;
GfxFillSolidRect( 100, 80, 200, 260, colorGreen );
// flat end cap
GfxSelectPen( colorRed, 10,
PS_ENDCAP_FLAT );
GfxMoveTo( 100, 100 );
GfxLineTo( 200, 200 );
// square end cap
GfxSelectPen( colorRed, 10,
PS_ENDCAP_SQUARE );
GfxMoveTo( 100, 120 );
GfxLineTo( 200, 220 );
// round end cap (default)
GfxSelectPen( colorRed, 10 );
GfxMoveTo( 100, 140 );
GfxLineTo( 200, 240 );
- AFL: GuiEnable( id, enable ) - enables / disables GUI control.
Disabled control
can not be clicked and has "grayed" look
- AFL: GuiGetValue( id )
- gets the value of GUI control (for example slider position). For non-slider
controls value is number representing control text
converted to number)
- AFL: GuiSetValue( id, value ) - sets the value of GUI
control (for example slider position). For non-slider control value will
be converted to text
and assigned as GuiSetText( id, NumToStr( value ) )
- AFL: GuiSetVisible( id,
visible ) - shows/hides GUI control
// control identifiers
idSlider = 1;
idEnable = 2;
idDisable = 3;
idShow = 4;
idHide = 5;
function CreateGUI()
{
if ( GuiSlider(
idSlider, 10, 30, 200, 30, notifyEditChange )
== guiNew )
{
// init values on control creation
GuiSetValue(
idSlider, 5 );
GuiSetRange( idSlider, 1, 100, 0.1, 100 );
}
GuiButton( "enable",
idEnable, 10, 60, 100, 30, notifyClicked );
GuiButton( "disable",
idDisable, 110, 60, 100, 30, notifyClicked );
GuiButton( "show",
idShow, 10, 90, 100, 30, notifyClicked );
GuiButton( "hide",
idHide, 110, 90, 100, 30, notifyClicked );
}
function HandleEvents()
{
id = GuiGetEvent( 0, 0 );
switch ( id )
{
case 2:
GuiEnable( idSlider, True );
break;
case 3:
GuiEnable( idSlider, False );
break;
case 4:
GuiSetVisible( idSlider, True );
break;
case 5:
GuiSetVisible( idSlider, False );
break;
}
}
CreateGUI();
HandleEvents();
Title = "Value = " + GuiGetValue(
idSlider );
- AFL: Hexadecimal numbers can be now written
using 0x prefix (as in C/C++)
- AFL: In 6.29 GfxSelectPen function was not functioning
without geometric style. Fixed.
- AFL: InternetOpenURL( url, flags = 0 ) - added 'flags' parameter
Note 1: Flags are the same as defined by WINAPI, examples:
INTERNET_FLAG_RELOAD = 0x80000000;
INTERNET_FLAG_NO_COOKIES = 0x00080000;
Flags should be combined using binary OR operator: |
Note 2: ASCII transfers are used always
INTERNET_FLAG_RELOAD = 0x80000000;
INTERNET_FLAG_NO_COOKIES = 0x00080000;
// Example don't use cached content and don't use
cookies
ih = InternetOpenURL( "http://www.google.com",
INTERNET_FLAG_RELOAD | INTERNET_FLAG_NO_COOKIES );
InternetClose( ih );
- AFL: new function GuiSetRange( min,
max, step, ticfreq ) - sets the min-max range of slider control
if( GuiSlider( 1, 10, 30, 200, 30, notifyEditChange )
== guiNew )
{
// init values on control creation
GuiSetValue( 1, 5 );
GuiSetRange( 1, 1, 100, 0.1, 100 );
}
Title = "Value = " + GuiGetValue( 1 );
- AFL: new function
GuiSlider( id, x, y, width, height, notifyflags ) - creates slider control
- AFL:
new function remap( x, fromMin, fromMax, toMin, toMax ) - performs re-mapping
from one range to another, works on scalars and arrays
- AFL: When OLEDATE type
(read from OLE objects) is assigned to AFL variable it gets converted to
string using ISO format (YYYY-MM-DD HH:MM:SS). Time
part only appears for records within non-zero time component
- ASCII import:
Aux1/2 fields can now be imported separately from two different files (combined)
when using $HYBRID
- In 6.29 estimated number of optimization steps displayed
in 'warning' in case of tiny (fractional) step increment may be lower than
actual number
of steps
- In 6.29, due to changes, some chart Gui* controls (owner draw) did
not repaint on window resize. Fixed.
- UI: File->New Database-> Create
button now recursively creates all missing directories if multiple nested
non-existing dirs were typed in
- UI: new databases are now created in separate "databases" subfolder
by default
CHANGES FOR VERSION 6.29.0 (as compared to 6.28.0)
- AFL: added GuiDateTime function
lastdate = StaticVarGetText("lastdate");
if( GuiDateTime( 100, 10, 35, 200, 30,
notifyEditChange ) == guiNew )
{
GuiSetText( lastdate, 100 );
_TRACE("new!!!!");
}
id = GuiGetEvent( 0, 0 );
code = GuiGetEvent( 0, 1 );
if( id == 100 && code
== notifyEditChange )
{
lastdate = GuiGetText( 100 );
StaticVarSetText( "lastdate",
lastdate );
}
Title = "" + lastdate;
Plot(C,"t", colorRed );
- AFL: Gui creation functions (GuiButton, GuiEdit, GuiDateTime and others)
return guiNew (1) when control is newly created or guiExisting (2) when control
already exists. This is useful for one-time initialization when control is
being created.
- AFL: InternetSetAgent("agent")
- new function to set user agent for InternetOpenURL
- AFL: new Error 70 -
displayed on attempt yo use InternetSetAgent when it is already set or
connection was already open
- Analysis: added Notice 802: Trade size limite
of X% of entry bar volume has been hit N times.
- Charts: Vertical line (Y
axis line) between chart area and Y axis scale is drawn with ZOrder = 0
instead of ZOrder = 128
- Charts: Y-axis scale for huge negative values (below
minus 1 billion) was incorrect. Fixed
- File: Chart template, complete now
also saves the content of files included using #include_once
- New Analysis:
decreased number of cases when IEEE rounding of fractional steps result
in one step less than naive expecation in optimization
- UI: 'Backtest settings'
caption changed to 'Analysis Settings' and changed the layout of 'general'
tab - data settings (that
apply to
everything
mode) grouped separately from purely backtest settings
- UI: increased
number of user-definable Tool window menu items to 20 (from 10)
CHANGES FOR VERSION 6.28.0 (as compared to 6.27.1)
- AFL:
AddToComposite will issue error 69 if user passes field code other than "O", "H", "L", "C", "V", "I", "1", "2",
or "X"
- AFL: another protection for users shooting themselves in
the foot: AddToComposite will issue error 68 when user passes invalid symbol
string (empty or with
characters like comma or new line or tab)
- AFL: improved type checking for
bad type of array arguments
- AFL: New warning 508 is displayed if same category
type is used multiple times in the Filter settings window and formula calls
GetOption("FilterInclude*")
or GetOption("FilterExclude*). Code using such statements is incorrect
for such filters.
- AFL: now you can pass references as arguments to built-in
funcitons and they will be automatically dereferenced ("by value" sematics
enforced)
- AFL: user-defined functions that return matrix reclaim memory faster
than before to avoid large memory consumption on super-long loops calling
them
- AFL: VarGet was not working properly with matrices on 64 bit version.
Fixed.
- AQ: 3.29 - when current working directory is set incorrectly it sets
it back to where it should be. Correct working dir is required for relative
paths
to work
- Backtest: interest earned on cash balances and charged on margin load
is reported separately in backtest report now (if non-zero)
- Core: sizes of
some hash tables increased to speed up lookups
- enable_static_decl created
prefixes in original case (both upper and lowercase). Since StaticVar* functions
always use lowercase names this made them unable
to read declared statics other than all lowercase. Now declared variables
are internally lowecase
- Gui control custom colors - defaults changed to use
Windows default "hot" color
(blue) for hover outline and (hover + selected) state is now drawn with hover
border and text but 'selected' background
- GuiGetCheck returned 0 on owner
draw toggle (custom colors) due to Windows limitation. Fixed.
- IB plugin: right
mouse button click : Backfill Current was causing exception for symbols longer
than 26 letters. Fixed. (Version 2.0.10)
- If user formula had run-time errors
and produced zero trades the "Info" tab
issued "Reporting has been turned off by SetOption" since there
was no report generated but not because of option, but because of formula
error.
Fixed (the message is not displaye
- IQFeed: in mixed mode EOD data got preference
if there is not enough room to fit all intraday and all eod in defined "number
of bars"
- New Analysis: added 'notices' to Info tab that inform the user
about potential problems and recommended actions. Currently one notice is
displayed when
user tries to use ranking or composites without enabling padding. Will add
more
notices in the future
- New Analysis: progress bar will not display "remaining
time" until
at least one step is completed. Also if remaing time is > 2 billion years
it will display (unknown), and will report remaing time in million years
if necessary (for example when user star
- Setup 64-bit: program and all plugins
use newest compiler and newest VC++2017 runtime
- Setup 64-bit: activation key should work without installing VC2005 runtime
- UI: "OK" button
appears on splash screen only if it does not auto-close
CHANGES FOR VERSION 6.27.1 (as compared to 6.26.0)
- AFL Editor: preprocessor command (#include/#include_once/#pragma) are highlighted
with different color to give visual clue that preprocessor command is NOT
regular code
- AFL: #pragma enable_static_decl accepts prefix given in quotation
marks (as
regular string).
#pragma enable_static_decl "myprefix{chartid}"
- AFL: due to changes in 6.25 BETA TimeFrameSet applied on
1-tick base interval could result in division by zero exception. Fixed.
- AFL:
Error 66 has new meaning now. It is issued to prevent attempts to mix static
declarations with old style access. Error 66. Variables with '---'
prefix are inaccesible via StaticVarGet/Set/Remove in this formula. This
prefix is
reserved by #pragma ena
- AFL: Removed Error 66: invalid identifier from VarSet/VarGet.
Instead of issuing error message, VarGet/VarSet automatically sanitizes invalid
identifiers
by
replacing all characters other than digits and A-Z, a-z letters by underscore
- AFL:
runtime tokens {chartid}, {symbol}, {interval} are now supported in #pragma
enable_static_decl
- AFL: SetFormulaName - displays error 67 if user tries to
use file-system forbidden characters for formula name
- AFL: StaticVarRemove()
when called with EMPTY string: StaticVarRemove("")
nullifies all static variables declared with static keyword within given
formula, so this:
#pragma enable_static_decl(test)
static _x, _y, _z;
_x = 1;
_y = 2;
_z = 3;
StaticVarRemove(""); //
nullify all declared static variables
printf("%g %g %g",
_x, _y, _z );
is equivalent to writing
#pragma enable_static_decl(test)
static _x, _y, _z;
_x = 1;
_y = 2;
_z = 3;
_x = Null; _y = Null; _z = Null;
printf("%g %g %g",
_x, _y, _z );
// note that setting declared static variable to Null
value results in removing it from memory
StaticVarRemove("")
- returns
number of variables nullified. Returns 0 on
failure (no declared static variables
found in current formula)
- AFL: when declared static variable is assigned the NULL value, it
will be removed from memory when formula finishes
- ASCII importer: importer
logged "ran of industry space" even if
it didn't. Fixed.
- CBT: If user called ApplyStop AND calls EnterTrade from
low-level backtest and did not switch backtestRegular mode to raw mode (which
should be done),
backtester would automatically turn on 2nd phase stops handling to prevent
crash
- Charts: a crash could occur if user had lots of drawn trendlines on
multiple panes and some of them had start date BEFORE first available bar
and RT stream
was frequently updating. Fixed.
- Make #pragma enable_static_decl is now private
functionality. This means that it will work just fine but we don't provide
any help/support except
of what
is written in readme/manual
- New Analysis: you can now copy dates between "From" and "To" date
pickers (right click menu or Ctrl+C/Ctrl+V)
- UI: Bar replay From-to controls
support copy-paste (right click or Ctrl+C/Ctrl+V)
- UI:added preprocessor color
picker in Tools->Preferences, "Editor"
- 6.27.1 fix: In 6.27.0 VarSet did not work properly. Fixed.
- 6.27.1 fix: Backtest: since 6.25 crash could occur if "detailed log" was
enabled and trade was not entered due to unsufficent funds because format
string was not matching arguments. Fixed.
CHANGES FOR VERSION 6.26.0 (as compared to 6.25.0)
- AFL: new static keyword: declare identifier as static variable - a little
'revolution' in static variable use, declare variable as static and use as
'regular' variable, no need to call functions
// the pragma below is required to enable support
for static declarations
// it also defines the prefix which is added to variables declared with static
keyword
// it is one prefix per formula.
#pragma enable_static_decl(prefix)
// it is really good idea to consequently use naming
convention that
// distinguishes declared static variables from the others
// we highly recommend using UNDERSCORE '_' before all declared static variables
// so they can be easily spotted in the code
// The other choice could be s_ prefix
static _myvar; //
this var is also accessible by "prefix_myvar"
printf( "This variable is
really static %g", _myvar++ );
// keep in mind that for speed static variable is read
only once at the declaration
// and saved only once - when formula execution is completed
// This way declared static variables offer same speed as regular variables
(no speed penalty)
- AFL Editor: contrast of error location indicator on dark backgrounds increased
- AFL
Editor: C-style comments /* ... */ are now foldable in the editor
- AFL Editor:
new menu choices View->Fold Comments / Unfold Comments - allow
to fold/unfold all multi-line comments (enclosed with /* .... */)
- AFL: added
constants notifyClicked, notifySetFocus, notifyKillFocus, notifyHitReturn,
notifyEditChange, notifySelChange, notifyMouseEnter, notifyMouseLeave
- AFL:
Another protection against users shooting themselves in foot, VarSet/VarGet
now displays error when you try to use characters different than A-Z, 0-9
and '_' in variable names
- AFL: Attempt to use single subscript on matrix variable
now results in error message "Accessing Matrix elements requires two
subscript operators"
- AFL: Due to the fact that Windows may send WM_MOUSEMOVE
message even if mouse did not move, AmiBroker now has internal check that
prevents ReqestMouseMoveRefresh
from triggering if mouse position did not change
- AFL: GetLastOSError (for
getting last error message from Windows) - allows getting information about
and handling of runtime OS errors
// Example 1:
fh = fopen("non_existing_file.txt", "r" );
if( ! fh )
{
printf("File can not be
open because: %s", GetLastOSError() );
}
// Example 2:
ih = InternetOpenUrl("http://non_existing_host.com" );
if( ! ih )
{
printf("Internet connection
can not be open because: %s", GetLastOSError()
);
}
- AFL: GuiButton and GuiToggle in native
OS style use background color of the chart for small border instead of default
grey
- AFL: GuiButton/GuiCHeckBox/GuiToggle/GuiRadio support now new events
notifyMouseEnter (64) and notifyMouseLeave(128) which detect hovering without
need for constant
refreshes
#pragma enable_static_decl(myprefix)
static _counter;
flags = notifyMouseEnter | notifyMouseLeave;
GuiButton("test", 1, 20, 20, 100, 100,
flags);
GuiCheckBox("test 2", 2, 200, 20, 200, 20,
flags );
GuiSetColors( 2, 2, 0, colorRed, colorBlue );
Title = StrFormat( "%s.
Refresh # %g\n", GuiGetEvent( 0, 2 ),
_counter++ );
nc = GuiGetEvent( 0 , 1 );
if( nc == notifyMouseEnter ) GfxTextOut( "MOUSE
ENTER", 200, 50 );
if( nc == notifyMouseLeave ) GfxTextOut( "MOUSE
LEAVE", 200, 50 );
_TRACE(Title );
- AFL: GuiCheckBox and GuiRadio now support custom colors of text
and background
- AFL: In 6.25 Gui* keyboard navigation interferred with delete
key and possibly other shortcuts due to the way how windows works. Implemented
workaround
so keys are only intercepted if child window (control) has focus.
- AFL: In
6.25 Gui* keyboard navigation was turned on by default, now it is off by
default but can be turned on if you use SetOption("GuiEnableKeyboard",
True )
- AFL: In 6.25 GuiGetCheck returned -1 on unchanged. Now it returns only
0 (unchecked) or 1 (checked)
- AFL: In case of Windows INET API error, Internet*
functions now report Warning 507 instead of generic error 47. Warning 507
is Level-3 warning, i.e. editor-only,
which means it will pop up in the formula editor, but won't break execution
in runtime (indic
- AFL: Now can use subscript operator [ ] on references
to arrays and matrices
- AFL: Passing by reference does not create nested references
in user-defined function calls
- AFL: VoiceSetRate( rate ) - sets SAPI voice
(speech synthesis) rate. Rate of 0 (zero) is "normal", negative
is slower, positive is faster (allowable range -10..+10)
- AFL: VoiceSetVolume(
volume ) - sets SAPI voice (speech synthesis) volume (0..100)
- AFL: VoiceWaitUntilDone(
timeout ) - waits until voice has finished speaking or specified timeout
(1..100ms) has elapsed. Returns True if voice finished,
False if the timeout elapsed
VoiceSetRate( -10 );
Say("I am speaking
slowly", False);
while( ! VoiceWaitUntilDone( 100 )
);
printf("Done 1\n");
VoiceSetRate( 0 );
Say("I am speaking
normally", False);
while( ! VoiceWaitUntilDone( 100 )
);
printf("Done 2\n");
VoiceSetRate( 5 );
Say("I am speaking
fast", False);
- broker.master file is saved to a new name and renamed later to avoid
corruption when Windows decides to shutdown, restart or sleep during
save
- Dev: 64-bit new compiler (VC2017) broke backward compatibility with
singletons that UI lib uses causing infinite loop when High Contrast scheme
was
used. Workaround implemented.
- Misc: 64-bit: Restored correct manifest
(from pre6.22) with compat records so Win 10 does not lie about version
number and re-added 24-bit
large
PNG icon
- New Analysis: Added support for clickable links. If you put
@link URL in any cell of Analysis result list it creates a clickable row.
If
you double
click
on the row while holding down ALT key it will open the link
AddTextColumn("@link
http://www.amibroker.com/", "double
click me with ALT key");
// Hidden links are possible if you add the
@link in the column past the last defined one
AddRow( "ticker\tdatetime\ttest\t@link
http://www.amibroker.com" );
CHANGES FOR VERSION 6.25.0 (as compared to 6.22.0)
- 64-bit: In 6.22 the array division could produce 1ulp (units at least place)
rounding errors due to too excessive new VC++2017 compiler optimizations.
Workaround implemented to avoid that.
- Added support for formatDateTimeISON
(ISO format NO dashes: YYYYMMDD for end
of day and YYYYMMDD HHMMSS for intraday)
AddColumn( DateTime(), "dt", formatDateTimeISON );
Filter = 1;
- AFL Editor: added one-time message "In
the Debug mode number of bars is limited to 200 bars. You can change it in
Tools->Preferences, Debugger tab" because
users don't read docs
- AFL: ApplyStop now has 8th argument: ActivationFloor
that defines the amount of profit (in dollars or percents, according to stopmode)
that must be exceeded
before stop is activated
- AFL: Gui* - controls are created in the order of
occurence in AFL formula (instead shuffled or reverse as in previous version)
- AFL:
Gui* - keyboard navigation is now enabled (you can tab between controls and
use arrows to navigate control groups such as radio boxes)
- AFL: IsNull() accepts
matrix input and returns 0 (False), i.e. "variable
is not null" if variable is of matrix type
- AFL: math functions such as
sin(), sqrt(), etc can now be applied to matrices (element-wise operation)
(previously such attempt resulted in access violation)
- AFL: New feature: Passing
arguments as reference (allows modification of arguments passed - easy way
to return multiple values), to pass by reference
use & (address-of)
operator before variable identifier
Reference is actually a pointer to (address of) the variable. If it is passed
to function it allows original variable to be modified.
The difference between AFL and C language is that while you are using address-of
operator when you call function,
you don't need any special syntax in the function itself. This has advantage
that same function can be called with arguments passed by value and by reference
and which one is used is just directed by the way you call the function.
AFL automatically and transparently knows that it needs to dereference addresses
when
references are used in aritmetic operations, function calls or assignments.
function test( x, y )
{
x += 1;
y += 2;
}
a = 23;
b = 25;
printf("Before function call: a=%g, b=%g\n", a, b );
test( &a, &b ); // pass references (variables get modified)
printf("After function by ref call: a=%g, b=%g\n", a, b );
test( a, b ); // pass values (no modification happens)
printf("After function by val call: a=%g, b=%g\n", a, b );
- AFL: new function GuiCheckBox - creates
check box
- AFL: new function GuiGetCheck( id ) - gets 'checked' or "ON" state
of toggle, checkbox and radio buttons
- AFL: new function GuiRadio - creates
radio button
- AFL: new function GuiSetCheck( id, checked ) - sets 'checked'
or 'ON' state of toggle, checkbox and radio buttons
- AFL: new function GuiSetFont( "fontface",
size )
- AFL: new function GuiToggle - creates toggle button (like normal button
but it toggles between "on" and "off" state with each
click)
- AFL: SetOption("OptimizeSaveParams", True ); - turns on generation
of AFL file that contains values of optimization parameters producing best
result. The generated file has the same name as formula run but has .opt.afl
extension
This functionality is provided to simplify creation of auto-optimization
schemes
How to use:
1. Create your main formula, say it's file name is "Formulas/Custom/MainFormula.afl"
2. Create your opt param formula: "Formulas/Custom/MainFormula.opt.afl"
In the opt param formula type:
// This file will be automatically overwritten by optimizer with best values
first_param = 6;
second_param = 12;
3. In the main formula type:
#include "Formulas/Custom/MainFormula.opt.afl"
x = Optimize("first_param", first_param, 3, 10, 1 );
y = Optimize("second_param", second_param, 11, 30, 1 );
// causes automatic generation of MainFormula.opt.afl
SetOption("OptimizeSaveParams", 1 );
// dummy system using two params
Buy = Cross( C, MA( C, x ) );
Sell = Cross( MA( C, y ), C );
4. Run optimization
After it is complete MainFormula.opt.afl will be overwritten with optimum
values
- AFL: When using TimeFrame functions, QuickAFL now uses ratio of
requested_interval/current_interval multipled by 30 to better estimate required
bars
- ships with newest AmiQuote 3.22 (see AmiQuote read me for details)
- Analysis:
Detailed log displays information about ignored ScaleIn/Outs because of insufficient
funds or trade size constraints
- Analysis: Detailed log now displays all warnings
about skipped/ignored signals in RED color so they are easier to spot
- Data:
when performing X:Y split and X or Y exceeded 255 the factor was incorrectly
displayed (negative) in the Symbol window. Fixed.
- formatDateTimeISO and formatDateTimeISON
added to syntax highlighter definitions
- Scheduler: Repeat "Daily" mode
repeated batch run every day even if some days were unchecked. Fixed.
- UI:
Place Order dialog - allows typing stop distances smaller than 0.1 now
- UI:
Prefs/Charting: Turning on "Collapse parameter sections" option
causes all sections in Parameter window to be collapsed (NOT good idea for
newbies as they wont see the controls !)
- Web Research: many HTML5 pages did
not display properly because of the fact that web browser used old IE7
mode. Now browser uses IE11 mode at minimum
for proper HTML5 rendering
CHANGES FOR VERSION 6.22.0 (as compared to 6.21.0)
- 64-bit: migrated all code to new compiler VC++2017 which seems to produce
better code for x64 resulting in 30...50% speed improvements for many AFL
functions. The only negative seems to be much bigger runtime libs
- 64-bit: AFL: Sum() function 2x faster
- 64-bit: AFL: Max() and Min() functions 8x faster
- 64-bit: AFL: Ref() funciton 2x faster
- 64-bit: AFL: MACD(), ROC(), StDev(), LinearReg() and many other functions
faster by 30-50%
- AFL: GetExtraData
does not trigger code check and profile warning about
referencing future quotes if plugin implements new GetExtraDataEx function
- AFL:
GuiEdit complained about 2nd parameter instead of 1st (being less than
zero)
CHANGES FOR VERSION 6.21.0 (as compared to 6.20.1)
- AFL: decreased memory fragmentation when user changes type of variable
from array to scalar and back thousands of times
- AFL: GuiButton( "Text",
id, x, y, width , height , notifyflags ) - creates a button
"Text" is a text to be displayed on the button
x, y are pixel coordinates of top-left corner of the control
width, height are pixel width and height of the control
notifyflags - decides which events fire execution of your formula, it can
be any combination of values below
1 - clicked (button)
2 - setfocus (all)
4 - killfocus (all)
8 - hit enter/return key (edit)
16 - edit change (edit)
- AFL: GuiEdit(
id, x, y, width, height, notifyflags ); - creates an edit field
x, y are pixel coordinates of top-left corner of the control
width, height are pixel width and height of the control
notifyflags - decides which events fire execution of your formula, it can
be any combination of values below
1 - clicked (button)
2 - setfocus (all)
4 - killfocus (all)
8 - hit enter/return key (edit)
16 - edit change (edit)
- AFL: GuiGetEvent(
num, what = 0 )
what = 0 - ID of control that received event (number)
what = 1 - the notification code (number)
what = 2 - the ID, the code and the notification description as text (string)
num parameter defines the index of notification in the queue. 0 is first
received (or "oldest") since last execution.
Usually there is zero (when formula execution was not triggered by UI event)
or one event in the queue but
note that there can be MORE than one event notification in the queue if your
formula is slow to process. To retrieve them all use increasing "num" parameter
as long as GuiGetEvent does not return zero (in what =0, =1 mode) or empty
string (what=2).
// read all pending events
for( i = 0; id = GuiGetEvent( i ); i++ )
{
code = GuiGetEvent( i, 1 );
text = GuiGetEvent( i, 2 );
}
- AFL: GuiGetText( id ) - get text from control
- AFL: GuiSetColors( idFrom,
idTo, border , clrText = -1, clrBack = -1, clrBorder = -1, clrSelText = -1,
clrSelBack = -1, clrSelBorder = -1, clrHoverText =
-1, clrHoverBack = -1, clrHoverBorder = -1, clrDisText = -1, clrDisBack =
-1, clrDisBorder
= -1)
idFrom, idTo - define range of control IDs that will use new colors. To set
color for single control use the same value for both idFrom and idTo
border - defines border width of button (does not affect other control types)
clrText, clrBack, clrBorder - define colors of control text (fgcolor), background
(bgcolor) and border (if border width is > 0 ) in "default" control
state (unselected)
selectfgcolor. -1 means colorDefault and if all colors are set to default
then control uses SYSTEM (Windows) look
clrSelText, clrSelBack, clrSelBorder - define colors in selected state
clrHoverText, clrHoverBack, clrHoverBorder - define colors in hover (mouse
over) state
clrDisText, clrDisBack, clrDisBorder - define colors in disabled state
Please note that currently only buttons support custom colors and custom
border
As for v6.21 Edit fields always use system look
- AFL: GuiSetText( "text", id ) - set text of the control
- AFL: RequestMouseMoveRefresh()
- request formula execution / refresh when mouse is moved INSIDE given chart
pane (so it only triggers for ONE window
under
the cursor)
This provides less resource consuming way to handle chart graphics that depends
on mouse hovering over chart pane than using RequestTimedRefresh as it only
triggers one window currently under the cursor and only does not trigger refreshes
when mouse does not move
NOTE2: mouse move refreshes come "as fast as possible". if your
code is fast you can get butter smooth animation (even 50fps)
Example:
Plot( C, "Price", colorDefault );
GfxCircle( GetCursorXPosition(1), GetCursorYPosition(1), 7 );
RequestMouseMoveRefresh();
- If Quote.exe is missing and AmiBroker can't do auto-update of
quotes, a detailed information is displayed of where it expects Quote.exe
file to be present
- Plugin loading changed: first AmiBroker attempts to load
plugins for "Plugins" subfolder
from where Broker.EXE file is located (new behavior) and if subfolder is
NOT found, it then defaults to old behavior (using "Plugins" subfolder
under current working
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