Вы находитесь на странице: 1из 3

Cleaning up Amibroker Database

I recently messed up my EOD database while trying to setup a real-time data feed for some of the stocks
I track.
Well, I had the EOD database open in one instance (instance 1 EOD) and in another instance of
Amibroker (instance 2 RTCash), I setup a Real-time data feed from Yahoo/Google finance (through
Amiquote). What I initially thought as not working turned out to be a nightmare for few days/weeks for
me because the real-time data read from Yahoo/Google was written to the first instance of Amibroker.
Attached is a screenshot of the Quote Editor in Amibroker. See those minute-by-minute quotes those
are the real-time data and the ones with EOD in the last column in the screenshot denote the EOD
entries for the scrip.


And with that, my EOD database had RT data for a month or so. Naturally, the EOD charts were all over
the place! Since Id set up the RT data only for about 100 odd symbols, cleaning it manually wasnt an
option. Last good backup was a month old and I could have restored it in no time, but I was really keen
on finding a solution for the problem at hand.
Help came through Google where I found the script (attached in the document) that cleans up the data
using Jscript. Very nifty way of doing this, I must say!

Before you run the script, do the following
1. Take a back-up of your corrupt Amibroker database. In case something goes wrong during script
execution, you can restore it using this back-up. You can delete this back-up once the script runs
successfully.
2. A script file that runs in Windows (See attachment section)
3. Administrator privileges on your computer.
4. Run Command Prompt in Administrator mode. Right click on Command Prompt and click on
Run as Administrator option.
5. Check the path settings in the script file is pointing to the folder where you Amibroker database
resides
6. Change the date range for which you want the data to be deleted from your database.

During script execution, please ensure
1. Amibroker is not open in your computer.
2. No other program is accessing the database (WinZip, WinRAR in case you are taking a back-up)
3. Wait patiently for the message Clean-up ended!! Depending on the date range, the clean-
up can take time. I had to run the clean-up for range of 10 days and it took nearly 10-12
minutes!! So, get a coffee/tea while the script is in progress.
Note When the script is in progress, in your Task Manager, youll notice a Broker.exe instance
running. Thats an Amibroker instance used by the script. DO NOT terminate that!
Attachments

DELETEDATADATERANGE.js


Note I downloaded the script through a Google search and I thank that person for posting the script
online Kudos to him/her! However, there were no specific instructions on how to run the script etc.
So, the only credit I take is for the documentation here

Вам также может понравиться