程序员的量化交易之路(14)--Cointrader数据表(2)

Cointrader表结构

转载须注明出处:http://blog.csdn.net/minimicall?viewmode=contentshttp://cloudtrader.top

设置(setup)

Install Java

Install Maven

Install MySql

Create a database using

mysql -u root -e `create database cointrader;`

This is mysql root not system root

git clone https://github.com/timolson/cointrader.git

cd cointrader

Build with Maven

mvn

Optional: Create a file cointrader.properties in the current directory. You may configure additional settings here, like a database username and password. See cointrader-default.properties.

Initialize the database with:

./cointrader.sh reset-database

You‘re done! Now you might want to:

Start a process to save market data in the db:

./cointrader.sh save-data &

Run the Console

./cointrader.sh console

登入数据库:

$ mysql -u root -p

查看database:

mysql> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| cointrader         |

| db_test            |

| mysql              |

| openfire           |

| performance_schema |

| xoops              |

+--------------------+

7 rows in set (0.00 sec)

切入cointrader:

mysql> use cointrader;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Database changed

查看表格:

mysql> show tables;

+--------------------------+

| Tables_in_cointrader     |

+--------------------------+

| adjustment               |

| adjustment_deltas        |

| authorization            |

| book                     |

| currency                 |

| exchange                 |

| fill                     |

| fill_children            |

| general_order            |

| listing                  |

| market                   |

| market_data_gap_error    |

| offer                    |

| order_children           |

| order_update             |

| owner                    |

| owner_stakes             |

| portfolio                |

| portfolio_manager        |

| portfolio_stakes         |

| position                 |

| position_fills           |

| position_update          |

| prompt                   |

| specific_order           |

| stake                    |

| strategy_instance        |

| strategy_instance_config |

| tick                     |

| trade                    |

| transaction              |

+--------------------------+

31 rows in set (0.01 sec)

查看每一个表的表结构

mysql> desc adjustment;

+---------------+------------+------+-----+---------+-------+

| Field         | Type       | Null | Key | Default | Extra |

+---------------+------------+------+-----+---------+-------+

| id            | binary(16) | NO   | PRI | NULL    |       |

| version       | bigint(20) | YES  |     | NULL    |       |

| time_applied  | tinyblob   | YES  |     | NULL    |       |

| authorization | binary(16) | NO   | UNI | NULL    |       |

+---------------+------------+------+-----+---------+-------+

mysql> desc adjustment_deltas;

+------------+------------+------+-----+---------+-------+

| Field      | Type       | Null | Key | Default | Extra |

+------------+------------+------+-----+---------+-------+

| adjustment | binary(16) | NO   | MUL | NULL    |       |

| deltas     | binary(16) | NO   | PRI | NULL    |       |

+------------+------------+------+-----+---------+-------+

2 rows in set (0.00 sec)

mysql> desc  authorization    ;

+---------+--------------+------+-----+---------+-------+

| Field   | Type         | Null | Key | Default | Extra |

+---------+--------------+------+-----+---------+-------+

| id      | binary(16)   | NO   | PRI | NULL    |       |

| version | bigint(20)   | YES  |     | NULL    |       |

| notes   | varchar(255) | YES  |     | NULL    |       |

+---------+--------------+------+-----+---------+-------+

3 rows in set (0.00 sec)

mysql> desc  authorization  ;

+---------+--------------+------+-----+---------+-------+

| Field   | Type         | Null | Key | Default | Extra |

+---------+--------------+------+-----+---------+-------+

| id      | binary(16)   | NO   | PRI | NULL    |       |

| version | bigint(20)   | YES  |     | NULL    |       |

| notes   | varchar(255) | YES  |     | NULL    |       |

+---------+--------------+------+-----+---------+-------+

3 rows in set (0.00 sec)

mysql> desc  book ;

+----------------------+--------------+------+-----+---------+-------+

| Field                | Type         | Null | Key | Default | Extra |

+----------------------+--------------+------+-----+---------+-------+

| id                   | binary(16)   | NO   | PRI | NULL    |       |

| version              | bigint(20)   | YES  |     | NULL    |       |

| time                 | bigint(20)   | NO   | MUL | NULL    |       |

| remote_key           | varchar(255) | YES  |     | NULL    |       |

| time_received        | bigint(20)   | NO   | MUL | NULL    |       |

| market               | binary(16)   | NO   | MUL | NULL    |       |

