CategoryRemoveSymbol() - update

Please ignore prior posing - same subject.

Problems may be related to debug view as I am getting very strange debug data.

Is there a compatibility issue between AB vers 6.29 and Debug View vers 4.81.

When I print out the Watchlist from CategoryGetSymbols(), I get extra symbols that do not exist in data base and different number of symbols than exist in data base.

Example: image
The first 2 symbols do not exist in db ???

Ara

@ara1

I cannot comment specifically on version 6.29 since I have not yet tried it.

But in the past, I have seen something similar using the watchlists: in my case, the list included some "old" symbols that were previously deleted from the DB.

Normally, when working with AmiBroker, when you delete a symbol from the DB in the correct way, it is also removed from any watchlist, but sometimes, probably due to some strange circumstance or a system malfunction, a watchlist file may not be updated correctly (no purging of the deleted symbols).

When AmiBroker starts, it loads the watchlists associated to a DB from the "watchlists" folder that is a child of the main DB folder.

In this watchlists folder, there are multiple files, and each one is corresponding to a watchlist.

Using a text editor open the file of the watchlist where you saw the "extra" symbols.
Are they in this file too? If not, ignore the rest of this post.

Otherwise, it is not a debugView issue. Simply close all the instances of AmiBroker and edit the file removing the unwanted symbols and save it again.
Reopen AmiBroker and do your test again. This should fix the anomaly.

Normally, when working with AmiBroker, when you delete a symbol from the DB in the correct way, it is also removed from any watchlist, but sometimes, probably due to some strange circumstance or system malfunctions, a watchlist file may not be updated correctly (no purging of the deleted symbols).

The issue is a subtle one, since AmiBroker, at startup, checks the watchlists content and removes from the displayed lists any "extra" symbol that is no longer in the database (so you do not see them in the UI).

This means that it is possible to discover this rare anomaly only when using a function like CategoryGetSymbols() that seems to access the stored file instead of the in-memory list (I actually found this when I was using it for some ranking purposes and had some "foreign" empty arrays due to non-existent symbols).

Editing the misaligned watchlist file outside of AmiBroker seems to be the quickest way to fix the issue.

You were correct..... the 2 symbols that were extraneous were indeed in the stored files but oddly enough did not show in the watchlists through Amibroker.... which seems strange as I expect Amibroker initializes watchlists from these files ???

Thanks for the info

In its "symbol" window, AmiBroker displays ONLY symbols that are present in the DATABASE.

CategoryGetSymbol on the other hand would return actual content of watch list file (.tls).

Watch lists are separate text files stored in "Watchlists" subfolder that many users manipulate MANUALLY (or programmatically via scripts/fopen/etc) AmiBroker only removes items from watch list file if they are deleted from the database from within AmiBroker, but it does NOT remove symbols that were placed in those text files in other ways by the user, that are not present in the database.

This is for many reasons including 3rd party tools doing modifications to watch lists by directly manipulating .TLS (watch list) files.

1 Like