src.config

πŸ¦‰ 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

Source: src/config.py. Defines a single dataclass, BotConfig, holding all tuneable knobs for the live bot. It is constructed in main.py (build_config()) with a subset of fields overridden from environment variables β€” the rest keep the defaults below. See the environment reference for env-settable fields and the config field reference for the code-only fields.

@dataclass BotConfig

All fields with their defaults, units, and where they are consumed:

Connection

FieldTypeDefaultMeaning / consumed in
ssidstr""PocketOption session ID. Passed to PocketOptionAsync(ssid=...) in src/bot.py
assetstr"EURUSD"Trading pair, used for candle subscription and buy()/sell()
timeframeint60Candle period in seconds

AI expiry selection

FieldTypeDefaultMeaning
expiry_optionstuple(120, 300, 600)Candidate expiries in seconds fed to ExpirySelector (60s/180s dropped in v6 as bad performers)
default_expiryint300Seconds; used as the label horizon when pre-training from a dataset in src/bot.py _load_dataset()

Money management

FieldTypeDefaultMeaning
base_stakefloat25.0Minimum trade size ($), floor in MoneyManager.compute_stake()
max_stakefloat100.0Hard stake ceiling ($)
kelly_fractionfloat0.50Fraction of full Kelly used for sizing
max_daily_lossfloat300.0Daily stop-loss ($); MoneyManager.can_trade() returns False once daily P&L reaches βˆ’this
max_concurrent_tradesint1Max simultaneously open trades (gate in _trade_loop)

ML and signals

FieldTypeDefaultMeaning
warmup_candlesint60Candles required before the first trade (the bot enforces a floor of 60 regardless β€” features need β‰₯50 candles for SMA50)
min_confidencefloat0.63Minimum ensemble confidence (fraction) to trade
max_confidencefloat0.85Signals above this are rejected as likely overfit
retrain_everyint10partial_fit() after N new live samples
lookbackint200Max candle history kept (deque(maxlen=lookback))
feature_windowint20Rolling window (candles) passed to FeatureEngine.compute()

Signal readiness

FieldTypeDefaultMeaning
signal_confirmationsint1Consecutive candles that must agree on direction (1 = instant)
require_indicator_alignmentboolTrueRequire 2-of-3 of RSI/MACD/SMA-cross to agree with the ML direction
skip_volatile_regimeboolFalseSkip trades when regime is VOLATILE (off by default β€” ML decides)
min_wait_between_tradesint60Seconds between trade placements

Trading schedule

FieldTypeDefaultMeaning
trading_hourstuple(0, 1, 2, 3, 4, 16, 17, 19, 20, 21, 22, 23)UTC hours during which trading is allowed. Per the source comments, based on a 546-trade analysis showing 08–15 UTC loses money. An empty tuple disables the filter

Dataset, risk, persistence, misc

FieldTypeDefaultMeaning
dataset_pathstr""CSV for pre-training (optional; main.py overrides with "EURUSD_M1.csv")
max_consec_lossesint3Consecutive losses triggering a cooldown
cooldown_secondsint300Cooldown duration in seconds
regime_windowint30Candles used by RegimeDetector.detect()
db_pathstr"trade_journal.db"SQLite journal file
brain_pathstr"athena_po_brain.pkl"Saved-model pickle path (main.py overrides with "athena_brain.pkl" via PO_BRAIN_PATH)
poll_intervalfloat2.0Seconds between trade-loop iterations

There are no methods and no validation β€” the dataclass is a plain container. Invalid combinations (e.g. base_stake > max_stake) are not rejected here.

Usage example

from src.config import BotConfig
from src.bot import AITradingBot
import asyncio

cfg = BotConfig(ssid="your-session-id", asset="EURUSD",
                base_stake=10.0, max_stake=50.0, min_confidence=0.65)
asyncio.run(AITradingBot(cfg).start())

Risk note

base_stake, max_stake, kelly_fraction, and max_daily_loss directly control money at risk. Binary options trading can lose money; past performance does not guarantee future results. See the risk management guide.

See also

πŸ’¬ Unsure how this interacts with the rest of the configuration? Ask in the Chipa Discord β€” or prototype strategies no-code with ChipaEditor.