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

Re: [amibroker] Script to Automatically delete Tickers



PureBytes Links

Trading Reference Links

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: amibroker@xxxxxxxxxxxxxxx 
  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
   
Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.15.9/573 - Release Date: 12/5/2006 4:07 PM