mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
exchange:
backtest: add ftx kline table
This commit is contained in:
parent
b71d0f5b6e
commit
5fb50fa2cb
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -32,3 +32,5 @@
|
|||
/config/bbgo.yaml
|
||||
|
||||
/pkg/server/assets.go
|
||||
|
||||
bbgo.sqlite3
|
||||
|
|
33
migrations/mysql/20211211020303_add_ftx_kline.sql
Normal file
33
migrations/mysql/20211211020303_add_ftx_kline.sql
Normal file
|
@ -0,0 +1,33 @@
|
|||
-- +up
|
||||
-- +begin
|
||||
create table if not exists ftx_klines
|
||||
(
|
||||
gid bigint unsigned auto_increment
|
||||
primary key,
|
||||
exchange varchar(10) not null,
|
||||
start_time datetime(3) not null,
|
||||
end_time datetime(3) not null,
|
||||
`interval` varchar(3) not null,
|
||||
symbol varchar(12) not null,
|
||||
open decimal(16,8) unsigned not null,
|
||||
high decimal(16,8) unsigned not null,
|
||||
low decimal(16,8) unsigned not null,
|
||||
close decimal(16,8) unsigned default 0.00000000 not null,
|
||||
volume decimal(20,8) unsigned default 0.00000000 not null,
|
||||
closed tinyint(1) default 1 not null,
|
||||
last_trade_id int unsigned default '0' not null,
|
||||
num_trades int unsigned default '0' not null,
|
||||
quote_volume decimal(32,4) default 0.0000 not null,
|
||||
taker_buy_base_volume decimal(32,8) not null,
|
||||
taker_buy_quote_volume decimal(32,4) default 0.0000 not null
|
||||
);
|
||||
-- +end
|
||||
-- +begin
|
||||
create index klines_end_time_symbol_interval
|
||||
on ftx_klines (end_time, symbol, `interval`);
|
||||
-- +end
|
||||
-- +down
|
||||
|
||||
-- +begin
|
||||
drop table ftx_klines;
|
||||
-- +end
|
30
migrations/sqlite3/20211211020303_add_ftx_kline.sql
Normal file
30
migrations/sqlite3/20211211020303_add_ftx_kline.sql
Normal file
|
@ -0,0 +1,30 @@
|
|||
-- +up
|
||||
-- +begin
|
||||
|
||||
CREATE TABLE `ftx_klines`
|
||||
(
|
||||
`gid` INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
`exchange` VARCHAR(10) NOT NULL,
|
||||
`start_time` DATETIME(3) NOT NULL,
|
||||
`end_time` DATETIME(3) NOT NULL,
|
||||
`interval` VARCHAR(3) NOT NULL,
|
||||
`symbol` VARCHAR(7) NOT NULL,
|
||||
`open` DECIMAL(16, 8) NOT NULL,
|
||||
`high` DECIMAL(16, 8) NOT NULL,
|
||||
`low` DECIMAL(16, 8) NOT NULL,
|
||||
`close` DECIMAL(16, 8) NOT NULL DEFAULT 0.0,
|
||||
`volume` DECIMAL(16, 8) NOT NULL DEFAULT 0.0,
|
||||
`closed` BOOLEAN NOT NULL DEFAULT TRUE,
|
||||
`last_trade_id` INT NOT NULL DEFAULT 0,
|
||||
`num_trades` INT NOT NULL DEFAULT 0,
|
||||
`quote_volume` DECIMAL NOT NULL DEFAULT 0.0,
|
||||
`taker_buy_base_volume` DECIMAL NOT NULL DEFAULT 0.0,
|
||||
`taker_buy_quote_volume` DECIMAL NOT NULL DEFAULT 0.0
|
||||
);
|
||||
-- +end
|
||||
|
||||
-- +down
|
||||
|
||||
-- +begin
|
||||
drop table ftx_klines;
|
||||
-- +end
|
Loading…
Reference in New Issue
Block a user