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

Re: [amibroker] Foreign and Data Holes



PureBytes Links

Trading Reference Links

Makes sense - Logic, as always...

Thanks a lot

--- In amibroker@xxxxxxxxxxxxxxx, "Dave Merrill" <dmerrill@xxxx> 
wrote:
> Without trying this myself (sorry, won't do that!), I bet you need 
to loop
> downwards, so the previously deleted bars don't effect which ones 
get
> deleted after that. If you think carefully about what bars you need 
to
> delete, step by step through the loop, you could actually always 
delete bar
> j. That would be the 100th bar from the end the first iteration, 
then the
> 99th, 98th etc.
> 
> Make sense?
> 
> Dave
>   I have written the following in VBS to be able to delete the last 
100
>   quotes of the entire database. Reason for this is the partial
>   pollution of my database with Lycos EOD quotes.
> 
>   The code works well, except it does not delete all the quotations 
but
>   only half of them and leaves dataholes instead. Maybe sopmebody 
can
>   help?
> 
>   TIA Andreas
> 
>   >>>>>>>>>>>>>>>>>>
> 
>   ToDelete = 100
> 
>   set ABO = createObject( "Broker.Application" )
> 
>   ABO.LoadDatabase("d:\money\amibroker\test")
>   set ABStocks = ABO.Stocks
>   Amount = ABStocks.count()
> 
>   for i = 0 to Amount -1
> 
>       set StockName= ABStocks(i)
>       Days= StockName.quotations.count()
>       If ToDelete > Days then ToDelete = Days
>       Start =  Days - ToDelete
> 
>       for j = Start to Days -1
> 
>           StockName.Quotations.Remove(j)
> 
>       next
> 
>   next
> 
>   AmiBroker.RefreshAll()
>   WScript.Echo( "Finished Database" )



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
     amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/