You'll have to edit this a bit, but this script basically does what you want:

function DeleteStockList (ListToUse, FilterValue)

{

StockList = GetCategorySymbols(categoryWatchlist, ListToUse);

for( j=0; (CurrentTicker=StrExtract(StockList, j)) != ""; j++)

{

StockToSell = StrExtract(Stocklist, TickerIndex[j]);

if (Filtervalue ==1)

{

Deletestock(CurrentTicker);

CategoryRemoveSymbol(StockToSell , categoryWatchlist, Listtouse);

}


if (Filtervalue ==2) //Remove the entire watchlist

{

if (SelectedValue(GetTClose(StocktoSell)) > 
SelectedValue(GetYClose(StocktoSell)) * 1.1)

{

Deletestock(CurrentTicker);

CategoryRemoveSymbol(StockToSell , categoryWatchlist, Listtouse);

}

}

} //for loop

}//function deletestocklist

//Delete a single stock from the symbol list

function Deletestock(TickerToDelete)

{

AB = CreateObject("Broker.Application");

st = AB.Stocks;

st.Remove(TickerToDelete); 

}



chuck

  ----- Original Message ----- 
  From: Prashanth 
  To: [email protected] 
  Sent: Tuesday, December 05, 2006 9:49 PM
  Subject: [amibroker] Script to Automatically delete Tickers


  Hello,

  I co-moderate a group where we provide data for Indian Markets. Yesterday, 
due to using of wrong file, I generated data with wrong ticker names (when 
compared to normal ticker names). 

  Since, it would have been used by quite some people, before the problem was 
noticed, I was hoping that I could provide the persons concerned with a scrip 
which can Automatically delete Tickers I speficy in the said Script file. While 
this can be done Manually, since Number of tickers are around 250, it would be 
easier to Automate the same compared to Manual deletion.

  If someone can provide me with such a script, It shall be really helpfull.

  Thanks

  Prashanth
   

Reply via email to