| ask_deletions_blob   | longblob     | YES  |     | NULL    |       |

| ask_insertions_blob  | longblob     | YES  |     | NULL    |       |

| ask_price_as_double  | double       | YES  |     | NULL    |       |

| ask_volume_as_double | double       | YES  |     | NULL    |       |

| bid_deletions_blob   | longblob     | YES  |     | NULL    |       |

| bid_insertions_blob  | longblob     | YES  |     | NULL    |       |

| bid_price_as_double  | double       | YES  |     | NULL    |       |

| bid_volume_as_double | double       | YES  |     | NULL    |       |

| parent               | binary(16)   | YES  | MUL | NULL    |       |

+----------------------+--------------+------+-----+---------+-------+

15 rows in set (0.00 sec)

mysql> desc currency ;

+---------+--------------+------+-----+---------+-------+

| Field   | Type         | Null | Key | Default | Extra |

+---------+--------------+------+-----+---------+-------+

| id      | binary(16)   | NO   | PRI | NULL    |       |

| version | bigint(20)   | YES  |     | NULL    |       |

| basis   | double       | NO   |     | NULL    |       |

| symbol  | varchar(255) | NO   |     | NULL    |       |

| fiat    | bit(1)       | NO   |     | NULL    |       |

+---------+--------------+------+-----+---------+-------+

5 rows in set (0.00 sec)

mysql> desc  exchange    ;

+-------------------+--------------+------+-----+---------+-------+

| Field             | Type         | Null | Key | Default | Extra |

+-------------------+--------------+------+-----+---------+-------+

| id                | binary(16)   | NO   | PRI | NULL    |       |

| version           | bigint(20)   | YES  |     | NULL    |       |

| fee_method        | int(11)      | YES  |     | NULL    |       |

| fee_rate          | double       | NO   |     | NULL    |       |

| margin            | int(11)      | NO   |     | NULL    |       |

| margin_fee_method | int(11)      | YES  |     | NULL    |       |

| margin_fee_rate   | double       | NO   |     | NULL    |       |

| symbol            | varchar(255) | NO   |     | NULL    |       |

+-------------------+--------------+------+-----+---------+-------+

8 rows in set (0.00 sec)

mysql> desc  fill    ;

+--------------------+--------------+------+-----+---------+-------+

| Field              | Type         | Null | Key | Default | Extra |

+--------------------+--------------+------+-----+---------+-------+

| id                 | binary(16)   | NO   | PRI | NULL    |       |

| version            | bigint(20)   | YES  |     | NULL    |       |

| time               | bigint(20)   | NO   |     | NULL    |       |

| remote_key         | varchar(255) | YES  |     | NULL    |       |

| time_received      | bigint(20)   | NO   |     | NULL    |       |

| open_volume_count  | bigint(20)   | NO   |     | NULL    |       |

| price_count        | bigint(20)   | NO   |     | NULL    |       |

| stop_price_count   | bigint(20)   | NO   |     | NULL    |       |

| target_price_count | bigint(20)   | NO   |     | NULL    |       |

| volume_count       | bigint(20)   | NO   |     | NULL    |       |

| market             | binary(16)   | YES  | MUL | NULL    |       |

| order              | binary(16)   | YES  | MUL | NULL    |       |

| portfolio          | binary(16)   | NO   | MUL | NULL    |       |

+--------------------+--------------+------+-----+---------+-------+

13 rows in set (0.01 sec)

mysql> desc fill_children  ;

+----------+------------+------+-----+---------+-------+

| Field    | Type       | Null | Key | Default | Extra |

+----------+------------+------+-----+---------+-------+

| fill     | binary(16) | NO   | MUL | NULL    |       |

| children | binary(16) | NO   | PRI | NULL    |       |

+----------+------------+------+-----+---------+-------+

2 rows in set (0.00 sec)

mysql> desc general_order   ;

+-----------------------------+---------------+------+-----+---------+-------+

| Field                       | Type          | Null | Key | Default | Extra |

+-----------------------------+---------------+------+-----+---------+-------+

| id                          | binary(16)    | NO   | PRI | NULL    |       |

| version                     | bigint(20)    | YES  |     | NULL    |       |

| time                        | bigint(20)    | NO   |     | NULL    |       |

| comment                     | varchar(255)  | YES  |     | NULL    |       |

| emulation                   | bit(1)        | NO   |     | NULL    |       |

