April 16, 2011 10:53
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.30 first.
Just run the installer and follow the instructions.
Then run AmiBroker. You should see "AmiBroker 5.39.0 BETA" written in the About box.
See CHANGE LOG below for detailed list of changes.
CHANGE LOG
CHANGES FOR VERSION 5.39.0 (as compared to 5.38.0)
CHANGES FOR VERSION 5.38.0 (as compared to 5.37.1)
- by turning this ON, zoom level gets reset to default number of bars
as defined in preferences for
any loaded layout, bringing old (pre-5.37) behaviour
The output is convolution of input aray with coefficents table (impulse response table).
The function performs automatic normalization of coefficient table if necessary (if its sum is not 1)
INPUTS:
array - input array to be smoothed
coefficients - array of FIR coefficients
size - number of coefficients ( filter_order + 1 )
It is functional (but 2+ times faster) equivalent of following AFL:
function FIR_AFL( input, coeff, size )
{
result = 0;
sumcoeff = 0;
for( i = 0; i < Min( size, BarCount ); i++ )
{
sumcoeff += coeff[ i ];
result += coeff[ i ] * Ref( input, - size + i + 1 );
}
return result/sumcoeff;
}
For example 5 bar weighted moving average can be written:
coeff[ 0 ] = 1;
coeff[ 1 ] = 2;
coeff[ 2 ] = 3;
coeff[ 3 ] = 4;
coeff[ 4 ] = 5;
FIR( Close, coeff, 5 );
Another example: ALMA which is FIR filter with shifted Gaussian coefficents can be implemented as follows:
function ALMA_AFL( input, range, Offset, sigma )
{
local m, im, s, Coeff;
m = floor( Offset * (range - 1) );
s = range / sigma;
for( i = 0; i < Min( range, BarCount ); i++ )
{
im = i - m;
Coeff[ i ] = exp( - ( im * im )/ ( 2 * s * s ) );
}
return FIR( input, Coeff, range );
}
function HMA_AFL( input, Range )
{
return WMA( 2 * WMA( input, int( Range / 2 ) ) - WMA( input, Range ), int(
sqrt( Range ) ) );
}
RETURNS:
datetime (scalar or array) - returned type depends on input
Example 1:
x = Now( 5 ) ;
printf("11 days from now " + DateTimeToStr( DateTimeAdd( x, 11,
inDaily ) ) ;
Example 2 (commentary):
x = Now(5);
"
now is " + DateTimeToStr( x );
for( shift = -12; shift <= 12; shift++ )
{
printf("%g seconds from now is " + DateTimeToStr( DateTimeAdd( x,
shift, 1 ) ) + "\n", shift );
printf("%g minutes from now is " + DateTimeToStr( DateTimeAdd( x,
shift, in1Minute ) ) + "\n", shift );
printf("%g hours from now is " + DateTimeToStr( DateTimeAdd( x, shift,
inHourly ) ) + "\n", shift );
printf("%g days from now is " + DateTimeToStr( DateTimeAdd( x, shift,
inDaily ) ) + "\n", shift );
printf("%g weeks from now is " + DateTimeToStr( DateTimeAdd( x, shift,
inWeekly ) ) + "\n", shift );
printf("%g months from now is " + DateTimeToStr( DateTimeAdd( x,
shift, inMonthly ) ) + "\n", shift );
printf("%g quarters from now is " + DateTimeToStr( DateTimeAdd( x,
shift, inQuarterly ) ) + "\n", shift );
printf("%g years from now is " + DateTimeToStr( DateTimeAdd( x, shift,
inYearly ) ) + "\n\n", shift );
}
Example:
InputDate = "2011-04-05";
Title = "Close value at (or before) " + InputDate + " is " +
Lookup( Close, _DT( InputDate ), -1 );
This function uses very fast binary search and it is many times faster
than previous AFL-based methods
such as FindValueAtDateTime() presented in the past.
Any call to FindValueAtDateTime ( input, dt, value ) can be now replaced
with Lookup( input, value )
(there is no need to pass dt- datetime).
NOTE: This function does not affect QuickAFL required bars, therefore
it will only search bars that are actually
loaded in arrays. For indicators it may mean that it won't be able to find
value if it is invisible, unless you
use SetBarsRequired() function to ensure that more bars are loaded.
x = C;
Plot( x, "x", colorRed );
Plot( FirstVisibleValue( x ), "fvv", colorGreen );
Plot( LastVisibleValue( x ), "lvv", colorBlue );
CHANGES FOR VERSION 5.37.1 (as compared to 5.36.0)
CHANGES FOR VERSION 5.36.0 (as compared to 5.35.0)
The result of an = assignment statement is the value of the right-hand side of the = statement. You can use an assignment statement as a conditional test, but it is not recommended. It usually is the result of a typo where a == equality test was intended, as the following example shows:
Example:
if( x = 3 ) // x will be assigned with 3 then it is used as "true" value
so condition is always met - AmiBroker will display warning 501. Assignment
within conditional
{
// this if will ALWAYS be executed
}
Probably the user meant:
if( x == 3 ) // x will be compared to 3
{
// this is true conditional part
}
If you want to overcome warning 501 while still doing assigment within conditional
perform a check like this:
if( ( x = 3 ) == True ) // this NOT cause warning 501
{
printf("test");
}
InGics( "gics_code" )
- performs yes/no test if current symbol belongs to given GICS category
for example
if GICS set for the symbol is 15103020
InGics("15"), InGICS("1510"), InGics("151030")
and InGics("15103020") will ALL return true
but all others (like InGics("20")) will return false.
Example usage:
"GICS(0) = " + GicsID( 0 );
"
GICS(1) = " + GicsID( 1 );
"
GICS(2) = " + GicsID( 2 );
for( i = 10; i < 90; i+= 1 )
{
gics_code = StrFormat("%02.0f", i );
printf("In Gics '"+ gics_code + "' = %g\n", InGics( gics_code
) );
}
CHANGES FOR VERSION 5.35.0 (as compared to 5.34.5)
CHANGES FOR VERSION 5.34.5 (as compared to 5.34.0)
CHANGES FOR VERSION 5.34.0 (as compared to 5.33.0)
CHANGES FOR VERSION 5.33.0 (as compared to 5.32.1)
CHANGES FOR VERSION 5.32.1 (as compared to 5.32.0)
CHANGES FOR VERSION 5.32.0 (as compared to 5.31.2)
CHANGES FOR VERSION 5.31.2 (as compared to 5.31.1)
CHANGES FOR VERSION 5.31.1 (as compared to 5.31.0)
CHANGES FOR VERSION 5.31.0 (as compared to 5.30.4)
returns 1 on success, 0 on failure
Example:
PlaySound("c:\\windows\\media\\ding.wav");
It is equivalent of Windows API ShellExecute, with one difference, it always
uses "open" verb.
This allows running executables, scripts, opening document files using their
associated editors, etc.
If the function succeeds, it returns a value greater than 32. If the function
fails, it returns an error value that indicates the cause of the failure.
For possible error codes, consult Microsoft documentation:
http://msdn.microsoft.com/en-us/library/bb762153(VS.85).aspx
Example:
ShellExecute("notepad.exe", "", "" );
HOW TO REPORT BUGS
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