enables day by day bt run, bt market premium+inds

This commit is contained in:
David Brazda
2023-10-15 20:14:44 +02:00
parent 793c776d45
commit 7c1bba028b
25 changed files with 500 additions and 83 deletions

View File

@ -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:

View File

@ -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):