fix: prepare eqt simdata script

This commit is contained in:
Oleg Sheynin 2024-12-06 20:08:53 -05:00
parent 1cfac2b32d
commit 674e0f6cc6
3 changed files with 7 additions and 7 deletions

View File

@ -1 +1 @@
1.9.2.F1,fix: prepare eqt simdata script 1.9.2.F2,fix: prepare eqt simdata script

View File

@ -152,7 +152,7 @@ sqlite3 ${ResultDbFile} <<EOF
ATTACH '${SourceDbFile}' AS source_db; ATTACH '${SourceDbFile}' AS source_db;
BEGIN; BEGIN;
INSERT OR IGNORE INTO md_trades SELECT INSERT OR IGNORE INTO md_trades SELECT
datetime(exchange_ts_ns / 1000000000, 'unixepoch') || '.' || printf('%06d', (exchange_ts_ns % 1000000000) / 1000) as tstmp, datetime(exchange_ts_ns / 1000000000, 'unixepoch') || '.' || printf('%06d', (exchange_ts_ns % 1000000000) / 1000) as tstamp,
time as tstamp_ns, time as tstamp_ns,
exchange_id, exchange_id,
instrument_id, instrument_id,
@ -168,7 +168,7 @@ COMMIT;
BEGIN; BEGIN;
INSERT OR IGNORE INTO md_trades INSERT OR IGNORE INTO md_trades
SELECT SELECT
datetime(exchange_ts_ns / 1000000000, 'unixepoch') || '.' || printf('%06d', (exchange_ts_ns % 1000000000) / 1000) as tstmp, datetime(exchange_ts_ns / 1000000000, 'unixepoch') || '.' || printf('%06d', (exchange_ts_ns % 1000000000) / 1000) as tstamp,
time as tstamp_ns, time as tstamp_ns,
exchange_id, exchange_id,
instrument_id, instrument_id,
@ -189,7 +189,7 @@ sqlite3 ${ResultDbFile} <<EOF
ATTACH '${SourceDbFile}' AS source_db; ATTACH '${SourceDbFile}' AS source_db;
BEGIN; BEGIN;
INSERT OR IGNORE INTO md_quotes SELECT INSERT OR IGNORE INTO md_quotes SELECT
datetime(exchange_ts_ns / 1000000000, 'unixepoch') || '.' || printf('%06d', (exchange_ts_ns % 1000000000) / 1000) as tstmp, datetime(exchange_ts_ns / 1000000000, 'unixepoch') || '.' || printf('%06d', (exchange_ts_ns % 1000000000) / 1000) as tstamp,
time as tstamp_ns, time as tstamp_ns,
exchange_id, exchange_id,
instrument_id, instrument_id,

View File

@ -168,7 +168,7 @@ for sym in ${Symbols[@]}; do
sqlite3 ${ResultDbFile} <<EOF sqlite3 ${ResultDbFile} <<EOF
ATTACH '${src_qat_db}' AS source_db; ATTACH '${src_qat_db}' AS source_db;
BEGIN; BEGIN;
INSERT INTO md_trades SELECT INSERT OR IGNORE INTO md_trades SELECT
tstamp, tstamp,
tstamp_ns, tstamp_ns,
exchange_id, exchange_id,
@ -183,7 +183,7 @@ FROM source_db.md_trades;
COMMIT; COMMIT;
BEGIN; BEGIN;
INSERT INTO md_quotes SELECT INSERT OR IGNORE INTO md_quotes SELECT
tstamp, tstamp,
tstamp_ns, tstamp_ns,
exchange_id, exchange_id,
@ -202,7 +202,7 @@ EOF
sqlite3 ${ResultDbFile} <<EOF sqlite3 ${ResultDbFile} <<EOF
ATTACH '${src_hbar_db}' AS source_db; ATTACH '${src_hbar_db}' AS source_db;
BEGIN; BEGIN;
INSERT INTO md_1min_bars SELECT INSERT OR IGNORE INTO md_1min_bars SELECT
tstamp, tstamp,
tstamp_ns, tstamp_ns,
exchange_id, exchange_id,