How To - Use Import ASCII to build a new watchlist

With the Import Wizard, we can create a custom format for future use with Import ASCII.
However, when using the custom format, there is no prompt for the target watch list. How can a custom.format be used to import data into a user specified watch lists?

The AB User’s guide is your friend…
https://www.amibroker.com/guide/
http://www.amibroker.com/bin/UsersGuide.pdf
Or simply go to Help - Help contents menu within AmiBroker application

As for your question. It is easy. Simply add command

$WATCHLIST 0

either to Import wizard’s “Additional commands” text field.
Or add it to your already existing format file. Format files are human readable files so simply open it with a text editor of your choice and edit its content.

In upper example zero stands for watchlist 0. So if you want to move the to be imported data to a different watchlist then replace zero with your preferred WL number.

Further topic related links
https://www.amibroker.com/guide/d_ascii.html
https://www.amibroker.com/guide/w_impwizard.html
http://www.amibroker.com/kb/index.php?s=ascii
etc.

1 Like

There are so many ways to import, export, delete, Watchlist manipulation, and so on.
I think Tomasz he has to write a big book about that. But the Question is going to read that?

First of all welcome to the AB forum

Do you know that you can press the mouse right click on the Watchlist?

https://www.amibroker.com/guide/h_watchlist.html

The simple way is just create .tls file containing all your symbol and save it to Database\watchlist folder.

1 Like

Using fxshrat’s suggestion, I can adapt the following workflow to import tickers contained in different source files, into different Amibroker watch lists:

One Time Setup

  1. Create new watch list or rename List 1 to “Imported Tickers” Make sure this is the first watch list in the Watch Lists tree. Adjust the order, if necessary, by editing the index.txt file located in the WatchLists sub-folder.(you may have to restart AMIbroker to see the updated order).
  2. Use the Import Wizard to create the custom.format file. Add $WATCHLIST 0 to the additional commands.

Repeat these steps as needed:

  1. File->Import ASCII, set “Files of Type” to your desired custom format, ten open the source ticker file. The ticker data will import into the “Imported Tickers” watchlist.
  2. Left click any symbol in the “Imported Tickers” watchlist, then type ^a to select all tickers.
  3. Right Click->Watchlists->Add Selected Symbols. Select a target watchlist and click OK and accept the Multiple symbols selected prompts. The selected tickers (symbols) will be added to the chosen target watchlist.
  4. Right Click the “Imported Tickers” watchlist and choose Erase.

The above is a 4 step process. It would be nice if we could right click the target watchlist and choose Import ASCII, and by default, the data would import into the selected watchlist.

1 Like

[quote=“garyrosner, post:5, topic:714”]
Adjust the order, if necessary, by editing the index.txt file located in the WatchLists sub-folder.(you may have to restart AMIbroker to see the updated order).[/quote]

Editing index.txt? What for? Simply go to Symbol - Categories - Watchlist and use Move up or Move Down buttons after selecting a list.

If using Import wizard then you don’t really need to use that command since there is a drop down menu for Groups & Watchlists to choose from. 2nd picture https://www.amibroker.com/guide/w_impwizard.html

I thought this thread was about how to move tickers data file to WL during same (first?) import process. Now it turns out as feature request. Feature request page is to be found here http://www.amibroker.com/members/feedback/index.php

BTW if you want to add tickers to different / multiple WL via file import (as thread title suggests) then in addition you have to add command

$OVERWRITE 1

(You might have to click “View - Refresh all” after import in order to visually see effect.)

If you don’t add upper command for import to an existing ticker of database to be updated then $Watchlist command as well as Import Wizard’s WL drop down menu selection are ignored! Again important read is https://www.amibroker.com/guide/d_ascii.html as mentioned in 2nd post of this thread.

No, this is BAD idea. Beginners like original poster should use methods described in the manual: http://www.amibroker.com/guide/h_watchlist.html

(Hint for those who read only first paragraph of any instructiton: import/export is at the end of the document)

I like the fact that i can use import command to add to the watchlist. How can i remove a symbol from the watchlist using the import command? I am looking for a way to programatically manage the watchlist.