One Trading Trading Bot in Python

This guide shows how to build a One Trading trading bot in Python with LumiBot, for both AI agent trading and algorithmic trading. LumiBot connects to One Trading through CCXT, the open source library that talks to more than 100 crypto exchanges. You will create a One Trading account and API key, connect it, and run two examples: a simple algorithmic trading bot and an agentic trading bot where an AI agent makes the calls.

One Trading at a glance

CCXT exchange id

onetrading

Markets

Spot

Testnet (sandbox)

No

Credentials

API key

Live data streams

prices, order book, candles, your orders, your balance

CCXT request spacing

about 300 ms between requests

Official site

https://onetrading.com/

API docs

https://docs.onetrading.com

Fees

https://onetrading.com/fees

What is One Trading?

One Trading (formerly Bitpanda Pro) is a crypto exchange that offers spot trading and futures, open 24/7.

Sign up for One Trading

  1. Click Open Account on the One Trading site, fill in your details and log in with your new email and password.

  2. Set up two-factor authentication. One Trading makes 2FA mandatory and it cannot be turned off.

  3. Complete identity verification when One Trading asks for it.

Open a One Trading account

Create a One Trading API key

  1. Log in, click your profile in the top right corner and open the API Keys tab.

  2. Click New API key and give it a name.

  3. Choose the permissions (see below). If you like, limit the key to up to five IP addresses.

  4. Click Create API key and copy the key right away. This is the only time One Trading shows it.

  5. Confirm the key with the link One Trading emails you. The link expires after 2 hours, so use the newest email.

Which permissions to turn on: Choose Read and Trade. Read covers balances and market data; Trade lets the bot place and cancel orders. Leave Withdraw off. A bot never needs to move money out of your account.

Warning

Never turn on withdrawals for a One Trading trading bot key. Bind the key to your server’s IP address when One Trading lets you, keep the secret out of your code and out of Git, and delete the key if it ever leaks.

Connect One Trading to LumiBot

The simplest way: put these lines in a .env file next to your strategy. LumiBot loads the file, sees TRADING_BROKER=onetrading and connects to One Trading for you, so your strategy needs no broker code.

TRADING_BROKER=onetrading
ONETRADING_API_KEY=your_apiKey

LumiBot reads exactly the fields CCXT needs for One Trading (apiKey). If one is missing, LumiBot stops at start-up and names the variable you still need.

You can also build the broker in code. This is handy when one script talks to more than one exchange, or when you need extra CCXT options. The keys in the config are CCXT’s own credential names for One Trading:

import os

ONETRADING_CONFIG = {
    "exchange_id": "onetrading",
    "apiKey": os.environ.get("ONETRADING_API_KEY"),
    "sandbox": False,  # no sandbox for this exchange
}

from lumibot.brokers import Ccxt

broker = Ccxt(ONETRADING_CONFIG)
# then: MyStrategy(broker=broker, ...)

Either way, LumiBot turns on CCXT’s built-in rate limiting for you.

Testing on One Trading

One Trading has no sandbox, and CCXT lists no test URL for it, so test with a very small amount. With environment variables, leave ONETRADING_SANDBOX unset. In a code config, always set "sandbox": False.

Algorithmic trading example: a simple One Trading bot

This bot buys about 50 USDC of BTC on One Trading once and then holds it. It is a starting point to check that your keys, balances and orders work. If the exchange’s minimum order is larger, raise the amount.

from lumibot.entities import Asset
from lumibot.strategies import Strategy


class OnetradingBuyOnce(Strategy):
    """Buy a small amount of BTC once, then hold it."""

    def initialize(self):
        self.sleeptime = "1H"
        self.set_market("24/7")  # crypto trades all day, every day

    def on_trading_iteration(self):
        coin = Asset("BTC", asset_type=Asset.AssetType.CRYPTO)
        if self.get_position(coin) is not None:
            return  # already holding BTC
        price = self.get_last_price(coin, quote=self.quote_asset)
        if price:
            quantity = round(50 / price, 6)  # about 50 USDC worth
            order = self.create_order(coin, quantity, "buy", quote=self.quote_asset)
            self.submit_order(order)


