-
Notifications
You must be signed in to change notification settings - Fork 80
Expand file tree
/
Copy pathminute_day_level.dos
More file actions
25 lines (20 loc) · 1.13 KB
/
Copy pathminute_day_level.dos
File metadata and controls
25 lines (20 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//分钟线数据建库建表
// 创建库表,如若已存在,则会drop已有的库重新建库建表。此处创建一个按月VALUE分区,按股票HASH的组合分区数据库
login("admin","123456")
if(existsDatabase("dfs://k_minute_level")){
dropDatabase("dfs://k_minute_level")
}
dbDate = database("", VALUE,2020.01M..2020.12M )
dbSym= database("", HASH, [SYMBOL,3])
db = database("dfs://k_minute_level", COMPO, [dbDate, dbSym])
t =table(1:0, `securityid`tradetime`open`close`high`low`vol`val`vwap, [SYMBOL,TIMESTAMP,DOUBLE,DOUBLE,DOUBLE,DOUBLE,INT,DOUBLE,DOUBLE])
db.createPartitionedTable(t, `k_minute, `tradetime`securityid)
//日线数据建库建表
//创建库表,如若已存在,则会drop已有的库重新建库建表。此处创建一个按年RANGE分区的数据库
login("admin","123456")
if(existsDatabase("dfs://k_day_level")){
dropDatabase("dfs://k_day_level")
}
db = database("dfs://k_day_level", RANGE, 2000.01M + (0..30)*12 )
t =table(1:0, `securityid`tradetime`open`close`high`low`vol`val`vwap, [SYMBOL,TIMESTAMP,DOUBLE,DOUBLE,DOUBLE,DOUBLE,INT,DOUBLE,DOUBLE])
db.createPartitionedTable(t, `k_day, `tradetime)