| entry_time                  | bigint(20)    | YES  |     | NULL    |       |

| expiration                  | tinyblob      | YES  |     | NULL    |       |

| fill_type                   | int(11)       | YES  | MUL | NULL    |       |

| margin_type                 | int(11)       | YES  |     | NULL    |       |

| panic_force                 | bit(1)        | NO   |     | NULL    |       |

| position_effect             | int(11)       | YES  |     | NULL    |       |

| market                      | binary(16)    | YES  | MUL | NULL    |       |

| parent_order                | binary(16)    | YES  |     | NULL    |       |

| portfolio                   | binary(16)    | NO   | MUL | NULL    |       |

| limit_price_decimal         | decimal(19,2) | YES  |     | NULL    |       |

| stop_amount_decimal         | decimal(19,2) | YES  |     | NULL    |       |

| stop_price_decimal          | decimal(19,2) | YES  |     | NULL    |       |

| target_amount_decimal       | decimal(19,2) | YES  |     | NULL    |       |

| target_price_decimal        | decimal(19,2) | YES  |     | NULL    |       |

| trailing_stop_price_decimal | decimal(19,2) | YES  |     | NULL    |       |

| volume_decimal              | decimal(19,2) | YES  |     | NULL    |       |

| listing                     | binary(16)    | NO   | MUL | NULL    |       |

+-----------------------------+---------------+------+-----+---------+-------+

22 rows in set (0.00 sec)

mysql> desc listing   ;

+---------+------------+------+-----+---------+-------+

| Field   | Type       | Null | Key | Default | Extra |

+---------+------------+------+-----+---------+-------+

| id      | binary(16) | NO   | PRI | NULL    |       |

| version | bigint(20) | YES  |     | NULL    |       |

| base    | binary(16) | NO   | MUL | NULL    |       |

| prompt  | binary(16) | YES  | MUL | NULL    |       |

| quote   | binary(16) | NO   | MUL | NULL    |       |

+---------+------------+------+-----+---------+-------+

5 rows in set (0.00 sec)

mysql> desc market ;

+--------------+------------+------+-----+---------+-------+

| Field        | Type       | Null | Key | Default | Extra |

+--------------+------------+------+-----+---------+-------+

| id           | binary(16) | NO   | PRI | NULL    |       |

| version      | bigint(20) | YES  |     | NULL    |       |

| active       | bit(1)     | NO   | MUL | NULL    |       |

| price_basis  | double     | NO   |     | NULL    |       |

| volume_basis | double     | NO   |     | NULL    |       |

| exchange     | binary(16) | NO   | MUL | NULL    |       |

| listing      | binary(16) | NO   | MUL | NULL    |       |

+--------------+------------+------+-----+---------+-------+

7 rows in set (0.00 sec)

mysql> desc market_data_gap_error;

+--------------------+------------+------+-----+---------+-------+

| Field              | Type       | Null | Key | Default | Extra |

+--------------------+------------+------+-----+---------+-------+

| id                 | binary(16) | NO   | PRI | NULL    |       |

| version            | bigint(20) | YES  |     | NULL    |       |

| time               | bigint(20) | NO   |     | NULL    |       |

| exception          | tinyblob   | YES  |     | NULL    |       |

| gap_interval_start | datetime   | YES  |     | NULL    |       |

| gap_interval_end   | datetime   | YES  |     | NULL    |       |

| market             | binary(16) | YES  | MUL | NULL    |       |

+--------------------+------------+------+-----+---------+-------+

7 rows in set (0.00 sec)

mysql> desc offer  ;

+---------------+--------------+------+-----+---------+-------+

| Field         | Type         | Null | Key | Default | Extra |

+---------------+--------------+------+-----+---------+-------+

| id            | binary(16)   | NO   | PRI | NULL    |       |

| version       | bigint(20)   | YES  |     | NULL    |       |

| time          | bigint(20)   | NO   |     | NULL    |       |

| remote_key    | varchar(255) | YES  |     | NULL    |       |

| time_received | bigint(20)   | NO   |     | NULL    |       |

| market        | binary(16)   | NO   | MUL | NULL    |       |

| price_count   | bigint(20)   | YES  |     | NULL    |       |

| volume_count  | bigint(20)   | YES  |     | NULL    |       |

+---------------+--------------+------+-----+---------+-------+

8 rows in set (0.00 sec)

mysql> desc order_children   ;

+----------+------------+------+-----+---------+-------+