if __name__ == "__main__":
    # LumiBot reads TRADING_BROKER and the keys from your .env file.
    strategy = OnetradingBuyOnce(quote_asset=Asset("USDC", asset_type=Asset.AssetType.CRYPTO))
    strategy.run_live()

Agentic trading example: an AI agent that trades on One Trading

Agentic trading means an AI agent reads the market and decides what to do. In this example one LumiBot agent looks at prices and your One Trading account, then places the orders itself. There is no Python logic in between: you set the rules in plain English in the prompt, such as what it may trade and how big each order can be. This follows the same pattern as LumiBot’s AI trading team examples.

from lumibot.entities import Asset
from lumibot.strategies import Strategy


class OnetradingAITrader(Strategy):
    """One AI agent researches the market and places the trades itself."""

    def initialize(self):
        self.sleeptime = "4H"
        self.set_market("24/7")
        self.agents.create(
            name="trader",
            model="openai/gpt-6-luna",
            reasoning_effort="high",
            allow_trading=True,
            system_prompt=(
                "You manage a small crypto account on One Trading. "
                "You may trade BTC and ETH against USDC (asset_type 'crypto', quote_symbol 'USDC'), or hold cash. "
                "Before every order, call account_portfolio, account_positions and "
                "market_last_price for that exact symbol in the same run. "
                "Keep each order under 10% of the account value. "
                "Explain each decision in one short paragraph."
            ),
        )

    def on_trading_iteration(self):
        self.agents["trader"].run(
            task_prompt="Review recent BTC/USDC and ETH/USDC prices and your current holdings, then decide whether to buy, sell or hold.",
            context={"exchange": "One Trading", "quote": "USDC", "date": self.get_datetime().isoformat()},
        )


if __name__ == "__main__":
    # LumiBot reads TRADING_BROKER and the keys from your .env file.
    strategy = OnetradingAITrader(quote_asset=Asset("USDC", asset_type=Asset.AssetType.CRYPTO))
    strategy.run_live()

The agent needs a model key such as OPENAI_API_KEY in your environment. See the AI agents quickstart for models, tools and memory.

What you can trade on One Trading through CCXT

Market

Listed by CCXT

Spot

Yes

Margin

No

Perpetual swaps

No

Dated futures

No

Options

No

CCXT lists these order features for One Trading: market orders, limit orders, stop orders, editing open orders, canceling orders.

One Trading tips

  • Check that a market is open before you trade it. On 2026-10-23 One Trading’s instruments list showed the BTC_EUR spot market as CLOSED, while BTC_USDC spot was ACTIVE, so this example uses BTC/USDC.

  • If you used Bitpanda Pro before, log in to One Trading with your old Bitpanda Pro account. The CCXT id is onetrading.

  • One Trading allows about 240 requests per minute. Too many requests return HTTP 429, so keep your bot’s polling modest.

  • One Trading supports subaccounts. A key acts on one account (the main account or a subaccount), so a separate subaccount per bot keeps trades apart.

Frequently asked questions

Can I build a One Trading trading bot in Python?

Yes. Install LumiBot (pip install lumibot), set your One Trading keys and use the onetrading CCXT exchange id as shown above.

Does One Trading have a testnet?

No testnet is set up for One Trading in LumiBot. Start with a small amount, and in a code config set "sandbox": False.

Which API permissions does a One Trading bot need?

Choose Read and Trade. Read covers balances and market data; Trade lets the bot place and cancel orders. Leave Withdraw off. A bot never needs to move money out of your account.

Can an AI agent trade on One Trading by itself?

Yes. The agentic example above gives one agent permission to trade. You control what it may trade and how much through its prompt.

Can I trade One Trading perpetual futures with LumiBot?

CCXT does not list perpetual swaps for One Trading, so use spot markets.

Is LumiBot free?

Yes. LumiBot is open source on GitHub at https://github.com/Lumiwealth/lumibot. You pay only your exchange’s trading fees and, for AI agents, your model provider.

Run it in the cloud with BotSpot

Do not want to keep a computer running for your One Trading bot? BotSpot is the hosted home for LumiBot strategies and AI trading agents: build with AI, backtest, connect a broker, and watch every trade with logs and alerts.

Try BotSpot

Sources