7. DataTables — Basics tables

Below are all built-in predefined tables: trading calendar, stock/index/fund/futures/option basics, THS index basics, SW industry classification, etc.

7.1. Trading calendar:

China trading calendar: trade_calendar

Table use: cal, asset type: none, frequency: none

Covers SSE/SZSE and major futures exchanges.

Exchange code reference:

  • SSE SSE — Shanghai Stock Exchange

  • SZSE SZSE — Shenzhen Stock Exchange

  • CFFEX CFFEX — China Financial Futures Exchange

  • SHFE SHFE — Shanghai Futures Exchange

  • CZCE CZCE — Zhengzhou Commodity Exchange

  • DCE DCE — Dalian Commodity Exchange

  • INE INE — Shanghai International Energy Exchange

columns

dtypes

remarks

is_prime_key

0

cal_date

date

Date (format YYYYMMDD)

Y

1

exchange

varchar(9)

Exchange

Y

2

is_open

tinyint

Is trading day

N

3

pretrade_date

date

Previous trading day

N

US trading calendar: us_trade_calendar

Table use: cal, asset type: none, frequency: none

US trading calendar table.

columns

dtypes

remarks

is_prime_key

0

cal_date

date

Date

Y

1

is_open

tinyint

Is trading day

N

2

pretrade_date

date

Previous trading day

N

HK trading calendar: hk_trade_calendar

Table use: cal, asset type: none, frequency: none

HKEX trading calendar table.

columns

dtypes

remarks

is_prime_key

0

cal_date

date

Date

Y

1

is_open

tinyint

Is trading day

N

2

pretrade_date

date

Previous trading day

N

7.2. Stock basics table:

Basics tables cover stocks, indices, funds, futures, options, etc.

Stock basics: stock_basic

Table use: basics, asset type: E, frequency: none

Stock basics with code, name, listing/delisting dates, industry, region.

columns

dtypes

remarks

is_prime_key

0

ts_code

varchar(9)

Security code

Y

1

symbol

varchar(6)

Stock code

N

2

name

varchar(20)

Stock name

N

3

area

varchar(10)

Region

N

4

industry

varchar(10)

Industry

N

5

fullname

varchar(50)

Stock full name

N

6

enname

varchar(120)

English full name

N

7

cnspell

varchar(40)

Pinyin abbreviation

N

8

market

varchar(6)

Market type

N

9

exchange

varchar(6)

Exchange code

N

10

curr_type

varchar(6)

Trading currency

N

11

list_status

varchar(4)

Listing status

N

12

list_date

date

Listing date

N

13

delist_date

date

Delisting date

N

14

is_hs

varchar(2)

Is Stock Connect eligible

N

Stock name changes: stock_names

Table use: events, asset type: E, frequency: none

Stock name change table with code, start/end dates, security name, announcement date, reason.

columns

dtypes

remarks

is_prime_key

0

ts_code

varchar(9)

Security code

Y

1

start_date

date

Start date

Y

2

name

varchar(8)

Security name

N

3

end_date

date

End date

N

4

ann_date

date

Announcement date

N

5

change_reason

text

Reason for change

N

Listed-company basic information: stock_company

Table use: basics, asset type: E, frequency: none

Listed-company basics table with company code/name, legal rep, GM, board secretary, registered capital/date, province/city, introduction, website, email, office address, headcount, main business/products, business scope, etc.

columns

dtypes

remarks

is_prime_key

0

ts_code

varchar(10)

Stock code

Y

1

exchange

varchar(10)

Exchange code

N

2

chairman

varchar(48)

Legal representative

N

3

manager

varchar(48)

General manager

N

4

secretary

varchar(48)

Board secretary

N

5

reg_capital

float

Registered capital

N

6

setup_date

date

Registration date

N

7

province

varchar(20)

Province

N

8

city

varchar(20)

City

N

9

introduction

text

Company introduction

N

10

website

varchar(75)

Company website

N

11

email

text

Email

N

12

office

text

Office address

N

13

employees

int

Number of employees

N

14

main_business

text

Main business and products

N

15

business_scope

text

Business scope

N

Listed-company management: stk_managers

Table use: events, asset type: E, frequency: d

Management table with executive name, gender, education, resume, and tenure.

columns

dtypes

remarks

is_prime_key

0

ts_code

varchar(10)

TS stock code

Y

1

ann_date

date

Announcement date

Y

2

name

varchar(48)

Name

Y

3

gender

varchar(10)

Gender

N

4

lev

varchar(48)

Position category

N

5

title

varchar(48)

Position

N

6

edu

varchar(30)

Education

N

7

national

varchar(30)

