CloneNameAdd = "_Clone";
watchlist = 10; // choose watchlist to move created symbols to
group = 255; // alternative group (instead of group 253) to move created symbols to
market = 255; // alternative market (instead of market 253) to move created symbols to
nm = Name();
// 1. In Analysis choose "Apply to: Current", "Range: All quotes",
// choose "Periodicity" in backtester settings and then click "Scan" to clone symbol(s)
// As for giving a composite name don't forget starting with tilde!
if ( Status( "action" ) == actionScan )
{
atcmode = atcFlagDefaults;
for ( i = 1; i < 11; i++ )//number of clones -> 10
{
indexname = "~" + nm + CloneNameAdd + i;
AddToComposite( Open, indexname, "O", atcmode );
AddToComposite( High, indexname, "H", atcmode );
AddToComposite( Low, indexname, "L", atcmode );
AddToComposite( Close, indexname, "C", atcmode );
AddToComposite( Volume, indexname, "V", atcmode );
AddToComposite( OI, indexname, "I", atcmode );
}
}
// 2. in Analysis keep previous settings and then click "Explore"
if( Status( "action" ) == actionExplore )
{
List = CategoryGetSymbols( categoryMarket, 253 );
for ( k = 0; ( symbol = StrExtract( List, k ) ) != ""; k++ )
{
if ( StrFind( symbol, nm + CloneNameAdd ) )
{
CategoryAddSymbol( symbol, categoryWatchlist, watchlist );// choose watchlist number
CategoryAddSymbol( symbol, categoryGroup, group );
CategoryAddSymbol( symbol, categoryMarket, market );
}
}
}
Buy = 0;
NumColumns = 1;
Filter = Status( "lastbarinrange" );
SetOption( "RefreshWhenCompleted", True );