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

[amibroker] Object Quotations and its method "Item"???



PureBytes Links

Trading Reference Links


Hi, 
 In AB manual there is an object its methods for jscript as followin:

======
Quotations (collection)

properties:

Count : number 
methods:

Add( DateTime: string ) : object 
Item( Item : string or number) : object 
Remove( Item : string or number ) : boolean 
======

How do you use the method "Item". Whats the item in the  context of
Quotations object?

I have tried using it and it always returns null. hence I am unable to
use the method "Remove" as it requires an "Item".

My sample code to remove all quotations for the tickers leaving the
ticker i nthe database is unable to delete the quotations???

=======
var oAB = WScript.CreateObject("Broker.Application");
var fso = new ActiveXObject("Scripting.FileSystemObject");
var oStocks = oAB.Stocks;
var Stockcount = oStocks.Count;


for( i = 0; i < Stockcount; i++ )
{	
	oStock = oStocks( i );
	oQuotes =  oStock.Quotations;
	var QuoteCount = oQuotes.Count;

for (j = 0; j < QuoteCount; j++ )
{
	oQuote = oQuotes( j );
	var oDate = new Date( oQuote.Date );

	var oItem = oQuotes.Item(oDate);


WScript.Echo("Deleting Quotation for " + oStock.Ticker + " for the
date " + oDate );

if ( oQuotes.Remove(oItem) )
	WScript.Echo("Success Deleting" );
else
	WScript.Echo("Unable to Delete" );

if ( j >= 2)
break;
}
break;
}

oAB.SaveDatabase();
oAB.RefreshAll();

WScript.Echo("QuotationDel script finished" );
==========


Thanks
Choco






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Has someone you know been affected by illness or disease?
Network for Good is THE place to support health awareness efforts!
http://us.click.yahoo.com/Rcy2bD/UOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.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/