| Field    | Type       | Null | Key | Default | Extra |

+----------+------------+------+-----+---------+-------+

| order    | binary(16) | NO   |     | NULL    |       |

| children | binary(16) | NO   | PRI | NULL    |       |

+----------+------------+------+-----+---------+-------+

2 rows in set (0.00 sec)

mysql> desc order_update ;

+------------+------------+------+-----+---------+----------------+

| Field      | Type       | Null | Key | Default | Extra          |

+------------+------------+------+-----+---------+----------------+

| sequence   | int(11)    | NO   | PRI | NULL    | auto_increment |

| id         | binary(16) | NO   | PRI | NULL    |                |

| version    | bigint(20) | YES  |     | NULL    |                |

| time       | bigint(20) | NO   |     | NULL    |                |

| last_state | int(11)    | YES  |     | NULL    |                |

| state      | int(11)    | YES  | MUL | NULL    |                |

| order      | binary(16) | YES  |     | NULL    |                |

+------------+------------+------+-----+---------+----------------+

7 rows in set (0.00 sec)

mysql> desc owner      ;

+-----------+--------------+------+-----+---------+-------+

| Field     | Type         | Null | Key | Default | Extra |

+-----------+--------------+------+-----+---------+-------+

| id        | binary(16)   | NO   | PRI | NULL    |       |

| version   | bigint(20)   | YES  |     | NULL    |       |

| portfolio | binary(16)   | YES  | MUL | NULL    |       |

| name      | varchar(255) | NO   |     | NULL    |       |

+-----------+--------------+------+-----+---------+-------+

4 rows in set (0.00 sec)

mysql> desc owner_stakes ;

+--------+------------+------+-----+---------+-------+

| Field  | Type       | Null | Key | Default | Extra |

+--------+------------+------+-----+---------+-------+

| owner  | binary(16) | NO   | MUL | NULL    |       |

| stakes | binary(16) | NO   | PRI | NULL    |       |

+--------+------------+------+-----+---------+-------+

2 rows in set (0.00 sec)

mysql> desc portfolio  ;

+------------+--------------+------+-----+---------+-------+

| Field      | Type         | Null | Key | Default | Extra |

+------------+--------------+------+-----+---------+-------+

| id         | binary(16)   | NO   | PRI | NULL    |       |

| version    | bigint(20)   | YES  |     | NULL    |       |

| name       | varchar(255) | YES  |     | NULL    |       |

| base_asset | binary(16)   | YES  |     | NULL    |       |

+------------+--------------+------+-----+---------+-------+

4 rows in set (0.00 sec)

mysql> desc portfolio_manager  ;

+-----------+------------+------+-----+---------+-------+

| Field     | Type       | Null | Key | Default | Extra |

+-----------+------------+------+-----+---------+-------+

| id        | binary(16) | NO   | PRI | NULL    |       |

| version   | bigint(20) | YES  |     | NULL    |       |

| portfolio | binary(16) | YES  | MUL | NULL    |       |

+-----------+------------+------+-----+---------+-------+

3 rows in set (0.00 sec)

mysql> desc portfolio_stakes ;

+-----------+------------+------+-----+---------+-------+

| Field     | Type       | Null | Key | Default | Extra |

+-----------+------------+------+-----+---------+-------+

| portfolio | binary(16) | NO   | MUL | NULL    |       |

| stakes    | binary(16) | NO   | PRI | NULL    |       |

+-----------+------------+------+-----+---------+-------+

2 rows in set (0.00 sec)

mysql> desc position ;

+-----------+------------+------+-----+---------+-------+

| Field     | Type       | Null | Key | Default | Extra |

+-----------+------------+------+-----+---------+-------+

| id        | binary(16) | NO   | PRI | NULL    |       |

| version   | bigint(20) | YES  |     | NULL    |       |

| asset     | binary(16) | YES  |     | NULL    |       |

| exchange  | binary(16) | YES  | MUL | NULL    |       |

| market    | binary(16) | YES  | MUL | NULL    |       |

| portfolio | binary(16) | YES  | MUL | NULL    |       |

+-----------+------------+------+-----+---------+-------+

6 rows in set (0.00 sec)

mysql> desc position_fills  ;

+----------+------------+------+-----+---------+-------+

| Field    | Type       | Null | Key | Default | Extra |

+----------+------------+------+-----+---------+-------+

| position | binary(16) | NO   | MUL | NULL    |       |

