enables day by day bt run, bt market premium+inds
This commit is contained in:
@ -2,7 +2,7 @@ from v2realbot.config import DATA_DIR
|
||||
import sqlite3
|
||||
import queue
|
||||
import threading
|
||||
from datetime import time
|
||||
import time
|
||||
|
||||
sqlite_db_file = DATA_DIR + "/v2trading.db"
|
||||
# Define the connection pool
|
||||
@ -44,6 +44,7 @@ def execute_with_retry(cursor: sqlite3.Cursor, statement: str, retry_interval: i
|
||||
return cursor.execute(statement)
|
||||
except sqlite3.OperationalError as e:
|
||||
if str(e) == "database is locked":
|
||||
print("database retry in 1s." + str(e))
|
||||
time.sleep(retry_interval)
|
||||
continue
|
||||
else:
|
||||
|
||||
@ -24,6 +24,15 @@ from alpaca.data.enums import Exchange
|
||||
# return user.id
|
||||
# raise HTTPException(status_code=404, detail=f"Could not find user with id: {id}")
|
||||
|
||||
class RunDay(BaseModel):
|
||||
"""
|
||||
Helper object for batch run - carries list of days in format required by run batch manager
|
||||
"""
|
||||
start: datetime
|
||||
end: datetime
|
||||
name: Optional[str] = None
|
||||
note: Optional[str] = None
|
||||
id: Optional[str] = None
|
||||
|
||||
# Define a Pydantic model for input data
|
||||
class ConfigItem(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user