Configuration
๐ฆ 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
AthenaAI is configured through three distinct layers. Knowing which layer owns which knob saves you from editing the wrong place.
The three layers
1. Environment variables (.env or shell) โ the live bot
main.py reads PO_* environment variables in build_config() and constructs a BotConfig from them. This layer covers the connection, asset/timeframe, expiries, stakes, daily loss limit, confidence gates, dataset and brain paths โ everything most users need. Full list with one page per variable: Environment reference.
export PO_SSID='your-session-id' # bash$env:PO_SSID='your-session-id' # PowerShell2. BotConfig fields (src/config.py) โ advanced tuning
BotConfig holds every tunable knob, but only some fields are wired to environment variables. The rest โ kelly_fraction, max_concurrent_trades, warmup_candles, retrain_every, signal_confirmations, min_wait_between_trades, trading_hours, max_consec_losses, cooldown_seconds, and more โ can only be changed by editing the defaults in src/config.py or constructing BotConfig yourself. One page per such field: Config reference.
Two defaults differ between layers, which matters if you bypass main.py:
| Field | BotConfig default | main.py env default |
|---|---|---|
brain_path | athena_po_brain.pkl | athena_brain.pkl (PO_BRAIN_PATH) |
dataset_path | "" (no pre-training) | EURUSD_M1.csv (PO_DATASET) |
3. Trainer CLI flags (train.py) โ offline training
The standalone trainer is configured entirely by command-line flags (--data, --out, --expiry, --epochs, โฆ), mapped onto TrainerConfig in src/training/trainer.py. It ignores PO_* variables and .env. One page per flag: CLI reference. Only one environment variable touches training behavior at bot startup: PO_RETRAIN=1 makes the bot delete the saved brain and retrain in-process.
.env loading and precedence
main.py ships a minimal, dependency-free .env loader (_load_dotenv in main.py). Rules, exactly as implemented:
- Only a file named
.envin the current working directory is read (run the bot from the repo root). - Blank lines, lines starting with
#, and lines without=are skipped. - Values are split on the first
=; surrounding whitespace and single/double quotes are stripped. - Each key is applied with
os.environ.setdefault(...)โ a variable already set in your real environment always wins over the.envvalue..envfills gaps; it never overrides.
So PO_MIN_CONF=0.70 python main.py beats whatever .env says, which is handy for one-off experiments.
Malformed numeric values raise at startup (e.g. a bad PO_TIMEFRAME fails int()), except PO_EXPIRY_OPTIONS, which falls back with a printed warning: Warning: could not parse '...', using (120, 300, 600).
Recommended starting point
A conservative .env for a first live run (assumes you trained a brain with python train.py first โ see Training):
# Required
PO_SSID=your_session_id_here
# Trading โ 1-minute EURUSD candles, AI picks among 2/5/10-minute expiries
PO_ASSET=EURUSD
PO_TIMEFRAME=60
PO_EXPIRY_OPTIONS=120,300,600
PO_DEFAULT_EXPIRY=300
# Money management โ start small; raise only after observed results
PO_BASE_STAKE=1
PO_MAX_STAKE=5
PO_MAX_DAILY_LOSS=20
# Signal filtering โ defaults; both gates on
PO_MIN_CONF=0.63
PO_MAX_CONF=0.85
PO_REQUIRE_ALIGNMENT=1
# Data & persistence
PO_DATASET=EURUSD_M1.csv
PO_BRAIN_PATH=athena_brain.pkl
Notes on the choices:
- Stakes and daily loss are in dollars ($). The defaults (
25/100/300) are far too large for a first run โ stake sizing details in Risk management. PO_MIN_CONF=0.63/PO_MAX_CONF=0.85reject both weak signals and suspiciously overconfident (overfit-looking) ones. Widening this band means more trades of lower average quality.PO_DATASETis only used when no saved brain is found atPO_BRAIN_PATH; set it to an empty value to skip in-process pre-training entirely.- The bot also enforces non-env limits out of the box: max 1 concurrent trade, 60 s minimum between trades, a UTC trading-hours whitelist, and a 300 s cooldown after 3 consecutive losses โ see the Config reference and Risk management.
Risk note
Every value in the money-management block directly controls money at risk. Binary options trading can lose your entire stake on each trade, and past performance does not guarantee future results.
See also
๐ฌ Stuck during setup? The Chipa Discord is the fastest place to get help โ and if youโd rather skip the code entirely, build your strategy visually with ChipaEditor.