Repository navigation
BotTrade 0.2.0 — Custom Agent API
Custom agents are now the primary Python interface.
import bottrade
def decide(observation):
symbol = observation.scenario.benchmark_symbol
if observation.position(symbol):
return bottrade.hold()
return bottrade.buy(symbol, quantity=10)
result = bottrade.backtest(decide, scenario="sandbox-nov-2024")
print(result.return_pct)Added
backtest()for synchronous functions and stateful agent objectsbacktest_async()for async agentssession()for manual observe, submit, step, and results control- typed
Observation,Order,Decision,BacktestResult, andAgentInfo buy,sell,short,cover, andholdhelpers- structured agent provenance on private and public run evidence
bottrade backtest module:attributeCLI- explicit
strategies.buy_and_hold(quantity=...)reference agent - example-first human and machine documentation
Verification
All ten CI checks passed across Python 3.11–3.13, five example interfaces, package validation, and the pinned AI Hedge Fund upstream contract. The SDK passed Ruff, strict mypy, 29 tests, isolated wheel and sdist builds, Twine validation, and a clean wheel installation.