db_path
๐ฆ AthenaAI is an AI-powered ensemble machine-learning trading bot for PocketOption, built on BinaryOptionsToolsV2 โ Get it on GitLab
๐ฌ Need help? Join the Chipa Discord ยท โก Go no-code with ChipaEditor
Filesystem path of the SQLite database where every trade and periodic performance snapshot is recorded. The journal is also replayed at startup to retrain the models after a restart.
This field has no environment variable โ to change it, edit the default in src/config.py or construct BotConfig yourself.
| Type | str (file path) |
| Default | "trade_journal.db" (relative to the working directory) |
| Field | BotConfig.db_path |
| Consumed in | src/bot.py (AITradingBot.__init__) โ src/trading/journal.py (TradeJournal) |
What it does
At construction the bot opens the journal: self.journal = TradeJournal(cfg.db_path). TradeJournal.__init__ (src/trading/journal.py) calls sqlite3.connect(db_path) โ SQLite creates the file if it does not exist (the parent directory must already exist) โ and ensures two tables:
tradesโ one row per trade, keyed by trade id: direction, asset, stake ($), confidence, regime, entry/exit timestamps, result (win/loss/draw), profit ($), the JSON-encoded feature vector, and expiry (seconds). Rows are written withINSERT OR REPLACEwhen a trade is placed and again when it resolves. Older databases are migrated in place (missingfeatures/expirycolumns are added).model_snapshotsโ periodic snapshots (every 10 resolved trades): timestamp, win rate, total trades, daily P&L ($), regime.
The journal is central to persistence: on startup, if no saved brain is loaded, _reload_from_journal in src/bot.py loads all completed win/loss trades that have stored features (load_completed_trades), reconstructs training labels, retrains the ensemble with partial_fit(), restores the win/loss stats, and feeds the adaptive strategy. Deleting the file therefore wipes the botโs trade memory (but not a saved brain file).
Valid values
Any writable file path; relative paths resolve against the directory you launch the bot from. Use one database per bot instance โ the journal opens a single SQLite connection without cross-process locking coordination.
Examples
# src/config.py
db_path: str = "data/eurusd_journal.db" # the data/ directory must existfrom src.config import BotConfig
cfg = BotConfig(ssid="...", db_path="data/eurusd_journal.db")
Inspect the journal:
sqlite3 trade_journal.db "SELECT direction, result, profit FROM trades ORDER BY entry_time DESC LIMIT 10;"Interactions
PO_BRAIN_PATHโ if a saved brain loads successfully, journal replay is skipped; the journal is the fallback learning source.retrain_everygoverns live incremental fits; the journal replay does one fit over all loaded trades.PO_RETRAINdeletes the brain and forces relearning from the journal (and dataset).
See also
๐ฌ Unsure how this interacts with the rest of the configuration? Ask in the Chipa Discord โ or prototype strategies no-code with ChipaEditor.