[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Script to delete symbols



PureBytes Links

Trading Reference Links

Hi,

What's wrong with this script?

///////////////////////////////////////////
var oAB = new ActiveXObject("Broker.Application");
var oStocks = oAB.Stocks;
var StockQty = oStocks.Count;
var fso = new ActiveXObject("Scripting.FileSystemObject");
var f = fso.CreateTextFile("deletedSymbols.txt", true);

WScript.Echo("Deleting..." );

reg = "~~$"; // delete symbols end with ~~
for( i = 0; i < StockQty; i++ ){
     oStock = oStocks( i );
     t = oStock.Ticker; <---- got error here! 
                              need to be an object?
     if(t.match(reg)){
        oStocks.Remove(t); 
        f.WriteLine(t);
     }
}
f.Close();
WScript.Echo("Symbols Deleted" );
// end //////////////////////////////////////////

Thank you for help.
Eric


Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.441 / Virus Database: 268.17.35/680 - Release Date: 2/10/2007 9:15 PM