Add order/position management

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-02-14 17:07:30 +00:00
parent 6ec71ee144
commit 648d413ac7
44 changed files with 826 additions and 497 deletions

View File

@@ -13,6 +13,7 @@ CREATE TABLE IF NOT EXISTS qrust.assets (
),
status Boolean,
time_added DateTime DEFAULT now(),
qty Float64
)
ENGINE = ReplacingMergeTree()
PRIMARY KEY symbol;
@@ -34,7 +35,8 @@ PARTITION BY toYYYYMM(time);
CREATE TABLE IF NOT EXISTS qrust.backfills_bars (
symbol LowCardinality(String),
time DateTime
time DateTime,
fresh Boolean
)
ENGINE = ReplacingMergeTree()
PRIMARY KEY symbol;
@@ -60,7 +62,8 @@ PRIMARY KEY id;
CREATE TABLE IF NOT EXISTS qrust.backfills_news (
symbol LowCardinality(String),
time DateTime
time DateTime,
fresh Boolean
)
ENGINE = ReplacingMergeTree()
PRIMARY KEY symbol;
@@ -117,10 +120,3 @@ CREATE TABLE IF NOT EXISTS qrust.orders (
ENGINE = ReplacingMergeTree()
PARTITION BY toYYYYMM(time_submitted)
PRIMARY KEY id;
CREATE TABLE IF NOT EXISTS qrust.positions (
symbol LowCardinality(String),
qty Float64
)
ENGINE = ReplacingMergeTree()
PRIMARY KEY symbol;