I think it was due to bugs in my AFL testing earlier, some tickers were created in the database with no name and no data. ie the sysmbols are displayed as white space visually.
I tried to delete them using the AB UI but just cannot get ride of them. As the symbols cannot be displayed it make it difficult to code AFL to delete them either.
Would appreciate if senior users can suggest some solution for getting rid of the white symbols.
@etcjkam, did you run the built-in cleanup script? (from the âToolsâ menu select âCleanup databaseâ),
This procedure will run a built-in script (located in the âscriptsâ subfolder of AmiBroker that should get rid of the tickers with no quotes or no longer traded.
But the fact that you see some âemptyâ ticker names is a bit surprising⌠Each ticker in AB is saved as a single file, and in Windows, you cannot have âemptyâ filenames or filenames that start with some spaces!
See the documentation about Amibroker database structure: Understanding AmiBroker database concepts
You may take a look under the subfolders in your database directory (I mean the ones that are named a, b, c, d, etc.) if there is something strange there and report it.
As an additional step, with the AmiBroker application closed, delete the âbroker.masterâ file in the main database folder. AmiBroker will rebuild it as needed.
On the other hand, if the problem is that you have some tickers (and corresponding associated filenames) that includes some space (or other some strange chars) that causes the âemptyâ display issue, probably the best way to get rid of them is to do it again via the OLE interface. To achieve it, you should modify the built-in cleanup.js script (or better create a similar one) in which you add a new condition that search for a space/or a special char in the âoStock.Tickerâ; if found you ask (or do it without asking as appropriate) to add that ticker to the âoStocksToDeleteâ list.
But do this only if you are familiar with JScript; in any case before doing it backup your database!
An if nothing helps⌠delete the database and rebuild it from scratch reimporting all the quotes as needed!
Dear Beppe,
Thank you very much for your patience and detailed explanation. I think your comments make lots of sense and did the following.
I ran the database cleanup script and saw a series of dialog box asking if the symbol should be deleted and âyesâ I choosed. At the end the script ask for confirmation of deleting hundreds of symbols and I confirmed. The script end with a termination message. All is well so far.
I closed AB then went into the database directory and deleted the broker.master file. When I reopen AB, strangely those symbols seems to be there still. i ran database purify and those white symbols remain in the database still.
I wonder what was wrong and why the script was not able to delete the symbols
@etcjkam, as said your situation is strange: in theory, AmiBroker should not allow any empty ticker name (by the way which version of AmiBroker are you using?).
There is one additional test that could help to understand better what is going on on your PC: when you select an empty ticker (no name) and you open the âQuote editorâ window (from the main menu âSymbolâ / âQuote editorâ) what is displayed? Any quote? Any chars in the âTickerâ column?
As a further attempt, I suggest you run (from the command line or the graphical user interface) a Windows âCheck Diskâ procedure (search in Google how to do it if you are not familiar with it).
This will check the integrity of your hard disk data (if you have multiple hard disks start with the disk where your AmiBroker database is located).
If you specify the flag to fix data errors the procedure may require a full system reboot and could take quite a while to complete.
Then choose the market having your empty symbol rows and mark all of them at once. Then click delete button in the middle of assignment window. Choose multiple symbols option in appearing next window. Done! Save DB.
If we talk about the same thing then upper method will work because it worked on another guy PCâs AB DB I fixed.
@fxshrat thanks for jumping on this thread. I hope this will solve it for @etcjkam.
I hoped that someone that already saw/experienced a similar problem could post the proper solution (my search for it was unsuccessful, but I was quite puzzled how this empty tickers could happen so I tried to give some basic AmiBroker DB maintenance suggestions).
If upper method does not work then actual solution would be the followingâŚ
Close AmiBroker first.
Go to your problematic database on your hard drive.
Open the DB folder and in there at the bottom of all subfolders there is a file named Broker.master
Just delete that file named Broker.master of your data base.
Start AmiBroker again
âSymbolsâ having no name should have been gone (I tested it and it worked here)
What is deletion of Broker.master doing? After restart of AmiBroker it will re-create the database from the existing stock symbol files because the symbol information is available in each of those individual symbol data files (being located in the DB sub folders) also.
So since empty symbols rows without any name have no information and since they do not have any data files they will be removed after upper procedure.
As for the symbol data files of databaseâs 0-9, a-z, â_â subfoldersâŚ
Quote:
A database (or a workspace) is a directory that holds a set of binary files, which are stored in 0-9, a-z, â_â subdirectories. Those binary files hold quotes, symbol information, your studies (trend lines, Fibonacci stuff). Each symbolâs information is stored separately in the file with the name of the ticker symbol located in the subdirectory corresponding to the first character of the symbol, so IBM quotation data/studies are stored in the âIBMâ file located in the âIâ subdirectory (more information on this in the Userâs Guide).
@beppe,
Thank you for the suggestion. I did see the white tickers with no quotes from the quote editor but unable to delete them.
@fxshrat,
I used the category assigment function and saw the tickers. I highlighted them and choosed delete. However I could still not delete them.
I exit AB try to find the broker master in the db direction but could not find it. I actually deleted them before per @beppe suggestion earlier on. The strange thing is that since then I have restart AB several time and AB work normally but broker master is not recreated. This may shed some light on the problem.
Looking forward to your analysis and advises.
Again thanks to both gentleman help so far. It is much appreciated.
To have the broker.master file recreated you have to save at least once your database.
You can do it in different ways: like importing new quotes using AmiQuote or, for instance, use the âSymbol Informationâ window (from the main menu select âSymbolâ then âInformationâ). Change any property of one or more tickers (like the âFull nameâ, and/or the âAliasâ field).
Once done your change, you can save your database and/or watchlists and save the changes (from the main menu select âFileâ then âSave Allâ).
If you do not do it explicitly a âsaveâ prompt may appear when you exit the application (in such a case answer positively).
If you do the above steps, the broker.master should be recreated automatically. Verify its presence.
Reopen the application and use the Symbol/Information window again to verify that also your previous changes were properly saved.
Yes deleting broker.master is quickest solution. This file is just for speeding up loading symbol list so AmIBroker does not need to open thousands of files at start. But other than that it contains redundant information (found in individual symbol files) so it can be safely deleted.
Hi gentleman,
I updated the database, save all, exit AB. reopen AB but still can find broker.master under the said directory.
I am being to suspect maybe something in AB has been damaged?
THANKS "FXSHRAT".
IT SOLVE MY PROBLEM EASILY.
BROKER .MASTER CREAT IT SELF AND EMPTY SYMBOL IS NOT THERE.
THANKS ONCE AGAIN SIR.[quote="fxshrat, post:7, topic:4019, full:true"]
If upper method does not work then actual solution would be the following...
Close AmiBroker first.
Go to your problematic database on your hard drive.
Open the DB folder and in there at the bottom of all subfolders there is a file named Broker.master
Just delete that file named Broker.master of your data base.
Start AmiBroker again
"Symbols" having no name should have been gone (I tested it and it worked here)
What is deletion of Broker.master doing? After restart of AmiBroker it will re-create the database from the existing stock symbol files because the symbol information is available in each of those individual symbol data files (being located in the DB sub folders) also.
So since empty symbols rows without any name have no information and since they do not have any data files they will be removed after upper procedure.
As for the symbol data files of database's 0-9, a-z, â_â subfolders...
Quote:
A database (or a workspace) is a directory that holds a set of binary files, which are stored in 0-9, a-z, â_â subdirectories. Those binary files hold quotes, symbol information, your studies (trend lines, Fibonacci stuff). Each symbolâs information is stored separately in the file with the name of the ticker symbol located in the subdirectory corresponding to the first character of the symbol, so IBM quotation data/studies are stored in the âIBMâ file located in the âIâ subdirectory (more information on this in the Userâs Guide).
[/quote]