AmiBroker 5.22.0 Beta Read Me
February 20, 2009 18:00
THIS IS A BETA VERSION OF THE SOFTWARE. EXPECT BUGS !!!
Backup your data files and entire AmiBroker folder
first!
INSTALLATION INSTRUCTIONS
IMPORTANT: This archive is update-only. You have to install full version
5.20 first.
Just run the installer and follow the instructions.
Then run AmiBroker. You should see "AmiBroker 5.22.0 beta" written
in the About box.
See CHANGE LOG below for detailed list of changes.
CHANGE LOG
CHANGES FOR VERSION 5.22.0 (as compared to 5.21.0)
- added ability to extend blank chart area by pressing END key multiple times
(each time 10 blank bars are added) and restoring preferences value by subsequent
pressing of HOME key.
- added option to always require variable declarations (using
local/global) on formula-by-formula basis:
SetOption("RequireDeclarations", True );
global test1;
test1 = 5; // OK variable declared
test2 = 3; // error: assignment without declaration
- added typeof() operator
The typeof operator is used in the following way:
typeof (operand)
The typeof operator returns a string indicating the type of the *unevaluated*
operand. operand is the string, variable, function identifier, or object
for which the type is to be returned.
When supplying identifier, it should be provided alone, without arithmetic
operators, without extra arguments and without braces.
If you want to check the type of value returned by the function, you must
first assign the return value to a variable and then use
typeof( variable ).
Possible return values are:
"
undefined" - identifier is not defined
"
number" - operand represents a number (scalar)
"
array" - operand represents an array
"
string" - operand represents a string
"
function" - operand is a built-in function identifier
"
user function" - operand is a user-defined function
"
object" - operand represents COM object
"
member" - operand represents member function or property of COM object
"
handle" - operand represents Windows handle
"
unknown" - type of operand is unknown (should not happen)typeof operator
allows among other things to detect undefined variables in the following
way
if( typeof( somevar ) == "undefined" )
{
/// when somevar is undefined the code here will execute
}
The following sample COMMENTARY code shows the output of
typeof in some common situations
x = MACD();
y = LastValue( x );
function testfun() { return 1; };
printf( typeof( test ) + "\n" ); // the undefined variable
printf( typeof( 1 ) + "\n"); // literal number
printf( typeof( "checking" ) + "\n"); // literal string
printf( typeof( x ) + "\n"); // array variable
printf( typeof( y ) + "\n"); // scalar variable
printf( typeof( MACD ) + "\n"); // function identifier
printf( typeof( testfun ) + "\n" ); // user function identifier
- GetSignalQty member function of Backtester object
returned zero. Fixed now
- In the Plot() function Xshift parameter was used
as z-order in 5.21 beta. Fixed now.
- Plot, PlotOHLC and PlotForeign() are no
longer limited to -5..+5 zorder range. You can use any zorder value now.
Note that if you use zorder outside default range -5..+5, you may see performance
degradation for big positive and big negative z-order values.
Approximate performance penalty is 10 milliseconds for 100 z-orders (or 1ms
for 10 z-orders)
- SetChartOptions now adds ability to programmatically extend blank space
on chart-by-chart basis
SetChartOptions( Mode = 0, Flags = 0, gridFlags = chartGridMiddle, ymin = 0,
ymax = 0, blankbars = 0 )
New, 6th parameter "blankbars" defines the minimum number of blank
bars for given chart. The default value of zero means no change
(use preferences setting).
if specified value is less than value set in preferences, it is ignored, so
you can not decrease the blank bars below value set in preferences.
if many panes within same chart use this function, then the largest specified
blankbars will be used
Note that you can still extend blank space further using END key.
Special feature - if "blankbars" is negative then extra blank bars
added are equal to absolute value of blankbars parameter plus chart gets scrolled
to rightmost position.
Caveat: forcing custom blankbars via SetChartOptions effectivelly disables
HOME key scroll to begin operation.
- the feature to extend blank area via mouse wheel and > button
is removed, due to complaints received
CHANGES FOR VERSION 5.21.0 (as compared to 5.20.0)
- Added optional data padding for non-trading days (switchable from View->Pad
non-trading days menu) - for daily and higher intervals only (FC#1136,FC#1174)
- All drawing tools
now can define Z-order (from -5 to +5).
Z-order.
Imagine that you could see the drawing objects arranged on the chart page like
puzzle pieces on a table. Some objects may appear to be placed one on top of
another, and others may be overlapping.
This third dimension of chart page is known as "Z order." If the
X axis relates to width and the Y axis to height, then the Z order relates
to depth. Although Z order cannot be seen directly, just as can you position
objects along X and Y (horizontal and vertical) axes, you can also position
them in the Z order.
Every object on the page has its Z order, positioned in back to front order,
so that objects at the front will take precedence over objects behind.
Z order gives you the ability to superimpose objects one on top of another.
You can change Z-order parameter using Properties dialog
as well as using Format->Z-Order->Bring Forward / Send Backward menus
(and default keystrokes Shift+Page Up, Shift+Page Down)
Negative values mean BEHIND axis/grid, positive mean above grid.
- Blank area past last available quote
can be now enlarged on the fly by simply using > arrow in the scroll bar
or using mouse wheel (just roll the wheel past the last bar) (FC #430,#1516,
#1500, #1239, #982, #808, #561 )
- CBT: Backtester.GetSignalQty(
bar, type ) method implemented (FC#1671)
Backtester object
GetSignalQty( bar, type ) method
- retrieves the number of signals occuring on given bar
type = 0 - both entry and exit signals
type = 1 - only entry signals
type = 2 - only exit signals
Note that AmiBroker to conserve memory keeps track only of 2 * MaxNumberOfPositions
entry signals on any single bar,
however it keeps track of ALL exit signals (because they consume much less
space and at the time of signal collection
it is not known which positions are already open, so all exits must be tracked
to prevent missing an exit)
- E-mail alerts can now be sent through different
port than 25 (see Tools->Preferences->Alerts) (FC#1641)
- Early warning of indicator space running out. At application
exit the message is displayed when less than 10% indicator space is left,
plus an offer to
run Indicator Maintenance (FC#1667)
- new AFL functions ColorBlend
ColorBlend( colorFrom, colorTo, factor = 0.5 )
- the function blends (mixes) colorFrom with colorTo with 'factor' proportion
using the following algorithm
RGB = ( 1 - factor ) * RGB(colorFrom) + factor * RGB(colorTo );
So factor = 0 means use colorFrom only, factor = 1 means use colorTo only.
All in-between values
mean create mix of colors. The lower the factor value means more colorFrom.
This function makes it easy to lighten or darken colors like this:
function ColorLighten( color )
{
return ColorBlend( color, colorWhite, 0.5 );
}
function ColorDarken( color )
{
return ColorBlend( color, colorBlack, 0.5 );
}
- Plot, PlotForeign and PlotOHLC now have new
parameter zorder which defines the Z-axis position of given plot. (FC#257)
zorder can be set from -5 to 5.
The default is zero.
Zorder = 0 means also where the "grid" is located.
So if you want to plot BEHIND the grid
you need to specify negative zorder parameter.
Smaller values mean draw first (i.e. BEHIND others), higher values mean draw
later (ON TOP of others).
Plots are drawn in the following order:
- zorder parameter takes precedence over
the order of calling Plot() functions, so if z-order is set,
it determines plotting order.
See http://www.amibroker.com/gifs/zorder.gif
- If
multiple plots use the same z-order parameter they are plotted in reverse
call order (ones that appear last in the code are plotted first). This
rule can be changed by already existing switch graphzorder = 1 which,
when specified,
reverses this behaviour (so plots are drawn in call order).
Please note
the above applies to each zorder "layer" separately (so
within same zorder "layer" reverse call rule applies)
This may sound complicated but is required for backward compatibility.
Example:
Bollinger bands with "cloud" fill behind price (zorder =
-1)
P = ParamField("Price
field",-1);
Periods = Param("Periods", 15, 2, 100, 1 );
Width = Param("Width", 2, 0, 10, 0.05 );
Color = ParamColor("Color", colorLightGrey );
Style = ParamStyle("Style")
| styleNoRescale;;
Plot( bbt = BBandTop(
P, Periods, Width ), "BBTop" + _PARAM_VALUES(),
Color, Style );
Plot( bbb = BBandBot(
P, Periods, Width ), "BBBot" + _PARAM_VALUES(),
Color, Style );
PlotOHLC( bbt,
bbt, bbb, bbb, "", ColorBlend(
Color, colorWhite, 0.9 ), styleCloud, Null, Null, Null,
-1 );
- Rectangle
and Ellipse drawing tool now are by default SOLID, with default fill color
being a blend between background and selected drawing color, they
are use ZOrder = -1 (behind regular plots) by default
- Support for SSL (secure
connection) e-mail alerts added, so now you can use your GMail accounts. (FC#83)
Steps:
1. Download and install AmiBroker 5.21 or higher
2. Download and run SSL add-on from http://www.amibroker.com/bin/SSLAddOn.exe
3. Configure (Tools->Preferences->Alerts) with SSL enabled as shown in
this picture:
http://www.amibroker.com/gifs/gmailalert.gif
- X-Y
co-ordinate labels on axes implemented. Can be controlled using View->X-Y
labels menu. (FC#1621, FC#732)
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