SuperAPIAI Directory

trading-research-agents

github.com · AI agents

TRA (trading research agents) is an open-source cryptocurrency trading desk published on PyPI under the package name bitra, which users can run locally themselves. It reads market data, makes a single decision, calculates round-trip costs, validates against user-declared constraints, and then records the decision or sends an order with a stop-loss attached. Decisions can come from user-defined rule files (no model required) or be suggested by a language model; however, all numerical calculations, constraint application, position sizing, and order sending are performed by the system without involving the model. Every decision and rejection is saved to disk along with the reason. The project is experimental, settings may change between versions, the author has never run it with real funds, and it comes with no profitable strategy. Main capabilities include: a unified order path to all exchanges via ccxt; replaying arbitrary rules over multi-year data (deducting user-defined costs) and comparing against buy-and-hold and random benchmarks; a typed judge that reads the day's headlines and can block entries on adverse events; and records that allow verification of all claims.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)

About this tool

TRA (trading research agents) is an open-source cryptocurrency trading desk published on PyPI under the package name bitra, which users can run locally themselves. It reads market data, makes a single decision, calculates round-trip costs, validates against user-declared constraints, and then records the decision or sends an order with a stop-loss attached. Decisions can come from user-defined rule files (no model required) or be suggested by a language model; however, all numerical calculations, constraint application, position sizing, and order sending are performed by the system without involving the model. Every decision and rejection is saved to disk along with the reason.

Main capabilities:

  • A unified order path to all exchanges via ccxt, supporting linear perpetual contracts (USDT or USDC margin), spot pairs (long-only), stock perpetuals and tokenized stocks, and prediction market outcomes.
  • Arena feature: replay arbitrary rules over multi-year data (deducting user-defined costs) and compare against buy-and-hold and random benchmarks.
  • Typed judge: reads the day's headlines and can block entries on adverse events.
  • Records all decisions and rejections along with their reasons for later verification.
  • Supports two modes: rule desk (no model key required) and agent desk (model key required).
  • Provides console, script, and cron run modes, with --plain or --json output.
  • Supports multiple model providers (Anthropic, OpenAI, Google, etc.), with each provider reading its key from environment variables or a .env file.
  • Provides a research path for backtesting, paper trading, and live canary sessions.

Usage:

  1. Install: requires Python 3.11 or newer. Install with uv:uv pip install 'bitra[ccxt,anthropic,openai,google,data]', or run in a virtual environment pip install 'bitra[ccxt,anthropic,openai,google,data]'.
  2. Create a trading desk:tra init creates a folder containing settings and decision records; you can use --venue okx to specify the exchange (default is Bybit).
  3. The rule desk requires declaring the rule's average net return in [strategy].edge_bps (from your own arena run); the agent desk requires copying .env.example to .env and setting the model key.
  4. Check:tra check reads all settings and points out the next issue that needs fixing.
  5. Run:tra run makes one decision based on live market data in a sandbox (without leaving the local machine);tra run --every 1d makes one decision at market close each day; or simply enter tra to enter the console.
  6. Exchange execution: use --venue Create a trading desk, then enable execution with three commands. You must first read and sign the authorization letter (tra mandate --sign "Your Name"). Signing alone does not enable any functionality;--venue-mode will both sign and enable orders.

Use cases:

  • Research, backtesting, and paper trading of cryptocurrency trading strategies.
  • Testing trading rules or trading suggestions proposed by language models in a sandbox environment.
  • Unified order management across multiple exchanges via ccxt.
  • Auditable recording and verification of trading decisions.

Limitations:

  • The project is experimental; settings may change between versions.
  • The author has never run it with real funds.
  • No profitable strategy is included.
  • Live mode (venue mode) is the only mode in which losses are possible and requires signing the authorization letter.
  • Some features (such as the rules desk and event guard) exist only on the develop branch and have not been released.
  • When the trading desk is not running, open positions are protected only by exchange-side stop-loss and take-profit; running under a supervisor is recommended.
  • Dated futures, inverse contracts, and options are still under development; the system will reject orders for these market types.
  • The model cannot place, cancel, or resize orders, nor can it read files outside the project or edit configuration.
  • Each provider's free tier is metered per model; unless a cap is declared, spending is not limited.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools