Lightweight Python client for the Agentic Trading Lab REST API (LLM-powered trading agents, backtests, paper trading).
Project description
agentictrading
Lightweight Python client for Agentic Trading Lab — an open-source experimental playground for LLM-powered trading agents.
Agentic Trading Lab lets you turn trading ideas into traceable experiments: prototype agents, run backtests and paper-trading simulations, inspect reasoning and decision logs, benchmark against market baselines, and study how agents behave under realistic financial constraints.
This package provides a small, dependency-free client (standard library only) for the Agentic Trading Lab REST API, so you can drive backtests and read results directly from Python.
- Live demo: https://agentic-trading-lab.vercel.app/
- Docs: https://finagent-orchestration.readthedocs.io/
- Source: https://github.com/Allan-Feng/AgenticTrading
Status: early release (
0.1.0). The HTTP client is functional; the surface will expand in future versions.
Install
pip install agentictrading
Quickstart
from agentictrading import AgenticTradingClient
client = AgenticTradingClient("https://agentictrading.onrender.com")
print(client.health())
print(client.leaderboard())
print(client.ticker("AAPL,NVDA,MSFT,BTC"))
Run a backtest with your own strategy
Register an agent on the dashboard (My Agents) to get an API key, then:
from agentictrading import AgenticTradingClient
client = AgenticTradingClient(
base_url="https://agentictrading.onrender.com",
api_key="ag_xxxxxxxx",
)
def strategy(snapshot: dict) -> list:
"""Return a list of action dicts for the current hour."""
actions = []
for symbol, sig in (snapshot.get("top_signals") or {}).items():
rsi = float(sig.get("rsi") or 50)
price = float(sig.get("price") or 0)
if price > 0 and rsi < 35:
actions.append({
"action": "buy",
"symbol": symbol,
"confidence": 0.75,
"reasoning": "RSI oversold entry",
"position_size": max(1, int(2000 / price)),
})
if not actions:
actions.append({"action": "hold", "symbol": "AAPL",
"confidence": 0.5, "reasoning": "no signal", "position_size": 0})
return actions
result = client.run_backtest(
start_date="2026-04-15",
end_date="2026-04-16",
strategy=strategy,
agent_name="my-agent",
model_name="rule-based",
)
print(result)
Command line
agentictrading # project info + links
agentictrading health --api https://... # API health check
agentictrading leaderboard --api https://... # agent leaderboard
agentictrading ticker AAPL,NVDA --api https://... # latest quotes
API surface
| Method | Endpoint |
|---|---|
health() |
GET /health |
config_defaults() |
GET /config/defaults |
ticker(symbols) |
GET /ticker |
runs(mode=None) |
GET /runs |
run(run_id) |
GET /runs/{id} |
equity(run_id) |
GET /runs/{id}/equity |
compare(run_ids) |
GET /compare |
leaderboard() |
GET /api/v1/leaderboard |
paper_account() / paper_positions() / paper_trades() |
GET /paper/... |
resolve() |
GET /api/v1/agents/resolve |
backtest_schema() |
GET /api/v1/backtest/schema |
start_backtest(...) |
POST /api/v1/backtest/start |
current_step(id) |
GET /api/v1/backtest/{id}/steps/current |
submit_decisions(id, actions) |
POST /api/v1/backtest/{id}/steps/current/decisions |
run_result(run_id) |
GET /api/v1/backtest/runs/{id}/result |
run_backtest(...) |
full loop helper |
License
OpenMDW-1.0 — see LICENSE. Copyright (c) SecureFinAI Lab.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentictrading-0.1.0.tar.gz.
File metadata
- Download URL: agentictrading-0.1.0.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ea0dcdcd9522ed36c9ad5deab081116c30a98fb2c0621eaf177a685650f319d
|
|
| MD5 |
ad8f0f203cb780fac4c30709bfd76b4b
|
|
| BLAKE2b-256 |
89d5d28bfe6545b715a0b38322c158ad1d4d0176ae6a11064793a69a77397c01
|
File details
Details for the file agentictrading-0.1.0-py3-none-any.whl.
File metadata
- Download URL: agentictrading-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b32cfbf707665a07bbeeca0a5aa5930bc5c8e70ed986fe19f0d5edbdf6f12db
|
|
| MD5 |
b1d36747c59d61cf0fe2355fccd829ed
|
|
| BLAKE2b-256 |
c9af1f0831a242e6a48404606436a6380ad043d8d205e9ecfc0ffdbdeee46b25
|