Nationality

N

8

birthday

varchar(10)

Birth date (year-month)

N

9

begin_date

varchar(10)

Appointment date

N

10

end_date

varchar(10)

Departure date

N

11

resume

text

Personal resume

N

IPO new issues: new_share

Table use: basics, asset type: E, frequency: d

The IPO new-issue table lists basic information for all new listings: stock code, subscription code, name, online issue date, listing date, total issue size, online issue size, issue price, P/E ratio, individual subscription cap, funds raised, winning rate, etc.

columns

dtypes

remarks

is_prime_key

0

ts_code

varchar(20)

TS stock code

Y

1

sub_code

varchar(20)

Subscription code

N

2

name

varchar(50)

Name

N

3

ipo_date

date

Online issue date

N

4

issue_date

date

Listing date

N

5

amount

float

Total issue size (10,000 shares)

N

6

market_amount

float

Online issue size (10,000 shares)

N

7

price

float

Issue price

N

8

pe

float

P/E ratio

N

9

limit_amount

float

Individual subscription cap (10,000 shares)

N

10

funds

float

Funds raised (100 million yuan)

N

11

ballot

float

Winning rate

N

7.3. Index basics table

Index basics: index_basic

Table use: basics, asset type: IDX, frequency: none

Index basics with code, name, publish/delisting dates.

columns

dtypes

remarks

is_prime_key

0

ts_code

varchar(24)

Security code

Y

1

name

varchar(80)

Short name

N

2

fullname

varchar(80)

Index full name

N

3

market

varchar(8)

Market

N

4

publisher

varchar(30)

Publisher

N

5

index_type

varchar(30)

Index style

N

6

category

varchar(6)

Index category

N

7

base_date

date

Base period

N

8

base_point

float

Basis points

N

9

list_date

date

Publish date

N

10

weight_rule

text

Weighting method

N

11

desc

text

Description

N

12

exp_date

date

End date

N

THS index basics: ths_index_basic

Table use: basics, asset type: THS, frequency: none

THS index basics with code, name, constituent count, exchange, listing date, N concept / S specialty flags, etc.

columns

dtypes

remarks

is_prime_key

0

ts_code

varchar(14)

Code

Y

1

name

text

Name

N

2

count

int

Number of constituents

N

3

exchange

varchar(4)

Exchange

N

4

list_date

date

Listing date

N

5

type

varchar(4)

N concept index S specialty index

N

SW industry classification: sw_industry_basic

Table use: basics, asset type: IDX, frequency: none

SW industry index basics with code, industry name, parent code, level, industry code, index published flag, SW classification.

columns

dtypes

remarks

is_prime_key

0

index_code

varchar(14)

Index code

Y

1

industry_name

varchar(40)

Industry name

N

2

parent_code

varchar(6)

Parent code

N

3

level

varchar(6)

Industry name

N

4

industry_code

varchar(10)

Industry code

N

5

is_pub

varchar(4)

Index published (Y/N)

N

6

src

varchar(8)

Industry classification (SW Shenwan)

N

7.4. Fund basics table

Fund basics: fund_basic

Table use: basics, asset type: FD, frequency: none

Fund basics with code, name, manager, custodian, investment type, dates, fees, duration, par value, min investment, expected return, benchmark, status, style, type, trustee, subscription/redemption dates, on/off exchange flag, etc.

columns

dtypes

remarks

is_prime_key

0

ts_code

varchar(24)

Security code

Y

1

name

varchar(48)

Short name

N

2

management

varchar(20)

Manager

N

3

custodian

varchar(20)

Custodian

N

4

fund_type

varchar(8)

Investment type

N

5

found_date

date

Establishment date

N

6

due_date

date

Maturity date

N

7

list_date

date

Listing time

N

8

issue_date

date

Issue date

N

9

delist_date

date

Delisting date

N

10

issue_amount

float

Issue size (100 million units)

N

11

m_fee

float

Management fee

N

12

c_fee

float

Custody fee

N

13

duration_year

float

Duration

N

14

p_value

float

Par value

N

15

min_amount

float

Minimum investment (10,000 yuan)

N

16

exp_return

float

Expected return

N

17

benchmark

text

Performance benchmark

N

18

status

varchar(2)

Status D delisted I issuing L listed

N

19

invest_type

varchar(10)

Investment style

N

20

type

varchar(10)

Fund type

N

21

trustee

varchar(10)

Trustee

N

22

purc_startdate

date

Daily subscription start date

N

23

redm_startdate

date

Daily redemption start date

N

24

market

varchar(2)

E on-exchange O off-exchange

N

Fund manager: fund_manager