| fills    | binary(16) | NO   | PRI | NULL    |       |

+----------+------------+------+-----+---------+-------+

2 rows in set (0.00 sec)

mysql> desc  position_update;

+-----------+------------+------+-----+---------+-------+

| Field     | Type       | Null | Key | Default | Extra |

+-----------+------------+------+-----+---------+-------+

| id        | binary(16) | NO   | PRI | NULL    |       |

| version   | bigint(20) | YES  |     | NULL    |       |

| time      | bigint(20) | NO   |     | NULL    |       |

| last_type | int(11)    | YES  |     | NULL    |       |

| type      | int(11)    | YES  |     | NULL    |       |

| market    | binary(16) | YES  | MUL | NULL    |       |

| position  | binary(16) | YES  | MUL | NULL    |       |

+-----------+------------+------+-----+---------+-------+

7 rows in set (0.00 sec)

mysql> desc   prompt  ;

+-------------------+--------------+------+-----+---------+-------+

| Field             | Type         | Null | Key | Default | Extra |

+-------------------+--------------+------+-----+---------+-------+

| id                | binary(16)   | NO   | PRI | NULL    |       |

| version           | bigint(20)   | YES  |     | NULL    |       |

| contract_size     | double       | NO   |     | NULL    |       |

| fee_method        | int(11)      | YES  |     | NULL    |       |

| fee_rate          | double       | NO   |     | NULL    |       |

| margin            | int(11)      | NO   |     | NULL    |       |

| margin_fee_method | int(11)      | YES  |     | NULL    |       |

| margin_method     | int(11)      | YES  |     | NULL    |       |

| price_basis       | double       | NO   |     | NULL    |       |

| symbol            | varchar(255) | NO   |     | NULL    |       |

| tick_size         | double       | NO   |     | NULL    |       |

| tick_value        | double       | NO   |     | NULL    |       |

| volume_basis      | double       | NO   |     | NULL    |       |

| traded_currency   | binary(16)   | YES  |     | NULL    |       |

+-------------------+--------------+------+-----+---------+-------+

14 rows in set (0.01 sec)

mysql> desc specific_order ;

+-------------------+--------------+------+-----+---------+-------+

| Field             | Type         | Null | Key | Default | Extra |

+-------------------+--------------+------+-----+---------+-------+

| id                | binary(16)   | NO   | PRI | NULL    |       |

| version           | bigint(20)   | YES  |     | NULL    |       |

| time              | bigint(20)   | NO   |     | NULL    |       |

| comment           | varchar(255) | YES  |     | NULL    |       |

| emulation         | bit(1)       | NO   |     | NULL    |       |

| entry_time        | bigint(20)   | YES  |     | NULL    |       |

| expiration        | tinyblob     | YES  |     | NULL    |       |

| fill_type         | int(11)      | YES  | MUL | NULL    |       |

| margin_type       | int(11)      | YES  |     | NULL    |       |

| panic_force       | bit(1)       | NO   |     | NULL    |       |

| position_effect   | int(11)      | YES  |     | NULL    |       |

| market            | binary(16)   | YES  | MUL | NULL    |       |

| parent_order      | binary(16)   | YES  |     | NULL    |       |

| portfolio         | binary(16)   | NO   | MUL | NULL    |       |

| limit_price_count | bigint(20)   | NO   |     | NULL    |       |

| placement_count   | int(11)      | NO   |     | NULL    |       |

| remote_key        | varchar(255) | YES  |     | NULL    |       |

| time_received     | bigint(20)   | YES  |     | NULL    |       |

| volume_count      | bigint(20)   | NO   |     | NULL    |       |

+-------------------+--------------+------+-----+---------+-------+

19 rows in set (0.01 sec)

mysql> desc stake  ;

+-----------+----------------+------+-----+---------+-------+

| Field     | Type           | Null | Key | Default | Extra |

+-----------+----------------+------+-----+---------+-------+

| id        | binary(16)     | NO   | PRI | NULL    |       |

| version   | bigint(20)     | YES  |     | NULL    |       |

| stake     | decimal(30,15) | YES  |     | NULL    |       |

| owner     | binary(16)     | YES  | MUL | NULL    |       |

| portfolio | binary(16)     | NO   | MUL | NULL    |       |

+-----------+----------------+------+-----+---------+-------+

5 rows in set (0.00 sec)

mysql> desc strategy_instance ;

