PO_REQUIRE_ALIGNMENT

🦉 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

Enables a secondary gate that requires at least 2 of 3 technical indicators to agree with the ensemble’s predicted direction before a trade is allowed.

Typeflag (0 = off, anything else = on)
Default1 (enabled)
RequiredNo
Maps toBotConfig.require_indicator_alignment
Read inmain.py (build_config())

What it does

build_config() sets:

require_indicator_alignment=env("PO_REQUIRE_ALIGNMENT", "1") != "0",

The parsing is unusual — the gate is enabled unless the value is exactly the string 0. PO_REQUIRE_ALIGNMENT=false, =off, =no, or even an empty string all evaluate to True (enabled). Only PO_REQUIRE_ALIGNMENT=0 disables it. (Quotes in a .env file are stripped by the loader, so PO_REQUIRE_ALIGNMENT="0" also disables it.)

When enabled, _trade_loop() (src/bot.py) calls _check_indicator_alignment(features, direction) after the confidence gates. The check reads three values from the feature vector — RSI (index 14), MACD histogram (index 12), and SMA cross (index 10) — and counts votes:

  • For a CALL: RSI < 70 (not overbought), MACD histogram > 0 (bullish), SMA cross > 0 (trend up).
  • For a PUT: RSI > 30 (not oversold), MACD histogram < 0 (bearish), SMA cross < 0 (trend down).

At least 2 of 3 must agree, otherwise the signal is skipped (diagnostic log ⏸ Indicators misaligned (conf=…), debug log of the vote count). Unlike the confidence gates, a misalignment does not clear the signal-confirmation history.

The v6 comment in src/config.py explains why it defaults on: “secondary gate catches bad signals”.

Valid values

ValueEffect
0Gate disabled
1 (default), or any other stringGate enabled

Examples

export PO_REQUIRE_ALIGNMENT=0   # disable the gate
$env:PO_REQUIRE_ALIGNMENT = '0'
# .env
PO_REQUIRE_ALIGNMENT=1

Interactions

  • Runs after the PO_MIN_CONF / PO_MAX_CONF gates and before signal confirmation, the 5-minute trend check, and the adaptive gate.
  • The indicator values come from the feature engine’s core features — see the feature engine concept.
  • Real environment variables override .env values (see index).

See also

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