Environment variables
π¦ 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 entirely through environment variables. main.py calls _load_dotenv() and then build_config(), which reads each PO_* variable and builds a BotConfig (defined in src/config.py). One variable, PO_RETRAIN, is read later β directly in src/bot.py inside AITradingBot.start().
All variables
| Variable | Type | Default | Description |
|---|---|---|---|
PO_SSID | string | (none β required) | PocketOption session ID used to authenticate the WebSocket client. |
PO_ASSET | string | EURUSD | Trading pair to stream candles for and place trades on. |
PO_TIMEFRAME | int (seconds) | 60 | Candle period for streaming, warmup history, and dataset labeling. |
PO_EXPIRY_OPTIONS | comma-separated ints (seconds) | 120,300,600 | Pool of expiries the AI expiry selector chooses from. |
PO_DEFAULT_EXPIRY | int (seconds) | 300 | Label horizon used when pre-training from a CSV dataset. |
PO_BASE_STAKE | float ($) | 25.0 | Minimum trade size; floor of the Kelly stake formula. |
PO_MAX_STAKE | float ($) | 100.0 | Hard ceiling on any single tradeβs stake. |
PO_MAX_DAILY_LOSS | float ($) | 300.0 | Daily stop-loss; trading halts for the UTC day once breached. |
PO_MIN_CONF | float (fraction) | 0.63 | Minimum model confidence required to consider a trade. |
PO_MAX_CONF | float (fraction) | 0.85 | Maximum confidence; higher signals are rejected as likely overfit. |
PO_REQUIRE_ALIGNMENT | flag (0 = off) | 1 (on) | Require 2-of-3 indicator agreement (RSI, MACD, SMA cross) with the ML signal. |
PO_DATASET | file path | EURUSD_M1.csv | CSV of historical candles for pre-training when no saved brain exists. |
PO_BRAIN_PATH | file path | athena_brain.pkl | Where the trained model ensemble (βbrainβ) is saved and loaded. |
PO_RETRAIN | flag (1 = on) | (unset) | If exactly 1, deletes the saved brain file and retrains from scratch. |
.env loading and precedence
main.py ships a minimal loader, _load_dotenv(), that reads a .env file from the working directory (no external dependency):
- If
.envdoes not exist, it is silently skipped. - Blank lines, lines starting with
#, and lines without=are ignored. - Each
KEY=VALUEline is applied withos.environ.setdefault(), and surrounding single or double quotes around the value are stripped.
Because it uses setdefault, a variable already set in your real environment always wins over the .env file. To pick up a changed .env value, unset the shell variable first (or start a fresh shell).
A template lives at .env.example in the repository root β copy it to .env and fill in your values.
See also
Level Up Your AthenaAI Setup
- π¦ Get AthenaAI on GitLab β β clone the source, open issues, and contribute improvements.
- π¬ Join the Chipa Discord β β get real-time support, share your results, and swap strategy ideas with other AthenaAI users.
- β‘ Try ChipaEditor β β build, backtest, and deploy trading strategies without writing a line of code, with our AI-powered strategy editor.