ASCII importer: added ability to import tick data from text files
ASCII importer now allows tick data files to be imported.
Tick data files consist of several records having the same timestamp.This
makes it impossible to use normal import mode which assumes different
(unique) timestampsfor each data row (when same timestamp is found then new
data overwrites old).
To turn on TICK mode you need to add manually
$TICKMODE
1
line to ASCII importer definition file.
$TICKMODE is a special mode of importer that allows to import quotes
that haveduplicate time stamps.
It makes two assumptions:
a)
input data should come in the ascending time order (i.e. OLDER records
first, LATEST records last)
b) input data should consist of entire tick
history because importer will DELETE any existing quotes (to avoid creating
multiple copies of the same ticks).
Once again: Turning on
$TICKMODE 1
will DELETE ANY QUOTES that
already exist in the database and then will import all ticks from input data
file.
You have been warned.
For example data files like this:
MOL,0,20050606,162959,16400.0000,16400.0000,16400.0000,16400.0000,2MOL,0,20050606,162959,16400.0000,16400.0000,16400.0000,16400.0000,11MOL,0,20050606,162959,16400.0000,16400.0000,16400.0000,16400.0000,40
Can be imported using the following definition file:
$FORMAT Ticker, Skip, Date_YMD, Time, Open, High, Low, Close,
Volume
$SKIPLINES 1
$SEPARATOR ,
$CONT 1
$GROUP 255
$AUTOADD
1
$DEBUG 1
$TICKMODE 1
Sometimes it happens that input files have invalid timestamps
(seconds > 59).
For
example:
MOL,0,20050606,162970,16400.0000,16400.0000,16400.0000,16400.0000,2
Please
take a closer look at first line shown in this example it has time:16:29:70
(you see 70 seconds !)
So I had to add a special flag to the importer that works around such
data errors.
It is called $ALLOW99SECONDS 1 and will convert all
records with invalid seconds (i.e greater than 59)to 59s.
So record
stamped 16:29:70 will be treated as 16:29:59
Now for tick mode to work with such incorrect records you would need to
add two lines to ASCII importer definition:
$TICKMODE 1
$ALLOW99SECONDS 1