![]() |
Trading System API
3.0
Library for Simulating and Deploying Trading and Investment Strategies
|
A data_def object describes the structure of a table. More...
A data_def object describes the structure of a table.
Each table field is defined by its:
One of the idiosyncracies of the series_base database is that all tables exclusively store timeseries data. This mean that all records in all tables must have a timestamp. As a result of this requirement, a 'timestamp' field was implicitly added to all tables and, as a result, user must no longer add a date_time field meant as record timestamp. It is still possible to add date and date_time fields, but these won't be interpreted as the record timestamp.
There are two ways of defining a data_def structure. The first is via a string that describes the table fields (data-definition-string), and the second involves repeatedly calling the add_field() member with the corresponding field information.
A data-definition-string is a comma separated list of unique field names, each followed by a colon and a single letter representing the datatype. Character string fields must be followed by a second colon followed by the maximum allowed string length. Space characters before and after commas are ignored. Field names must not contain space characters.
Legal 'type characters' are:
The following is an example data-definition-string that declares fields of all available types:
Programmatically populating a data_def object with field information involves repeatedly calling its add_field() member with the field's value-type and name arguments. Note that for string fields the maximum number of allowed characters must also be given.