bug fixes
This commit is contained in:
@@ -139,9 +139,30 @@ async def create_fr_aster_user_account_pos(
|
||||
else:
|
||||
raise ValueError('Only MySQL engine is implemented')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
### Mkt Trades Table ####
|
||||
async def create_fr_aster_mkt_trades(
|
||||
CON: AsyncContextManager,
|
||||
engine: str = 'mysql', # mysql | duckdb
|
||||
) -> None:
|
||||
if CON is None:
|
||||
logging.info("NO DB CONNECTION, SKIPPING Create Statements")
|
||||
else:
|
||||
if engine == 'mysql':
|
||||
logging.info('Creating Table if Does Not Exist: fr_aster_mkt_trades')
|
||||
await CON.execute(text("""
|
||||
CREATE TABLE IF NOT EXISTS fr_aster_mkt_trades (
|
||||
timestamp_arrival BIGINT,
|
||||
timestamp_msg BIGINT,
|
||||
timestamp_trade BIGINT,
|
||||
symbol VARCHAR(20),
|
||||
aggregate_trade_id VARCHAR(100),
|
||||
price DOUBLE,
|
||||
qty DOUBLE,
|
||||
first_trade_id VARCHAR(100),
|
||||
last_trade_id VARCHAR(100),
|
||||
is_buyer_mkt_maker BOOL
|
||||
);
|
||||
"""))
|
||||
await CON.commit()
|
||||
else:
|
||||
raise ValueError('Only MySQL engine is implemented')
|
||||
|
||||
@@ -150,3 +150,32 @@ async def create_fr_extended_user_position(
|
||||
else:
|
||||
raise ValueError('Only MySQL engine is implemented')
|
||||
|
||||
### Market Trades Table ####
|
||||
async def create_fr_extended_mkt_trades(
|
||||
CON: AsyncContextManager,
|
||||
engine: str = 'mysql', # mysql | duckdb
|
||||
) -> None:
|
||||
if CON is None:
|
||||
logging.info("NO DB CONNECTION, SKIPPING Create Statements")
|
||||
else:
|
||||
if engine == 'mysql':
|
||||
logging.info('Creating Table if Does Not Exist: fr_extended_mkt_trades')
|
||||
await CON.execute(text("""
|
||||
CREATE TABLE IF NOT EXISTS fr_extended_mkt_trades (
|
||||
sequence_id INT,
|
||||
timestamp_arrival BIGINT,
|
||||
timestamp_msg BIGINT,
|
||||
timestamp_trade BIGINT,
|
||||
symbol VARCHAR(20),
|
||||
side_taker VARCHAR(20),
|
||||
trade_type VARCHAR(20),
|
||||
price DOUBLE,
|
||||
qty DOUBLE,
|
||||
trade_id VARCHAR(100),
|
||||
is_buyer_mkt_maker BOOL
|
||||
);
|
||||
"""))
|
||||
await CON.commit()
|
||||
else:
|
||||
raise ValueError('Only MySQL engine is implemented')
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ class Algo_Config:
|
||||
Price_Worsener_Extend: float
|
||||
Target_Open_Cash_Position: int
|
||||
|
||||
Log_Summary_Each_Loop: bool = False
|
||||
Print_Summary_Each_Loop: bool = False
|
||||
Flip_Side_For_Testing: bool = False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user