September 3, 2013 18:49
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.60 first.
Just run the installer and follow the instructions.
Then run AmiBroker. You should see "AmiBroker 5.68.1 BETA" 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.
CHANGE LOG
CHANGES FOR VERSION 5.68.1 (as compared to 5.68.0)
CHANGES FOR VERSION 5.68.0 (as compared to 5.67.2)
Note that error number in case of user-defined error message is always 99.
WARNING: this function is computationally and memory intensive. It takes about 20ms per 15K bars and 7 symbols. Try to call it JUST ONCE per scan/exploration/backtest using if( Status("stocknum")==0) or better yet, use separate scan just once to pre-calculate ranks and use it later (like composite creation scan). If you fail to do so and call StaticVarGenerateRanks for every symbol performance would drop significantly as this function not only needs lots of time to compute but it also has to lock the access to shared memory used by static variables so other threads trying to access static variables would wait until this function completes.
StaticVarGenarateRanks( "outputprefix", "inputprefix", topranks, tiemode )
"inputprefix" is a prefix that defines names of static variables
that will be used as input for ranking.
AmiBroker will search for all static variables that begin with that prefix
and assume that remaining part of the variable name is a stock symbol.
Say you want to rank stocks by ROC (rate of change). All you need to
do is to store values into static variables.
Let us say that we will use static variable names like "ValuesToSortAPPL", "ValuesToSortMSFT",
and so on.
To fill input static variables you can use this loop:
for( i = 0; ( sym = StrExtract( symlist, i ) ) != ""; i++
)
{
SetForeign(sym );
Value = ROC( C, 10 );
RestorePriceArrays();
StaticVarSet( "ValuesToSort" + sym, Value );
}
Now you are ready to perform sorting/ranking. There are two modes, normal
ranking mode and Top/Bottom Rank mode.
Normal ranking mode is performed when toprank argument is set to zero.
StaticVarGenerateRanks( "rank", "ValuesToSort", 0, 1224 );
In this case StaticVarGenerateRanks call would generate set of static
variables starting with prefix defined by 2nd argument
each variable holding the rank of particular symbol, so in this case
RankValuesToSortMSFT will hold ranking of MSFT
RankValuesToSortAAPL will hold ranking of AAPL
Note that in AmiBroker rank count start from ZERO.
Third argument (topranks) is zero in normal ranking mode
Fourth argument (tiemode) defines how ties are ranked. Supported modes
are 1234 and 1224. In 1224 mode ties are numbered with equal rank.
Example code for normal ranking mode (everything done is done in one
pass, can be used in indicator):
symlist = "C,CAT,DD,GE,IBM,INTC,MSFT";
// delete static variables
StaticVarRemove("ValuesToSort*");
// fill input static arrays
for( i = 0; ( sym = StrExtract( symlist, i ) ) != ""; i++ )
{
SetForeign(sym );
Value = ROC( C, 10 );
RestorePriceArrays();
StaticVarSet( "ValuesToSort" + sym, Value );
}
// perform ranking
StaticVarGenerateRanks( "rank", "ValuesToSort", 0,
1224 ); // normal rank mode
// read ranking
for( i = 0; ( sym = StrExtract( symlist, i ) ) != ""; i++ )
{
Plot( StaticVarGet( "RankValuesToSort" + sym ), sym, colorCustom10
+ i );
}
Top/bottom ranking mode (that generates top/bottom ranking tables that
hold indexes to top ranking values. When topranks > 0 top ranked values
are used, when topranks < 0 then bottom ranked values are used.
The values are stored in variables that have format of:
OutputprefixInputprefixN where N is a number 1, 2, 3 representing top/bottom
ranks. Let us assume that
OutputPrefix parameter is "Top" and Inputprefix parameter is
ROC.
In such case variable TopROC1 would hold the index of top rated value.
TopROC2 would hold second top rated value, and so on.
StaticVarGenerateRanks function uses rank numbering that starts from
ONE.
In top ranking mode StaticVarGenerateRanks will also prepare static variable
that contains comma separated list of variable names that can be used
to
find out which index refers to which symbol. So if TopROC1 holds 1 you
would lookup first substring in TopROCSymbols variable to find out what
variable (symbol)
ranked at the top.
Additionally StaticVarGetRankedSymbols gives easy-to-use method to retrieve
comma separated list of ranked symbols for particular datetime.
Example code for top ranking mode
symlist = "C,CAT,DD,GE,IBM,INTC,MSFT";
// delete static variables
StaticVarRemove("ValuesToSort*");
// fill input static arrays
for( i = 0; ( sym = StrExtract( symlist, i ) ) != ""; i++ )
{
SetForeign(sym );
Value = ROC( C, 10 );
RestorePriceArrays();
StaticVarSet( "ValuesToSort" + sym, Value );
}
// perform ranking
StaticVarGenerateRanks( "rank", "ValuesToSort", 0,
1224 ); // normal rank mode
StaticVarGenerateRanks( "top", "ValuesToSort", 3,
1224 ); // top-N mode
StaticVarGenerateRanks( "bot", "ValuesToSort", -3,
1224 ); // bottom-N mode
// read ranking
for( i = 0; ( sym = StrExtract( symlist, i ) ) != ""; i++ )
{
Plot( StaticVarGet( "RankValuesToSort" + sym ), sym, colorCustom10
+ i );
}
sdt = SelectedValue( DateTime() );
Title = "{{NAME}} -{{DATE}} - {{VALUES}} TOP: " + StaticVarGetRankedSymbols( "top", "ValuesToSort",
sdt ) +
"
BOT: " + StaticVarGetRankedSymbols( "bot", "ValuesToSort",
sdt ) ;
CHANGES FOR VERSION 5.67.2 (as compared to 5.67.0)
CHANGES FOR VERSION 5.67.0 (as compared to 5.66.0)
Example:
printf("Only files:\n");
_N( list = fdir( "c:\\*.*", 1 ) );
for( i = 0; ( filename = StrExtract( List, i ) ) != ""; i++ )
{
printf( filename + "\r\n" );
}
printf("\n\nOnly directories:\n");
_N( list = fdir( "c:\\*.*", 2 ) );
for( i = 0; ( filename = StrExtract( List, i ) ) != ""; i++ )
{
printf( filename + "\r\n" );
}
printf("\n\nBoth files and directories:\n");
_N( list = fdir( "c:\\*.*", 3 ) );
for( i = 0; ( filename = StrExtract( List, i ) ) != ""; i++ )
{
printf( filename + "\r\n" );
}
newwl will hold new watch list index.
Currently only creation of watch list is supported by this function.
CHANGES FOR VERSION 5.66.0 (as compared to 5.65.0)
#
$FORMAT NAME, DELISTING_DATE
$NOQUOTES 1
$OVERWRITE 1
SYMBOL,"2012-07-0
Open/Close tick % thickness - controls the thickness of line used to plot
open/close ticks. It is expressed in % of main bar thickness (default is
100%)
Open/Close tick % length - controls the length of open/close ticks. It is
expressed in % of candle width which is usually half the distance between
bars (but not more than 30 pixels).
CHANGES FOR VERSION 5.65.0 (as compared to 5.64.0)
CHANGES FOR VERSION 5.64.0 (as compared to 5.63.0)
"Individual Optimize" will use all available processor cores to
perform single-symbol optimization.
In "Current symbol" mode it will perform optimization on one symbol.
In "All symbols" and "Filter" modes it will process all
symbols sequentially, i.e.
first complete optimization for first symbol, then optimization on second
symbol, etc.
Limitations:
1. Custom backtester is not supported (yet)
2. Smart optimization engines are NOT supported - only EXHAUSTIVE optimization
works.
For explanation of these limitations see http://www.amibroker.com/guide/h_multithreading.html
Eventually I may get rid of limitation (1) - when I change the CBT NOT to
use OLE anymore.
But (2) is probably here to stay for long.
CHANGES FOR VERSION 5.63.0 (as compared to 5.62.0)
AddRankColumn(); // without prior sorting AddRankColumn just adds line
number
SetSortColumns(-4);
AddRankColumn(); // rank according to 4th column (descending)
SetSortColumns(-3);
AddRankColumn(); // rank according to 3rd column (ascending)
CHANGES FOR VERSION 5.62.0 (as compared to 5.61.0)
b) Entire chart pane (independent parameters, but shared formula), the same as (a) but does NOT create duplicate of the formula so it shares the very same formula file with the original pane
c) Entire chart pane (hard-wired, shared parameters, formula and drawings,
same chartID) - a new pasted pane is directly hard-wired with pane being
copied, so it shares the same CHART ID and every change made to it is made
to the original (source) too.
CHANGES FOR VERSION 5.61.0 (as compared to 5.60.3)
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