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

Re: WatchList Import Question - Solution Found !!!!!



PureBytes Links

Trading Reference Links

I uploaded the file to the Yahoo Group Website. This is where I 
usually read the messages at rather than having them emailed to me 
directly. Your error probably came from the cutting and pasting.

The script does not need a particular name. It does need a .js 
extension though. Also, the import file name of tickers must reside 
in the same directorey as the script does. I also have AmiBroker 
workspace open when I run it.

Here's link to file: 
http://groups.yahoo.com/group/amibroker/files/Copy%20Ticker%20list%
20to%20Group%20List%2010.js


Brett

--- In amibroker@xxxx, AR.Holzwarth@xxxx wrote:
> I think your method of importing stock lists to Watch Groups would 
be
> extremely interesting. I had been looking for something like that. 
I had a
> problem though with running the script. I get a Java compilation 
error in
> line 61, character 38 "unterminated string constant". Since I am 
completely
> unfamiliar with JVscript I can not find the problem. I just copied 
the
> script as you provided it and replaced the file name of the .CSV 
file. Does
> the .js script file have to have a particular name?
> 
> Was there a typing error when copying the script to the e-mail 
window? I
> would appreciate if you could provide some hints (may be something 
else,
> like other files etc., has to be initialized? I also think that it 
might be
> helpful if you could provide the script as an attached file.
> Thank you much for your efforts.
> 
> Regards
> Al
> 
> 
> ----- Original Message -----
> From: <brett_f1@xxxx>
> To: <amibroker@xxxx>
> Sent: Sunday, June 10, 2001 2:52 AM
> Subject: [amibroker] Re: WatchList Import Question - Solution 
Found !!!!!
> 
> 
> > I found a way to skin this cat in a round about sort of way.
> >
> > Here's what I did to get a list of tickers from an outside source
> > into a watchlist in AmiBroker:
> >
> > 1. Save list in file ZacksTop.csv (It's from Zacks and is their 
Top
> > Rank).
> > 2. I modified a JScript routine to read the file and place 
tickers
> > into group 10 in AMI (You can modify the script to change this
> > another groupID if you like).
> > 3. Run the Script.
> > 4. Start Automatic Analysis
> > 5. Enter this as your Exploration:
> >
> > filter = 1;
> > numcolumns = 1;
> >
> > 6. Use a filter of stocks in Group 10
> > 7. Set your range and press Explore
> > 8. Right Click on the results and add your results to a watch
> > list!!!!!!
> >
> >
> > Here's the Jscript routine:
> >
> > /*
> > ** File: Copy Ticker list to Group 10 List
> > ** Created: Brett Forrester, June 09, 2001
> > ** Purpose: Assign Tickers to Group List 10 in lieu of Watch List
> > ** Language: JavaScript (Windows Scripting Host)
> > **
> > ** The data is stored in lines with following format
> > ** <ticker>
> > **
> > */
> >
> > WScript.Echo( "Script Started" );
> >
> > /* change this line according to your data file name */
> > ImportStocks("ZacksTop.csv");
> >
> > WScript.Echo( "Finished" );
> >
> > function ImportStocks( filename )
> > {
> > 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);
> >
> > i = 1;
> > /* read the file line by line */
> > while ( !f.AtEndOfStream )
> > {
> > r = f.ReadLine();
> >
> > /* split the lines using comma as a separator */
> > fields = r.split(",");
> >
> > try
> > {
> >
> > /* add a ticker - this is safe operation, in
> > case that */
> > /* ticker already exists, AmiBroker returns
> > existing one */
> > stock = AmiBroker.Stocks.Add( fields[ 0 ] );
> >
> > /* This line assigns the stock to Watch List
> > 0 */
> > stock.GroupID = 10;
> >
> > }
> > catch( e )
> > {
> > WScript.echo( "There is a problem in
> > line no." + i + ".\nThe line looks as follows:\n'" + r + "'\nIt 
will
> > be skipped and next lines will be processed as normal" );
> > }
> >
> > i++;
> > }
> >
> > /* refresh ticker list and windows */
> > AmiBroker.RefreshAll();
> >
> > }
> >
> > Happy Watch Listing to all,
> >
> > Brett
> >
> >
> > --- In amibroker@xxxx, "Tomasz Janeczko" <tj@xxxx> wrote:
> > > Hi Steve,
> > >
> > > There is no such property yet.
> > >
> > > Best regards,
> > > Tomasz Janeczko
> > > ===============
> > > AmiBroker - the comprehensive share manager.
> > > http://www.amibroker.com
> > >
> > > ----- Original Message -----
> > > From: brett_f1@xxxx
> > > To: amibroker@xxxx
> > > Sent: Saturday, June 09, 2001 8:09 PM
> > > Subject: [amibroker] WatchList Import Question
> > >
> > >
> > > Does anyone know of a method to import a list of tickers in
> > a .csv
> > > file and assign them to a watchlist ? Or, in more technical
> > terms,
> > > what is the name of the property in the stock class that I can
> > use to
> > > write a Script routine to do this?
> > >
> > > Brett
> > >
> > > PS I will share the routine if someone can help with the 
property
> > > name I need.
> > >
> > >
> > > Yahoo! Groups Sponsor
> > > www.
> > >
> > >
> > >
> > >
> > >
> > > Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> > Service.
> >
> >
> >
> >
> > Your use of Yahoo! Groups is subject to 
http://docs.yahoo.com/info/terms/
> >
> >