+-------------+--------------+------+-----+---------+-------+

| Field       | Type         | Null | Key | Default | Extra |

+-------------+--------------+------+-----+---------+-------+

| id          | binary(16)   | NO   | PRI | NULL    |       |

| version     | bigint(20)   | YES  |     | NULL    |       |

| portfolio   | binary(16)   | YES  | MUL | NULL    |       |

| module_name | varchar(255) | YES  |     | NULL    |       |

+-------------+--------------+------+-----+---------+-------+

4 rows in set (0.00 sec)

mysql> desc  strategy_instance_config;

+-------------------+--------------+------+-----+---------+-------+

| Field             | Type         | Null | Key | Default | Extra |

+-------------------+--------------+------+-----+---------+-------+

| strategy_instance | binary(16)   | NO   | PRI | NULL    |       |

| config            | varchar(255) | YES  |     | NULL    |       |

| config_key        | varchar(255) | NO   | PRI |         |       |

+-------------------+--------------+------+-----+---------+-------+

3 rows in set (0.00 sec)

mysql> desc  tick  ;

+---------------+--------------+------+-----+---------+-------+

| Field         | Type         | Null | Key | Default | Extra |

+---------------+--------------+------+-----+---------+-------+

| id            | binary(16)   | NO   | PRI | NULL    |       |

| version       | bigint(20)   | YES  |     | NULL    |       |

| time          | bigint(20)   | NO   |     | NULL    |       |

| remote_key    | varchar(255) | YES  |     | NULL    |       |

| time_received | bigint(20)   | NO   |     | NULL    |       |

| market        | binary(16)   | NO   | MUL | NULL    |       |

| price_count   | bigint(20)   | YES  |     | NULL    |       |

| volume_count  | bigint(20)   | YES  |     | NULL    |       |

| start_instant | tinyblob     | YES  |     | NULL    |       |

| last_book     | binary(16)   | YES  | MUL | NULL    |       |

+---------------+--------------+------+-----+---------+-------+

10 rows in set (0.00 sec)

mysql> desc trade    ;

+---------------+--------------+------+-----+---------+-------+

| Field         | Type         | Null | Key | Default | Extra |

+---------------+--------------+------+-----+---------+-------+

| id            | binary(16)   | NO   | PRI | NULL    |       |

| version       | bigint(20)   | YES  |     | NULL    |       |

| time          | bigint(20)   | NO   | MUL | NULL    |       |

| remote_key    | varchar(255) | YES  |     | NULL    |       |

| time_received | bigint(20)   | NO   | MUL | NULL    |       |

| market        | binary(16)   | NO   | MUL | NULL    |       |

| price_count   | bigint(20)   | YES  |     | NULL    |       |

| volume_count  | bigint(20)   | YES  |     | NULL    |       |

+---------------+--------------+------+-----+---------+-------+

8 rows in set (0.00 sec)

mysql> desc  transaction  ;

+---------------------+------------+------+-----+---------+-------+

| Field               | Type       | Null | Key | Default | Extra |

+---------------------+------------+------+-----+---------+-------+

| id                  | binary(16) | NO   | PRI | NULL    |       |

| version             | bigint(20) | YES  |     | NULL    |       |

| time                | bigint(20) | NO   |     | NULL    |       |

| amount_count        | bigint(20) | YES  |     | NULL    |       |

| commission_count    | bigint(20) | YES  |     | NULL    |       |

| position_effect     | int(11)    | YES  |     | NULL    |       |

| price_count         | bigint(20) | YES  |     | NULL    |       |

| type                | int(11)    | YES  | MUL | NULL    |       |

| asset               | binary(16) | YES  |     | NULL    |       |

| commission_currency | binary(16) | YES  |     | NULL    |       |

| currency            | binary(16) | NO   |     | NULL    |       |

| exchange            | binary(16) | YES  | MUL | NULL    |       |

| fill                | binary(16) | YES  | MUL | NULL    |       |

| market              | binary(16) | YES  | MUL | NULL    |       |

| order               | binary(16) | YES  |     | NULL    |       |

| portfolio           | binary(16) | NO   | MUL | NULL    |       |

+---------------------+------------+------+-----+---------+-------+

16 rows in set (0.00 sec)

时间: 2024-08-30 12:20:05

程序员的量化交易之路(14)--Cointrader数据表(2)的相关文章

程序员的量化交易之路(1)----规划开篇

