PureBytes Links
Trading Reference Links
|
It seems that many are experiencing problems in using the JS script as
recommended. Below is a copy of this script. I have put
"industry.txt" in place of "industry_data.txt" and changed the Line
under /*open ASCII file */ to "f = fso.OpenTextFile(industry.txt, For
Reading);" Is this correct? or do I needed to show location of the
file in this line ... like "C:/ASCIIdata/industry.txt"?? I haven't
tried this yet as I wanted to make sure I'm on the right track as it
seems that a many are having problems. Thanks for any help.
Dick H.
The script for importing the data file will look like this:
/* change this line according to your data file name */
var filename = "industry.txt";
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(industry.txt, 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.IndustryID = parseInt( fields[ 2 ] );
}
/* refresh ticker list and windows */
AmiBroker.RefreshAll();
--- In amibroker@xxxxxxxxxxxxxxx, "Dennis And Lisa"
<dennisandlisa@xxxx> wrote:
> In SYMBOL > CATEGORUES > MARKET and GROUPS, the stocks ar not assgned
> to thier corresponding markets and groups. Also, the markets and
> groups are not named, but numbered. Is there a way to assign and name
> the corresponding markets and griups using some kind of file rather
> than editing each of the 10,0000 + stocks?
>
> -Dennis
>
>
> --- In amibroker@xxxxxxxxxxxxxxx, "JJ" <jparent@xxxx> wrote:
> > --- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxxx> wrote:
> > > It is all explained in the help
> > > But the csv file must be in the directory as shown within the js
file
> > > js file can be anywhere
> > > Make sure AB is open and the appropriate AB database is open
that you
> > > want to update when you run thje js file.
> >
> >
> > and the industry file needs to be renamed "industry_data.txt" or the
> > line in the javascript with the file name needs to be changed. i've
> > just renamed the file in the download section.
> >
> > \jeff
------------------------ 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/
|