Fast Decision-Model 24/7 Crypto and Futures Bot =============================================== .. meta:: :description: Sub-second Python AI trading bot using LumiBot self.agents.decide() with OpenAI gpt-6-luna or Google gemini-decision-1 for 24/7 Alpaca crypto and TopstepX MNQ futures. .. image:: ../docs/assets/ai-agent-workflows/fast-decision-crypto-futures-bot.png :alt: Low-latency decision model classifies live 5-minute crypto or futures momentum into BUY, HOLD, or EXIT in milliseconds :width: 100% Full multi-turn agent loops are ideal for deep research, but fast intraday crypto and futures trading needs millisecond classification without waiting through multi-step tool calls. This 24/7 bot combines deterministic Python market features with LumiBot's ultra-fast ``self.agents.decide()`` interface using OpenAI ``openai/gpt-6-luna`` or Google ``google/gemini-decision-1`` to trade Alpaca Crypto (BTC/USD) or TopstepX Micro Nasdaq futures (MNQ). How it works ------------ Every five minutes, deterministic Python computes clean price features and hands them to a single sub-second agent decision call: 1. **Feature builder and decision agent** fetches the last 30 one-minute bars, calculates 5-bar and 20-bar simple moving averages plus 5-minute and 20-minute returns, and calls ``self.agents.decide()`` with structured evidence and two typed questions: a discrete ``action`` choice (``BUY``, ``HOLD``, or ``EXIT``) and a calibrated ``high_conviction`` probability predicate. 2. **Execution layer** inspects the returned choice and probability score. When the decision agent selects ``BUY`` with ``conviction >= 0.65`` and the strategy is flat, Python submits a sized buy order (percentage of cash for 24/7 crypto on Alpaca, or 1 contract for ``MNQ`` continuous futures on TopstepX); when it selects ``EXIT`` while long, Python closes the position immediately. Switch between 24/7 Bitcoin and TopstepX Micro Nasdaq futures by changing ``symbol`` and ``asset_type`` in ``parameters`` (``"crypto"`` or ``"cont_future"``), and swap ``decision_model`` between ``openai/gpt-6-luna`` and ``google/gemini-decision-1``. Run it on BotSpot ----------------- Explore ready-to-run bots and deploy 24/7 strategies in the cloud on `BotSpot Marketplace `_. BotSpot hosts LumiBot strategies continuously, runs historical backtests, and connects directly to Alpaca, TopstepX, and other supported brokers. Building custom fast-decision strategies with Claude, ChatGPT, Codex, or Cursor? Connect the free :doc:`BotSpot MCP ` for LumiBot skills, cloud backtesting, and logs. Want guided training on low-latency AI trading bots? Explore `BotSpot Courses `_ or join the `free AI Trading Challenge `_. The code -------- The complete hybrid strategy is under 100 lines of Python and demonstrates typed ``choice`` and ``predicate`` probability outputs from ``self.agents.decide()``. .. literalinclude:: ../lumibot/example_strategies/ai_fast_decision_crypto_futures_bot.py :language: python Run it yourself --------------- .. code-block:: bash pip install lumibot python -m lumibot.example_strategies.ai_fast_decision_crypto_futures_bot Add the model key matching ``decision_model`` plus your broker credentials to your ``.env`` file: * ``OPENAI_API_KEY`` for ``openai/gpt-6-luna`` (default) or ``GEMINI_API_KEY`` for ``google/gemini-decision-1`` * ``ALPACA_API_KEY``, ``ALPACA_API_SECRET``, and ``ALPACA_IS_PAPER=true`` for 24/7 Alpaca Crypto (``BTC/USD``) * Or your TopstepX credentials when switching ``symbol="MNQ"`` and ``asset_type="cont_future"`` Set ``IS_BACKTESTING=true`` with ``BACKTESTING_START`` and ``BACKTESTING_END`` to run a historical backtest with simulated 0.1% trading fees, or ``IS_BACKTESTING=false`` to run live against your configured broker. Good to know ------------ * ``self.agents.decide()`` requires a LumiBot runtime version that includes the decision-model API. Confirm your installed version and provider credentials before running live. * Running every five minutes around the clock triggers up to 288 decision calls per day; test a short historical window (one to two days) first to verify fill behavior, trading fees, and decision latency. * Crypto and leveraged futures carry rapid price swings and fee drag on high-frequency entries and exits. Backtests verify mechanics and fee accounting, not profitability. See :doc:`agents_examples` for more AI trading bots and :doc:`strategy_run_modes` for backtest and live runners.