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

VariableTypeDefaultDescription
PO_SSIDstring(none β€” required)PocketOption session ID used to authenticate the WebSocket client.
PO_ASSETstringEURUSDTrading pair to stream candles for and place trades on.
PO_TIMEFRAMEint (seconds)60Candle period for streaming, warmup history, and dataset labeling.
PO_EXPIRY_OPTIONScomma-separated ints (seconds)120,300,600Pool of expiries the AI expiry selector chooses from.
PO_DEFAULT_EXPIRYint (seconds)300Label horizon used when pre-training from a CSV dataset.
PO_BASE_STAKEfloat ($)25.0Minimum trade size; floor of the Kelly stake formula.
PO_MAX_STAKEfloat ($)100.0Hard ceiling on any single trade’s stake.
PO_MAX_DAILY_LOSSfloat ($)300.0Daily stop-loss; trading halts for the UTC day once breached.
PO_MIN_CONFfloat (fraction)0.63Minimum model confidence required to consider a trade.
PO_MAX_CONFfloat (fraction)0.85Maximum confidence; higher signals are rejected as likely overfit.
PO_REQUIRE_ALIGNMENTflag (0 = off)1 (on)Require 2-of-3 indicator agreement (RSI, MACD, SMA cross) with the ML signal.
PO_DATASETfile pathEURUSD_M1.csvCSV of historical candles for pre-training when no saved brain exists.
PO_BRAIN_PATHfile pathathena_brain.pklWhere the trained model ensemble (β€œbrain”) is saved and loaded.
PO_RETRAINflag (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 .env does not exist, it is silently skipped.
  • Blank lines, lines starting with #, and lines without = are ignored.
  • Each KEY=VALUE line is applied with os.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.