PO_MAX_DAILY_LOSS

🦉 AthenaAI is an AI-powered ensemble machine-learning trading bot for PocketOption, built on BinaryOptionsToolsV2Get it on GitLab
💬 Need help? Join the Chipa Discord · ⚡ Go no-code with ChipaEditor

The daily stop-loss, in dollars. Once the day’s net P&L falls to or below minus this amount, the bot stops opening new trades until the next UTC day.

Typefloat ($)
Default300.0
RequiredNo
Maps toBotConfig.max_daily_loss
Read inmain.py (build_config())

What it does

build_config() parses it with float(env("PO_MAX_DAILY_LOSS", "300.0")) — a non-numeric value raises ValueError and crashes at startup.

The value is enforced by MoneyManager (src/trading/money_manager.py):

  • Every resolved trade’s profit or loss is added to daily_pnl via MoneyManager.record(pnl), called from _result_checker() in src/bot.py.
  • On every loop iteration, _trade_loop() calls money_mgr.can_trade(), which returns daily_pnl > -cfg.max_daily_loss. When it returns False the loop skips trading and periodically logs ⏸ Daily loss limit reached.
  • can_trade() first calls reset_if_new_day(): when the UTC calendar date changes, daily_pnl resets to 0.0 (logging New day — resetting daily P&L tracker) and trading resumes automatically.

Details worth knowing:

  • The check is strict: trading stops when daily_pnl <= -max_daily_loss exactly, e.g. at −$300.00 with the default.
  • The limit gates new trades only — a trade already open when the limit is hit still runs to expiry, so the actual daily loss can overshoot by up to one stake.
  • daily_pnl lives in memory only. Restarting the bot resets it to zero, which effectively lifts the day’s stop-loss.
  • P&L is computed with an assumed payout of 0.85: a win adds stake * 0.85, a loss subtracts the full stake.

Valid values

A positive dollar amount. 0 (or negative) makes can_trade() false from the first check (0 > 0 fails), so the bot never trades — not a useful setting.

Examples

export PO_MAX_DAILY_LOSS=150
$env:PO_MAX_DAILY_LOSS = '150'
# .env
PO_MAX_DAILY_LOSS=300

Interactions

  • Loss size per trade is bounded by PO_MAX_STAKE and floored by PO_BASE_STAKE; with defaults the daily stop equals three max-stake losses or twelve base-stake losses.
  • Independent of the consecutive-loss cooldown (max-consec-losses, cooldown-seconds), which pauses temporarily rather than for the day.

Risk note: binary options trading can lose money, and past performance does not guarantee future results. This is your primary daily circuit breaker — set it to an amount you can afford to lose, and remember a restart clears the counter.

See also

💬 Unsure how this interacts with the rest of the configuration? Ask in the Chipa Discord — or prototype strategies no-code with ChipaEditor.