|
本帖最後由 joshsmi 於 15-6-6 00:05 編輯
CHANGES FOR VERSION 5.99.0 (as compared to 5.98.0)
- AFL: added support for matrices (2D tables of numbers).
Matrix support is preliminary and subject to change. To create a matrix use
my_var_name = Matrix( rows, cols, initvalue)
To access matrix elements, use:
my_var_name[ row ][ col ]
where
row is a row index (0... number of rows-1)
and
col is a column index (0... number of columns-1)
Matrices and their elements support all scalar (element-wise) arithmetic and logical operations
So you can for example add, subtract, multiply, divide two matrices if they have same dimensions with one call.
x = Matrix( 5, 6, 9 ); // matrix 5 rows 6 columns, initial value 9
y = Matrix( 5, 6, 10 ); // matrix 5 rows 6 columns, initial value 10
z = y - z; // will give you matrix 5 rows and 6 columns filled with elements holding value 1 (difference between 10 and 9).
All those operations are performed ELEMENT-WISE.
You can also apply any arithmetic and logical operation on matrix AND scalar value. This would perform element-wise operation on each element of source matrix and given scalar value.
m = Matrix( 10, 10, 0 ); // m will be 10x10 matrix filled with zeros
z = m; // z is now also a matrix
for( i = 0; i < 10; i++ )
{
z[ i ][ 4 ] = i; // fill z with some other values, note that m will remain unaffected.
}
for( i = 0; i < 10; i++ )
_TRACEF( "%g = %g, %g, %g\n", i, m[1], m[ i][4], z[ i][4]);
// scalar addition (element wise)
z += 3;
m += 5;
for( i = 0; i < 10; i++ )
_TRACEF( "%g = %g, %g, %g\n", i, m[1], m[ i][4], z[ i][4]);
Additionally there is a new operator @ that handles matrix product (matrix multiplication in the sense used in linear algebra). This operator requies that number of columns in first array is the same as number of rows in second array.
- AFL: new Error 59. Too many subscripts - displayed when user attempts to use 3 or more subscripts on matrix identifier
- AFL: new function Matrix( rows, cols, init_value = 0 ) - creates 2 dimensional table with defined number of rows and column
- AFL: new matrix product (multiplication) operator: @
a new operator @ that handles matrix product (matrix multiplication in the sense used in linear algebra). This operator requires
that number of columns in first array is the same as number of rows in second array. A = Matrix( 1, 3 );
B = Matrix( 3, 2 );
// matrix A = [ 1, 4, 6 ]
// matrix B = [ 2, 3 ]
// [ 5, 8 ]
// [ 7, 9 ]
A[ 0 ][ 0 ] = 1; A[ 0 ][ 1 ] = 4; A[ 0 ][ 2 ] = 6;
B[ 0 ][ 0 ] = 2; B[ 0 ][ 1 ] = 3;
B[ 1 ][ 0 ] = 5; B[ 1 ][ 1 ] = 8;
B[ 2 ][ 0 ] = 7; B[ 2 ][ 1 ] = 9;
X = A @ B;
_TRACEF("%g %g", X[ 0 ][ 0 ], X[ 0 ][ 1 ] );
- Charts: when chart is moved vertically by the user so it falls outside upper edge, the parts falling outside are not drawn as flat line anymore
- New Analysis: Attempt to run Walk forward on periods without any data for any symbols could result in exception. Fixed.
- New Analysis: Show current trade arrows did not show sell arrow after Individual backtest. Fixed.
- UI: Color text output in the Interpretation window was sometimes incorrect when numbers followed immediately EncodeColor call. Fixed.
- UI: Interval combo dropdown list adapts its width to higher DPI displays now
- UI: Notepad is refreshed on sliding back from auto-hide
- UI: Updating Symbol Information after ASCII import
- Upgrade info: Free upgrade only for users who purchased license after May 31, 2013
|
|