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

[amibroker] Re: data base issue



PureBytes Links

Trading Reference Links

Thank you Graham.....if I copy the file below to MS Notepad, under
what file type and extension do I save it. And after I save it, will
it be automatically executable?

thank you
-Dennis





--- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxxx> wrote:
> you could write a format file like the ascii import files and import
> the data that way
> See AB subdirectory "\formats" and in help screens - Reference Guide -
> Ascii Import Reference and Automation Object Model
> Just set up a format file and try importing via ascii import
> Else write a script file based on the Industry import JS file and
> include the other information
> 
> Something like this changed from the industries import JS file to
> include markets and groups. The sectors-industries arrangement should
> be set with the broker.industry and broker.sector files.
> The JS file below runs from windows with your AB databse open. CSV
> file as per this has each row with :
> Ticker,FullName,Market,Group,Industry
> 
> I have not tested this file below, so may have type or syntax errors.
> but should be enough for a start. As it turns out I have been thinking
> along lines of this for setting level 3 subindustires into the groups
> as the sector only allows single level industry.
> 
> 
> /* change this line according to your data file name */
> var filename = "C:\\Program Files\\Amibroker\\Scripts\\Industries.csv";
> var fso, f, r;
> var ForReading = 1;
> var AmiBroker;
> var fields;
> var stock;
> /* Create AmiBroker app object */
> AmiBroker = new ActiveXObject( "Broker.Application" );
> /* ... and file system object */
> fso = new ActiveXObject( "Scripting.FileSystemObject" );
> /* open ASCII file */
> f = fso.OpenTextFile( filename, ForReading);
> /* read the file line by line */
> while ( !f.AtEndOfStream )
> {
> r = f.ReadLine();
> /* split the lines using comma as a separator */
> fields = r.split(","); 
> /* add a ticker - this is safe operation, in case that */
> /* ticker already exists, AmiBroker returns existing one */
> 
> 
> stock = AmiBroker.Stocks.Add( fields[ 0 ] ); 
> stock.FullName = fields[ 1 ];
> stock.MarketID = parseInt( fields[ 2 ] );
> stock.GroupID = parseInt( fields[ 3 ] );
> stock.IndustryID = parseInt( fields[ 4 ] );
> }
> /* refresh ticker list and windows */
> AmiBroker.RefreshAll();
> WScript.Echo("Industry Setup Finished" );
> 
> 
> 
> 
> On 6/13/05, Dennis And Lisa <dennisandlisa@xxxx> wrote:
> > Is there a way I can get the most current stock info containing
> > MARKET, SECTOR, INDUSTRY, GROUP info in the CSV file to be read by the
> > java script "Industries" and imported into Amibroker. I have the most
> > current version of Amibroker, and I use Yahoo for quotes that go into
> > my US Stocks folder. My Categories are as follows:
> > 
> > Market :
> > 0 = Undefined
> > 1=NYSE
> > 2=AMEX
> > 3=Nasdaq
> > 4=OTC
> > 5=Mutual Funds
> > 
> > Groups:
> > 0=undefined
> > 1=stocks
> > 2=mutual funds
> > 3=futures(cash)
> > 4=futures(commodity)
> > 5=indecies
> > 
> > Sectors:
> > 0=undefined
> > 1=capital goods and services
> > 2=consumer cyclical
> > 3=consumer staples
> > 4=energy
> > 5=financial
> > 6=health care
> > 7=information
> > 8=internet
> > 9=materials
> > 10=retail
> > 11=transportation
> > 12=utilities
> > 15=medai
> > 16=banks and finance
> > 17=insurance
> > 18=telecommunications
> > 19=investemt and finance services
> > 20=property trusts
> > 21=healthcare and biotechnology
> > 22 =miscellaneous inductries
> > 23=diversified industries
> > 24=tourism and leisure
> > 25=debt issuer
> > 
> > Industries:
> > 0= undefined
> > 1=aerospace-defence
> > 2=aerospace defence eqp+
> > 3=bus-serv-education+
> > etc,etc,etc
> > 
> > Please help and thank you
> > Dennis
> > 
> > 
> > 
> > 
> > 
> > 
> > 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
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> 
> 
> -- 
> Cheers
> Graham
> http://e-wire.net.au/~eb_kavan/




------------------------ 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/