Skip to content
All library documents

Two-Agent Workflow for SPX Zero-Day Bear Call Spreads

Article Lumibot

Summary

The document describes an options workflow that separates research from trade execution. A non-trading researcher gathers market, account, option-chain, contract, Greeks, quote, and package-price information. A trading agent independently refreshes that evidence, checks the strategy rules, decides whether to act, submits a multileg spread, and checks the resulting order and positions. The scheduling layer passes along the research summary but does not choose contracts or place orders.

The specified trade sells a same-day SPX call near 0.20 delta and buys another call five points higher, with a limit of one new package each trading day and atomic entry and exit. The described proof used SPXW options, opening and closing the spread with one multileg order each; both orders filled. The document notes that atomic package support is required and that monthly SPX data was unavailable for the cited day. This example demonstrates workflow mechanics, not profitability, and recommends paper trading over a short historical period before any live use.

Key ideas

  • The research role collects evidence without permission to trade.
  • The trading role refreshes evidence, checks active rules, makes the decision, and verifies the order and positions.
  • The example sells a zero-day call near 0.20 delta and buys a call five points higher.
  • Atomic package support is required for spread entry and exit.
  • The reported trial demonstrates execution mechanics and does not establish profitability.

Tags

Full text
# agents example ai spx zero dte bear call team


Two-Agent SPX 0 DTE Bear Call Experiment
========================================

.. meta::
   :description: ai_spx_zero_dte_bear_call_team.py tests a strict two-agent architecture: LumiBot documentation.

.. image:: ../docs/assets/ai-agent-workflows/ai-spx-zero-dte-bear-call-team.png
   :alt: SPX zero-day bear call AI trading team workflow
   :width: 100%

``ai_spx_zero_dte_bear_call_team.py`` tests a strict two-agent architecture:

* The researcher has ``allow_trading=False`` and gathers current SPX, account,
  chain, contract, Greek, quote, and package-price evidence.
* The trader has ``allow_trading=True``. It independently refreshes the
  evidence, validates every active Rule, decides whether to trade, submits any
  spread through ``orders_submit_multileg``, and verifies the order and
  resulting positions.

Python schedules the two calls and passes the research summary forward. It does
not select contracts or submit orders. The active Rules require SPX 0 DTE calls,
a short call near 0.20 delta, a long call exactly five points higher, one new
package per trading day, and atomic entry and exit.

The active broker must support atomic packages. Otherwise LumiBot rejects the
request before submitting any child leg.

The January 5, 2026 Alpaca proof used SPXW, the listed zero-day symbol, at
strikes 6900 and 6910. It submitted one ``orders_submit_multileg`` to open and
one to close. Both filled. The account ended near $99,925. The monthly SPX
symbol returned no bars for that day, so the proof uses SPXW.

.. code-block:: bash

   export OPENAI_API_KEY="your-key"
   export BACKTESTING_DATA_SOURCE="alpaca"
   export DATADOWNLOADER_BASE_URL="https://<your-downloader-host>:8080"
   export DATADOWNLOADER_API_KEY="your-downloader-key"
   python -m lumibot.example_strategies.ai_spx_zero_dte_bear_call_team

Use a paper broker and a short historical window before considering any live
workflow. The example proves architecture and mechanics, not profitability.

.. literalinclude:: ../lumibot/example_strategies/ai_spx_zero_dte_bear_call_team.py
   :language: python
   :linenos:

Shown in full with attribution under the source's licence. Licence: GPL-3.0

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.