tradier_broker/ mirrors every trading call the live loop makes on AlpacaPaperClient (account, clock, positions, orders, submit incl. bracket->OTOCO, cancel, replace, close) with identical signatures and Alpaca-shaped returns, so trading_execution / exit_manager / flatten / execution / sync run unchanged. Market data always delegates to Alpaca. - BROKER=tradier (+ TRADIER_* env) swaps execution client in run_live_paper; default path untouched - client_order_id -> tag preserves the lost-submit reconcile - TradierApiError subclasses AlpacaApiError so the executor's rejection-vs-transport fork works as-is - sandbox-verified: balances/clock/positions/orders, OTOCO preview (result:true), place -> tag lookup -> cancel round trip - 18 unit tests (translation + client paths); executor integration checked - docs/TRADIER-FALLBACK.md switch runbook Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
19 lines
851 B
Python
19 lines
851 B
Python
"""Tradier brokerage mirror of the Alpaca execution surface.
|
|
|
|
Redundancy path: if the Alpaca live account stays blocked, the live loop can
|
|
switch brokers with BROKER=tradier (+ TRADIER_* env). The client exposes the
|
|
same method names/signatures as AlpacaPaperClient for every trading call the
|
|
live loop uses, and returns Alpaca-SHAPED dicts, so trading_execution,
|
|
runtime/exit_manager, runtime/flatten, alpaca_paper.sync and
|
|
alpaca_paper.execution all run unchanged.
|
|
|
|
Market data (bars, screeners, quotes, news) stays on Alpaca — data keys work
|
|
without a live brokerage account — via an injected AlpacaPaperClient the
|
|
Tradier client delegates data calls to.
|
|
"""
|
|
|
|
from tradier_broker.client import TradierApiError, TradierClient
|
|
from tradier_broker.settings import TradierSettings
|
|
|
|
__all__ = ["TradierClient", "TradierApiError", "TradierSettings"]
|