其实,一直对量化交易有一定的理解和情节.早在中大读研究生的时候实验室师兄,已经去了中国平安核心投资团队,做高频交易研究的国源师兄的影响,就开始对金融世界产生了浓厚的兴趣.看了丁磊编著的<量化投资--策略与技术>和艾琳.奥尔德里奇的<高频交易>,反复的看,但是都入不了味,现在回过头来想,一个连股都不炒的人怎么可能入味呢.对一些金融的基本概念都不懂. 2013年7月出社会工作后,在10月份确立目标.需要炒股,而且需要一个深入的理解金融的世界.所以确定去考一个证券从业考试,选了证券基础和

程序员的量化交易之路(24)--Cointrader之RemoteEvent远程事件实体(11)

转载需注明出处:http://blog.csdn.net/minimicall,http://cloudtrader.top/ 在量化交易系统中,有些事件是远端传来的,比如股票的价格数据等.所以,在这一节我们定义了一个远端事件实体. 它是一个基类,并不单独生成数据表.具体代码如下: package org.cryptocoinpartners.schema; import javax.annotation.Nullable; import javax.persistence.Basic; imp

程序员的量化交易之路(29)--Cointrader之Tick实体(16)

转载需注明出处:http://blog.csdn.net/minimicall,http://cloudtrade.top Tick:什么是Tick,在交易平台中非常常见,其实就 单笔交易时某只证券的基本数据. 我们通过代码来学习吧: package org.cryptocoinpartners.schema; import javax.annotation.Nullable; import javax.persistence.Entity; import javax.persistence.M

程序员的量化交易之路(27)--Cointrader之PriceData价格数据(14)

转载须注明出处:http://blog.csdn.net/minimicall?viewmode=contents,http://cloudtrade.top/ PriceData:价格数据.价格数据是市场数据的子类. 具体代码如下: package org.cryptocoinpartners.schema; import java.math.BigDecimal; import javax.annotation.Nullable; import javax.persistence.Mappe

程序员的量化交易之路(2)----Esper文档学习之技术概览(1)

转载请注明出处:http://blog.csdn.net/minimicall/ 在接下来的20个工作日中,我将坚持翻译或者略翻译Esper的官方文档. 为什么需要学习Esper,因为我们需要理解复合事件处理 Complex Event Processing (CEP).在量化交易系统中,CEP是必不可少的.它负责处理海量的实时事件. 关于CEP更多知识,大家可以翻阅网络相关资料.我这里集中在学习开源的CEP系统,Esper.. 今天开始第一篇:技术概览. 1. CEP和事件序列分析 Esper

程序员的量化交易之路(13)--Cointrader类图(1)

转载须注明出处:http://blog.csdn.net/minimicall?viewmode=contents, htpp://cloudtrader.top 今天开始正式切入到Cointrader的源码分析学习中,其主页为:https://github.com/timolson/cointrader. 它是基于Esper的一个比特币云交易托管平台.和我想做的事情比较相近.而且虽然现在没什么功能,但代码量相对少,对于学习非常好. 下面是它的一个类图.: 后面我们会根据这个类图一步步的剖析整个

程序员的量化交易之路(19)--Cointrader之Bar实体(7)

转载需注明出处:http://blog.csdn.net/minimicall,http://cloudtrader.top 1. 代码 package org.cryptocoinpartners.schema; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; public class Bar extends Event { private long times

程序员的量化交易之路(20)--Cointrader之Assert实体(8)

转载需说明出处:http://blog.csdn.net/minimicall, http://cloudtrade.top 任何可交易的都可以称之为Assert,资产.其类代码如下: package org.cryptocoinpartners.schema; import javax.persistence.Basic; import javax.persistence.Cacheable; import javax.persistence.Entity; import javax.pers

程序员的量化交易之路(38)--Lean之实时事件处理接口IRealTimeHandler和RealTimeEvent6

转载需注明出处:http://blog.csdn.net/minimicall?viewmode=contents,http://cloudtrade.top/ 这节开始我们要开始说明另外一个模块:实时事件处理模块. 这个模块的工作是什么呢.它就是用来设置一些在特定时间需要执行的任务.比如,每天开盘的时候,你可以做一个什么动作,比如每天收盘的时候你也可以做一个动作.当然还有更为广泛的运用. 在Lean中,是开启一个单独的线程来处理这种定时任务的. 实时事件:RealTimeEvent 实时事件处