API Reference

๐Ÿฆ‰ 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

This section documents every module in the AthenaAI codebase: full signatures, parameters, return values, side effects, and internals developers need when extending the bot. Every fact here is drawn from the source in the repository โ€” file paths are given on each page.

For conceptual explanations of the algorithms, see the concepts section; for how to run the bot, see the quickstart.

Entry points

ModulePageWhat it does
main (main.py)main.mdLive-trading entry point: loads .env, builds BotConfig, runs the bot
train (train.py)see CLI reference and trainer.mdStandalone training CLI
src.configconfig.mdBotConfig dataclass โ€” every tuneable knob
src.botbot.mdAITradingBot โ€” orchestrates the three async loops

src.core โ€” models and market analysis

ModulePageWhat it does
src.core.modelsmodels.mdEnsemblePredictor โ€” 5-model voting ensemble with online learning
src.core.feature_enginefeature-engine.mdFeatureEngine โ€” 40 core + 17 experimental features from candles
src.core.regimeregime.mdRegimeDetector โ€” trending/ranging/volatile classification
src.core.expiryexpiry.mdExpirySelector โ€” scores and learns the best trade expiry

src.trading โ€” execution, risk, and adaptation

ModulePageWhat it does
src.trading.strategystrategy.mdAdaptiveStrategy โ€” blocks losing regimes/hours, adjusts confidence
src.trading.money_managermoney-manager.mdMoneyManager โ€” Kelly stake sizing and daily loss limit
src.trading.journaljournal.mdTradeJournal โ€” SQLite persistence (schema documented)
src.trading.performanceperformance.mdPerformanceTracker โ€” in-memory W/L/P&L/drawdown stats
src.trading.feature_labfeature-lab.mdFeatureLab โ€” masks anti-predictive experimental features

src.training โ€” standalone trainer

ModulePageWhat it does
src.training.trainertrainer.mdTrainer / TrainerConfig โ€” full offline training pipeline
src.training.datasetdataset.mdCSV loading and parallel sample generation
src.training.devicedevice.mdCUDA / MPS / CPU device detection
src.training.torch_modeltorch-model.mdTorchMLPClassifier โ€” picklable GPU MLP

src.utils โ€” shared primitives

ModulePageWhat it does
src.utils.candlecandle.mdCandle and TradeRecord dataclasses
src.utils.enumsenums.mdDirection and Regime enums
src.utils.loggerlogger.mdShared log instance and format

Import graph at a glance

main.py โ”€โ”€โ–ถ src.bot โ”€โ”€โ–ถ src.core.*  src.trading.*  src.utils.*
train.py โ”€โ–ถ src.training โ”€โ–ถ src.core.models / feature_engine, src.utils.*

Both entry points produce/consume the same brain file (a pickle of EnsemblePredictor state) โ€” see models.md and the persistence guide.


Level Up Your AthenaAI Setup