September 1, 2006
How to change property for multiple symbols at once.
In order to automatically change a property for many symbols - instead of manual action in Symbol -> Information dialog one can use OLE automation.
For example - to unmark “Use only local database” option for all the symbols, it’s enough to run such SCAN:
- Analysis -> Formula Editor:
- enter:
AB = CreateObject("Broker.Application");
st = AB.Stocks(Name());
st.DataSource = 0;
Buy = 0;
- Tools -> Send to Auto-analysis
- Apply to: All Symbols, N-last quotations = 1
- press SCAN
The other example shows how to rename all the symbols and replace .TO suffix with -TC (this may be useful when we want to use the existing historical data with a new datasource which uses a different symbology).
- Analysis -> Commentary
- enter:
AB = CreateObject("Broker.Application");
sts = AB.Stocks();
Qty = sts.Count;
for( i = Qty - 1; i >= 0; i = i - 1 )
{
st = sts.Item( i );
Ticker = st.Ticker;
{
printf("changing " + ticker + "\n" );
Length = StrLen(Ticker ) ;
if(StrFind(ticker, ".TO") )
st.Ticker = StrLeft( ticker, Length-3)+"-TC";
}
}
- press APPLY
- use: VIEW -> Refresh All to see the changes in the symbol tree.
Filed by support at 10:03 am under AFL

for( i = Qty - 1; i >= 0; i– ) doesn’t work - are there some dodgy chareacters here ?
for( i = Qty - 1; i >= 0; i–- ) parses OK
looks like “n” should be “n” too
Hey, where’d my backslash go ? What’s up here ?
– is postdecrement unary operator. - is subtraction - it needs TWO arguments, not one - see User’s Guide.