Table use: events, asset type: FD, frequency: none

Fund manager details: name, gender, birth date, resume.

columns

dtypes

remarks

is_prime_key

0

ts_code

varchar(24)

Security code

Y

1

ann_date

date

Announcement date

Y

2

name

varchar(20)

Fund manager name

Y

3

gender

varchar(2)

Gender

N

4

birth_year

varchar(12)

Birth year

N

5

edu

varchar(30)

Education

N

6

nationality

varchar(4)

Nationality

N

7

begin_date

date

Start date of tenure

N

8

end_date

date

Departure date

N

9

resume

text

Resume

N

Fund shares: fund_share

Table use: data, asset type: FD, frequency: none

Fund share table contains

columns

dtypes

remarks

is_prime_key

0

ts_code

varchar(24)

Security code

Y

1

trade_date

date

Change date, format YYYYMMDD

Y

2

fd_share

float

Fund shares (10,000 units)

N

7.5. Futures and option basics

Futures basics: future_basic

Table use: basics, asset type: FT, frequency: none

Futures basics with contract code, trading ID/market, short name, product code, multiplier, units, quote unit, min tick, delivery method, listing/last trading dates, delivery month/last delivery day, trading hours, etc.

columns

dtypes

remarks

is_prime_key

0

ts_code

varchar(24)

Security code

Y

1

symbol

varchar(12)

Trading identifier

N

2

exchange

varchar(8)

Trading market

N

3

name

varchar(40)

Chinese short name

N

4

fut_code

varchar(12)

Contract product code

N

5

multiplier

float

Contract multiplier

N

6

trade_unit

varchar(4)

Trading measurement unit

N

7

per_unit

float

Trading unit (per lot)

N

8

quote_unit

varchar(80)

Quote unit

N

9

quote_unit_desc

varchar(80)

Minimum quote unit description

N

10

d_mode_desc

varchar(20)

Delivery method description

N

11

list_date

date

Listing date

N

12

delist_date

date

Last trading date

N

13

d_month

varchar(6)

Delivery month

N

14

last_ddate

date

Last delivery date

N

15

trade_time_desc

varchar(80)

Trading hours description

N

Option basics: opt_basic

Table use: basics, asset type: OPT, frequency: none

Option basics with security code, market, contract name/unit, standard code, contract/option type, exercise method/price, settlement month, expiry, listing reference price, trading/exercise/delivery dates, quote unit, min tick, etc.

columns

dtypes

remarks

is_prime_key

0

ts_code

varchar(24)

Security code

Y

1

exchange

varchar(6)

Trading market

N

2

name

varchar(50)

Contract name

N

3

per_unit

varchar(10)

Contract unit

N

4

opt_code

varchar(12)

Standard contract code

N

5

opt_type

varchar(6)

Contract type

N

6

call_put

varchar(6)

Option type

N

7

exercise_type

varchar(6)

Exercise method

N

8

exercise_price

float

Strike price

N

9

s_month

varchar(8)

Settlement month

N

10

maturity_date

date

Maturity date

N

11

list_price

float

Listing reference price

N

12

list_date

date

Trading start date

N

13

delist_date

date

Last trading date

N

14

last_edate

date

Last exercise date

N

15

last_ddate

date

Last delivery date

N

16

quote_unit

varchar(12)

Quote unit

N

17

min_price_chg

varchar(6)

Minimum price tick

N

7.6. US and HK stock basics

US stock basics: us_stock_basic

Table use: not_implemented, asset type: US, frequency: none

US stock name, listing date, etc.

columns

dtypes

remarks

is_prime_key

0

ts_code

varchar(20)

US stock code

Y

1

name

varchar(40)

Chinese name

N

2

enname

varchar(80)

English name

N

3

classify

varchar(6)

Classification: ADR/GDR/EQT

N

4

list_date

datetime

Listing date

N

5

delist_date

datetime

Delisting date

N

HK stock basics: hk_stock_basic

Table use: not_implemented, asset type: HK, frequency: none

HK stock code, name, company name, etc.

columns

dtypes

remarks

is_prime_key

0

ts_code

varchar(20)

Stock code

Y

1

name

varchar(40)

Stock short name

N

2

fullname

text

Company full name

N

3

enname

varchar(80)

English name

N

4

cn_spell

varchar(20)

Pinyin

N

5

market

varchar(6)

Market category

N

6

list_status

varchar(6)

Listing status

N

7

list_date

datetime

Listing date

N

8

delist_date

datetime

Delisting date

N

9

trade_unit

float

Trading unit

N

10

isin

varchar(16)

ISIN code

N

11

curr_type

varchar(6)

Currency code

N