Tutorial: How to use AmiBroker with external
data source (MedvedTrader/Quote Tracker)
IMPORTANT INFORMATION:
QuoteTracker authors sold their rights to Ameritrade, but came
up with funcional clone, called Medved
Trader. It continues
to offer the API that is compatible with old "QuoteTracker" plugin.
UPDATE: if you are running QuoteTracker
3.2.2G or higher you have to download QT plugin 1.3.6 (below)
NOTE: The latest version (1.3.6, released October 15,
2005)
of QuoteTracker plugin is available at: http://www.amibroker.com/bin/QT.dll
(you have to copy to Plugins subfolder)
IMPORTANT: You need QuoteTracker 2.4.9C OR ABOVE (3.0.0 or higher
recommended)
VERY IMPORTANT: QuoteTracker has to be CONFIGURED so
its internal server is running. Click here
for the explanation.
CAVEAT: QuoteTracker plugin provides only subset
of features available by true real-time feed as eSignal, IQFeed,
myTrack, Quote.com that offer very reliable, long back-fills
and true tick-by-tick updates.
|
|
QuoteTracker plugin currently works in TWO modes:
- daily mode - plugin adds and updates the last
(todays) bar with the most recent quotes in nearly real time- it means
that you have to use it in conjunction with already existing end-of-day
database.
- intraday mode - plugin provides one day intraday historical
data - more days can be accumulated if AmiBroker with QT is launched
everyday so AmiBroker can save histories to its local database.
One-time setup
Make sure that your QuoteTracker has enabled QT HTTP server:
Options->Edit Preferences : Misc tab: HTTP Server Settings
To use an external data source with AmiBroker you will need to perform
a one-time setup described below:
- Run AmiBroker
- Choose File->New database
- Type a new folder name (for example: C:\Program Files\AmiBroker\NewData
) and click Create as shown in the picture below:
- Choose appropriate entry from Data source combo:
- Quote Tracker users select
"Quote Tracker plug-in" as a Data Source and
"Enable" from Local data storage
- Click on Configure button to show plugin configuration dialog
as shown below
You may also click on Retrieve button to pre-fill AmiBroker
database with symbols already present in QuoteTracker. From now on your
AmiBroker reads quotes from Quote Tracker in nearly real time.
Showing real time quote window
AmiBroker RT features real-time watch
window that allows you to watch streaming quotes. To show this
window choose View->Realtime Quote menu. (see image
to the right ---->)
To add symbols to Realtime quote window you either double click
on the symbol tree or use right mouse button menu Add to Realtime
quote option as shown in the picture above.
|
|
Working with real time quote window
The RT quote window provides real-time streaming quotes and some basic
fundamental data. It is fairly easy to operate as shown in the picture
below (due to the way how Quote Tracker works each time QT plugin reads
data from QT it will mark them as changed (yellow)):
Working with intraday and daily charts
Please note that QuoteTracker in most cases does not automatically
back-fill all symbols, so if you have added some symbols or you are
missing intraday histories you should use Portfolio->Backfill
all stocks menu in QuoteTracker program.
If you want to have long daily histories AND intraday charts you should
consider running TWO instances of AmiBroker. One for EOD charts and
second for intraday charting. Both instances may use QuoteTracker as
a data source.
Description of QuoteTracker plugin configuration options
QT plugin configuration dialog looks as follows:
Here is a description of the settings:
- QuoteTracker server port: defines the port on which QT HTTP
internal server is visible. 16239 is the default value used by QuoteTracer
and you should not change this in most cases. If in doubt please check
QuoteTracker HTTP server settings: Options->Edit Preferences
: Misc tab: HTTP Server Settings menu of QT.
- Refresh inteval - defines how often AmiBroker will ask QT
for quotes. 5 second is default. You may consider changing it to 10
or 15 seconds in case you have lots of symbols and slow machine
- Auto-add symbols from AmiBroker - if this option is turned
ON (by default it is) if you switch in AmiBroker to the symbol that
is not present in any of QT portfolios - it will be automatically
added to default QT portfolio. It also applies to any other kind of
access (for example if you try to import symbols to AmiBroker and
they do not exist in QT - they will be added if this option is turned
on). Switching it OFF disables auto-add feature.
- Max. number of added symbols - defines the maximum number
of symbols that get added using auto-add feature descibed above. This
protects QuoteTracker from becoming overloaded (AmiBroker can handle
tens of thousands symbols with ease but QuoteTracker can NOT)
- Use optimized routine for intraday data retrieval - turning
this on (default, recommended) significantly speeds-up data retrieval
in intraday modes. If this option is enabled and AmiBroker already
has partial intraday data for today AmiBroker asks QT just for a few
last time and sales records that occurred since last update upto current
time, if this option is disabled AmiBroker always asks QT for time&sales
records from entire day.
- Time difference relative to US Eastern time - the
time difference (in hours) between your local time and US Eastern
time (EST). This field is needed because QuoteTracker's server reports
all times in EST time zone. This means that if you live in Australia
QuoteTracker will report ASX quotes with EST time zone and they will
be 15 hours off from your local time. While AmiBroker has the setting
for shifting intraday charts and this is not a problem when running
Intraday mode, it becomes a problem when using daily (EOD) mode because
quotes reported by QuoteTracker are one day off then. This setting
solves this as AmiBroker adds the number of hours entered here to
the time reported by QuoteTracker to get the valid date of quote in
daily mode. This field is filled in with the difference calculated
using your Windows Time settings.
- Retrieve symbols from QuoteTracker - pressing "Retrieve"
button adds all symbols present in QuoteTracker to AmiBroker symbol
list.
|